EventBindingService Class
Defines methods to create, remove, display and query the contents of the event handling class for the current editing context.
Inheritance Hierarchy
System.Object
Microsoft.Windows.Design.Services.EventBindingService
Namespace: Microsoft.Windows.Design.Services
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
Syntax
'Declaration
Public MustInherit Class EventBindingService
public abstract class EventBindingService
public ref class EventBindingService abstract
[<AbstractClass>]
type EventBindingService = class end
public abstract class EventBindingService
The EventBindingService type exposes the following members.
Constructors
Name | Description | |
---|---|---|
EventBindingService | When overridden in a derived class, initializes a new instance of the EventBindingService class. |
Top
Methods
Name | Description | |
---|---|---|
AddEventHandler | When overridden in a derived class, requests that a specified method be declared as handling a specified event. | |
AllowClassNameForMethodName | When overridden in a derived class, determines whether a class name can be used in creating a unique method name in a language. | |
AppendStatements | Appends the specified collection of CodeStatement objects to the specified event handler. | |
CreateMethod | When overridden in a derived class, creates a method that handles an event. | |
CreateUniqueMethodName | When overridden in a derived class, returns a unique method name for an event handler. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetCompatibleMethods | When overridden in a derived class, returns the names of methods that are compatible with a specified event. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetMethodHandlers | When overridden in a derived class, returns a list of methods that handle a specified event. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IsExistingMethodName | When overridden in a derived class, determines whether a method name that handles a specified event already exists. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnEventHandlerGenerated | Raises the EventHandlerGenerated event. | |
RemoveHandle | When overridden in a derived class, requests that a specific method stop handling a specific event by removing it from a Handles clause. | |
RemoveHandlesForName | Removes the event handlers for the specified element. | |
RemoveMethod | When overridden in a derived class, requests that a specific method stop handling a specific event by removing it from an event handling class. | |
SetClassName | When overridden in a derived class, identifies the methods that the binding service is referring to as belonging to the specified class. | |
ShowMethod | When overridden in a derived class, attempts to display the specified method to the user. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
ValidateMethodName | When overridden in a derived class, determines whether a method name is a valid method name and raises an exception if it is not. |
Top
Events
Name | Description | |
---|---|---|
EventHandlerGenerated | Occurs when a method is associated with a ModelEvent as a result of a call to the AddEventHandler method. |
Top
Remarks
There are two ways to associate events with event handlers in Visual Studio. The first is by using the Handles keyword, and the second is by using the AddHandler and RemoveHandler methods. In C#, using += and -= with an EventHandler corresponds to AddHandler and RemoveHandler. Both ways can be used in Visual Basic. Only the second way can be used in C#. For more information, see the following topics:
Creating Event Handlers in Windows Forms
You can use the EventBindingService class to extend this behavior.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.Windows.Design.Services Namespace