System.Reflection.Emit.EventBuilder Class

Assembly: Mscorlib.dll
Namespace: System.Reflection.Emit
Summary
Defines events for a class.
C# Syntax:
public sealed class EventBuilder
Thread Safety
Reflection Emit is thread-safe when using assemblies that were created with the AppDomain.DefineDynamicAssembly method with the Boolean parameter isSynchronized set to true.
Remarks
An EventBuilder is always associated with a TypeBuilder. The TypeBuilder.DefineEvent method will return a new EventBuilder to a client.
See also:
System.Reflection.Emit Namespace

System.Reflection.Emit.EventBuilder Member List:

Public Methods
AddOtherMethod Adds one of the "other" methods associated with this event. "Other" methods are methods other than the "on" and "raise" methods associated with an event. This function can be called many times to add as many "other" methods.
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetEventToken Returns the token for this event.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
SetAddOnMethod Sets the method used to subscribe to this event.
SetCustomAttribute Overloaded:
SetCustomAttribute(CustomAttributeBuilder customBuilder)

Sets a custom attribute using a custom attribute builder.
SetCustomAttribute Overloaded:
SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)

Set a custom attribute using a specified custom attribute blob.
SetRaiseMethod Sets the method used to raise this event.
SetRemoveOnMethod Sets the method used to unsubscribe to this event.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Reflection.Emit.EventBuilder Member Details

Method: AddOtherMethod(
   MethodBuilder mdBuilder
)
Summary
Adds one of the "other" methods associated with this event. "Other" methods are methods other than the "on" and "raise" methods associated with an event. This function can be called many times to add as many "other" methods.
C# Syntax:
public void AddOtherMethod(
   MethodBuilder mdBuilder
);
Parameters:

mdBuilder

A MethodBuilder object that represents the other method.

Exceptions
Exception Type Condition
ArgumentNullException mdBuilder is null.
InvalidOperationException TypeBuilder.CreateType has been called on the enclosing type.

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~EventBuilder();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetEventToken()
Summary
Returns the token for this event.
C# Syntax:
public EventToken GetEventToken();
Return Value:
Returns the EventToken for this event.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: SetAddOnMethod(
   MethodBuilder mdBuilder
)
Summary
Sets the method used to subscribe to this event.
C# Syntax:
public void SetAddOnMethod(
   MethodBuilder mdBuilder
);
Parameters:

mdBuilder

A MethodBuilder object that represents the method used to subscribe to this event.

Exceptions
Exception Type Condition
ArgumentNullException mdBuilder is null.
InvalidOperationException TypeBuilder.CreateType has been called on the enclosing type.

Return to top


Overloaded Method: SetCustomAttribute(
   CustomAttributeBuilder customBuilder
)
Summary
Sets a custom attribute using a custom attribute builder.
C# Syntax:
public void SetCustomAttribute(
   CustomAttributeBuilder customBuilder
);
Parameters:

customBuilder

An instance of a helper class to describe the custom attribute.

Exceptions
Exception Type Condition
ArgumentNullException con is null.
InvalidOperationException TypeBuilder.CreateType has been called on the enclosing type.

Return to top


Overloaded Method: SetCustomAttribute(
   ConstructorInfo con,
   byte[] binaryAttribute
)
Summary
Set a custom attribute using a specified custom attribute blob.
C# Syntax:
public void SetCustomAttribute(
   ConstructorInfo con,
   byte[] binaryAttribute
);
Parameters:

con

The constructor for the custom attribute.

binaryAttribute

A byte blob representing the attributes.

Exceptions
Exception Type Condition
ArgumentNullException con or binaryAttribute is null.
InvalidOperationException TypeBuilder.CreateType has been called on the enclosing type.
Remarks
See the for details on how to format binaryAttribute.

Return to top


Method: SetRaiseMethod(
   MethodBuilder mdBuilder
)
Summary
Sets the method used to raise this event.
C# Syntax:
public void SetRaiseMethod(
   MethodBuilder mdBuilder
);
Parameters:

mdBuilder

A MethodBuilder object that represents the method used to raise this event.

Exceptions
Exception Type Condition
ArgumentNullException mdBuilder is null.
InvalidOperationException TypeBuilder.CreateType has been called on the enclosing type.

Return to top


Method: SetRemoveOnMethod(
   MethodBuilder mdBuilder
)
Summary
Sets the method used to unsubscribe to this event.
C# Syntax:
public void SetRemoveOnMethod(
   MethodBuilder mdBuilder
);
Parameters:

mdBuilder

A MethodBuilder object that represents the method used to unsubscribe to this event.

Exceptions
Exception Type Condition
ArgumentNullException mdBuilder is null.
InvalidOperationException TypeBuilder.CreateType has been called on the enclosing type.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.