这书能让你戒烟 txt:回调函数
来源:百度文库 编辑:九乡新闻网 时间:2024/04/29 03:32:54
VB.NET经过长时间的发展,很多用户都很了解VB.NET回调函数了,这里我发表一下个人理解,和大家讨论讨论。创建数据库事件处理函数(VB.NET回调函数)
无论什么时候一个对象被打开并要被修改时,数据库事件处理函数会被调用。当然,如果这时我们监视的命令不是活动的,我们就应该跳过任何被这个VB.NET回调函数调用的内容。
If bEditCommand = False Then
Return
End If
同样地,如果我们监视的命令已经结束,而ObjectOpenedForModify事件被另一个VB.NET回调函数再次触发的话,而这时有对象被修改时,我们要阻止所有由这个VB.NET回调函数执行的动作。
If bDoRepositioning = True Then
Return
End If
这个VB.NET回调函数剩余部分的代码用来验证我们是否正在处理EMPLOYEE块索引。如果是的话,我们就获取它的ObjectID和位置(三维点)。下面的代码可以被粘贴到这个事件处理函数函数。
- Public Sub objOpenedForMod(ByVal o As Object, ByVal e As ObjectEventArgs)
- If bEditCommand = False Then
- Return
- End If
- If bDoRepositioning = True Then
- Return
- End If
- Dim objId As ObjectId
- objId = e.DBObject.ObjectId
- Dim trans As Transaction
- Dim bt As BlockTable
- Dim db As Database
- db = HostApplicationServices.WorkingDatabase
- trans = db.TransactionManager.StartTransaction()
- Try
- 'Use it to open the current object!
- Dim ent As Entity = trans.GetObject(objId, OpenMode.ForRead, False)
- If TypeOf ent Is BlockReference Then 'We use .NET's RTTI to establish type.
- Dim br As BlockReference = CType(ent, BlockReference)
- 'Test whether it is an employee block
- 'open its extension dictionary
- If br.ExtensionDictionary().IsValid Then
- Dim brExtDict As DBDictionary = trans.GetObject(br.ExtensionDictionary(), OpenMode.ForRead)
- If brExtDict.GetAt("EmployeeData").IsValid Then
- 'successfully got "EmployeeData" so br is employee block ref
- 'Store the objectID and the position
- changedObjects.Add(objId)
- employeePositions.Add(br.Position)
- 'Get the attribute references,if any
- Dim atts As AttributeCollection
- atts = br.AttributeCollection
- If atts.Count > 0 Then
- Dim attId As ObjectId
- For Each attId In atts
- Dim att As AttributeReference
- att = trans.GetObject(attId, OpenMode.ForRead, False)
- changedObjects.Add(attId)
- employeePositions.Add(att.Position)
- Next
- End If
- End If
- End If
- End If
- trans.Commit()
- Finally
- trans.Dispose()
- End Try
- End Sub
回调函数
回调函数packet_handler()
回调函数
回调函数
C++回调函数用法
[我的笔记]回调函数
维基百科--回调函数
WinAPI: 钩子回调函数之 MsgFilterProc
WinAPI: 钩子回调函数之 JournalRecordProc
WinAPI: 钩子回调函数之 KeyboardProc
WinAPI: 钩子回调函数之 JournalPlaybackProc
WinAPI: 钩子回调函数之 CallWndProc
WinAPI: 钩子回调函数之 CBTProc
WinAPI: 钩子回调函数之 SysMsgFilterProc
WinAPI: 钩子回调函数之 HardwareProc
WinAPI: 钩子回调函数之 DebugProc
WinAPI: 钩子回调函数之 ShellProc
WinAPI: 钩子回调函数之 ForegroundIdleProc
WinAPI: 钩子回调函数之 CallWndProcRetProc
20.4.4 RibbonX控件回调函数实例(1) - 51CTO.COM
回 调 函 数
统计数,估计数
数鸭子
数脉搏