Describes prohibited edits of Delegate and Event declarations.
说明委派和事件宣告所禁止的编辑。
Can someone tell me where is the delegate and event keyword defined?
谁能告诉我哪里是委托和事件关键字定义?
For this, I created a delegate and fire the event SearchGrid, when the search button is hit.
为此,我创建了一个委托和事件SearchGrid,搜索按钮时被击中。
And I have read some article about event and delegate, too.
我读了一些有关事件,并委托文章了。
If your class raises multiple events and you program these as described in Raising an event, the compiler generates one field per event delegate instance.
如果您的类引发多个事件,并且您按引发事件中的说明对这些事件进行编程,编译器将为每个事件委托实例生成一个字段。
For example, a button-click event and a menu-command-click event can both invoke the same delegate, which then calls a single method to handle these separate events the same way.
例如,单击按钮事件和单击菜单命令事件都能调用同一委托,然后该委托调用单个方法以相同方式处理各个事件。
To implement multiple event properties in a class, the class must internally store and maintain the delegate defined for each event.
要在一个类中实现多个事件属性,该类必须在内部存储和维护为每个事件定义的委托。
The event property accessors use the predefined key for the event property to add and remove instances from the delegate collection.
事件属性访问器使用事件属性的预定义键在委托集合中添加和从委托集合中移除实例。
An example where this is useful is when your object is serializable and you have an event that is handled by a non-serializable delegate object.
一个展示了自定义事件访问器有用一面的例子,就是当你的对象是可序列化的、并且你有一个可以被一个不可序列化的委托对象处理的事件的时候。
An event handler, a delegate type, that invokes the exposed method can be added to any event as long as the handler and event signatures match.
只要事件处理程序和事件签名匹配,就可以将调用已公开方法的该事件处理程序(委托类型)添加到任何事件。
This strategy means that the control does not need to maintain a list of target objects for event notification-the delegate handles all registration and notification.
此策略意味着控件不需要维护事件通知的目标对象列表——委托可处理所有的注册和通知。
When the event is raised, the delegate instance and its associated event handler method is called.
引发该事件时,就会调用该委托实例及其关联的事件处理程序方法。
The collection class must provide methods for setting, accessing, and retrieving the event handler delegate based on the event key.
集合类别必须提供方法,根据事件索引键来设定、存取和撷取事件处理常式委派。
To unsubscribe in this scenario, it is necessary to go back to the code where you subscribe to the event, store the anonymous method in a delegate variable, and then add the delegate to the event.
若要在这种情况下取消订阅,必须回到订阅该事件的程序码,并将此匿名方法储存到委派变数内,然后再将该委派加入此事件中。
To unsubscribe in this scenario, it is necessary to go back to the code where you subscribe to the event, store the anonymous method in a delegate variable, and then add the delegate to the event.
若要在这种情况下取消订阅,必须回到订阅该事件的程序码,并将此匿名方法储存到委派变数内,然后再将该委派加入此事件中。
应用推荐