Show / Hide Table of Contents

Class EventBase<THandler>

Represents reflected event.

Inheritance
Object
MemberInfo
EventInfo
EventBase<THandler>
Event<THandler>
Event<T, THandler>
Implements
IEvent
IMember<EventInfo>
ICustomAttributeProvider
IEquatable<EventInfo>
Inherited Members
EventInfo.AddEventHandler(Object, Delegate)
EventInfo.GetAddMethod()
EventInfo.GetOtherMethods()
EventInfo.GetRaiseMethod()
EventInfo.GetRemoveMethod()
EventInfo.RemoveEventHandler(Object, Delegate)
EventInfo.IsSpecialName
MemberInfo.HasSameMetadataDefinitionAs(MemberInfo)
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public class EventBase<THandler> : EventInfo, IEvent, IMember<EventInfo>, ICustomAttributeProvider, IEquatable<EventInfo> where THandler : MulticastDelegate
Type Parameters
Name Description
THandler

A delegate representing event handler.

Properties

| Improve this Doc View Source

AddMethod

Gets event subscription method.

Declaration
public override sealed MethodInfo AddMethod { get; }
Property Value
Type Description
MethodInfo
Overrides
EventInfo.AddMethod
| Improve this Doc View Source

Attributes

Gets the attributes associated with this event.

Declaration
public override sealed EventAttributes Attributes { get; }
Property Value
Type Description
EventAttributes
Overrides
EventInfo.Attributes
| Improve this Doc View Source

CustomAttributes

Gets a collection that contains this member's custom attributes.

Declaration
public override sealed IEnumerable<CustomAttributeData> CustomAttributes { get; }
Property Value
Type Description
IEnumerable<CustomAttributeData>
Overrides
MemberInfo.CustomAttributes
| Improve this Doc View Source

DeclaringType

Gets the class that declares this constructor.

Declaration
public override sealed Type DeclaringType { get; }
Property Value
Type Description
Type
Overrides
MemberInfo.DeclaringType
| Improve this Doc View Source

EventHandlerType

Gets the the underlying event-handler delegate associated with this event.

Declaration
public override sealed Type EventHandlerType { get; }
Property Value
Type Description
Type
Overrides
EventInfo.EventHandlerType
| Improve this Doc View Source

IsMulticast

Gets a value indicating whether the event is multicast.

Declaration
public override sealed bool IsMulticast { get; }
Property Value
Type Description
Boolean
Overrides
EventInfo.IsMulticast
| Improve this Doc View Source

MemberType

Always returns Event.

Declaration
public override sealed MemberTypes MemberType { get; }
Property Value
Type Description
MemberTypes
Overrides
EventInfo.MemberType
| Improve this Doc View Source

MetadataToken

Gets a value that identifies a metadata element.

Declaration
public override sealed int MetadataToken { get; }
Property Value
Type Description
Int32
Overrides
MemberInfo.MetadataToken
| Improve this Doc View Source

Module

Gets the module in which the type that declares the event represented by the current instance is defined.

Declaration
public override sealed Module Module { get; }
Property Value
Type Description
Module
Overrides
MemberInfo.Module
| Improve this Doc View Source

Name

Gets name of the event.

Declaration
public override sealed string Name { get; }
Property Value
Type Description
String
Overrides
MemberInfo.Name
| Improve this Doc View Source

RaiseMethod

Gets the method that is called when the event is raised, including non-public methods.

Declaration
public override sealed MethodInfo RaiseMethod { get; }
Property Value
Type Description
MethodInfo
Overrides
EventInfo.RaiseMethod
| Improve this Doc View Source

ReflectedType

Gets the class object that was used to obtain this instance.

Declaration
public override sealed Type ReflectedType { get; }
Property Value
Type Description
Type
Overrides
MemberInfo.ReflectedType
| Improve this Doc View Source

RemoveMethod

Gets event unsubscription method.

Declaration
public override sealed MethodInfo RemoveMethod { get; }
Property Value
Type Description
MethodInfo
Overrides
EventInfo.RemoveMethod

Methods

| Improve this Doc View Source

AddEventHandler(Object, THandler)

Adds an event handler to an event source.

Declaration
public virtual bool AddEventHandler(object target, THandler handler)
Parameters
Type Name Description
Object target

The event source.

THandler handler

Encapsulates a method or methods to be invoked when the event is raised by the target.

Returns
Type Description
Boolean

true, if arguments are correct; otherwise, false.

| Improve this Doc View Source

Equals(Object)

Determines whether this event is equal to the given event.

Declaration
public override sealed bool Equals(object other)
Parameters
Type Name Description
Object other

Other event to compare.

Returns
Type Description
Boolean

true if this object reflects the same event as the specified object; otherwise, false.

Overrides
EventInfo.Equals(Object)
| Improve this Doc View Source

Equals(EventInfo)

Determines whether this event is equal to the given event.

Declaration
public bool Equals(EventInfo other)
Parameters
Type Name Description
EventInfo other

Other event to compare.

Returns
Type Description
Boolean

true if this object reflects the same event as the specified object; otherwise, false.

| Improve this Doc View Source

GetAddMethod(Boolean)

Gets event subscription method.

Declaration
public override sealed MethodInfo GetAddMethod(bool nonPublic)
Parameters
Type Name Description
Boolean nonPublic

true if non-public methods can be returned; otherwise, false.

Returns
Type Description
MethodInfo

Event subscription method.

Overrides
EventInfo.GetAddMethod(Boolean)
Exceptions
Type Condition
MethodAccessException

nonPublic is true, the method used to add an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods.

| Improve this Doc View Source

GetCustomAttributes(Boolean)

Returns an array of all custom attributes applied to this event.

Declaration
public override sealed object[] GetCustomAttributes(bool inherit)
Parameters
Type Name Description
Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false.

Returns
Type Description
Object[]

An array that contains all the custom attributes applied to this event.

Overrides
MemberInfo.GetCustomAttributes(Boolean)
| Improve this Doc View Source

GetCustomAttributes(Type, Boolean)

Returns an array of all custom attributes applied to this event.

Declaration
public override sealed object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
Type Name Description
Type attributeType

The type of attribute to search for. Only attributes that are assignable to this type are returned.

Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false.

Returns
Type Description
Object[]

An array that contains all the custom attributes applied to this event.

Overrides
MemberInfo.GetCustomAttributes(Type, Boolean)
| Improve this Doc View Source

GetCustomAttributesData()

Returns a list of custom attributes that have been applied to the target event.

Declaration
public override sealed IList<CustomAttributeData> GetCustomAttributesData()
Returns
Type Description
IList<CustomAttributeData>

The data about the attributes that have been applied to the target event.

Overrides
MemberInfo.GetCustomAttributesData()
| Improve this Doc View Source

GetHashCode()

Computes hash code uniquely identifies the reflected event.

Declaration
public override sealed int GetHashCode()
Returns
Type Description
Int32

The hash code of the event.

Overrides
EventInfo.GetHashCode()
| Improve this Doc View Source

GetOtherMethods(Boolean)

Returns the methods that have been associated with the event in metadata using the .other directive, specifying whether to include non-public methods.

Declaration
public override sealed MethodInfo[] GetOtherMethods(bool nonPublic)
Parameters
Type Name Description
Boolean nonPublic

true if non-public methods can be returned; otherwise, false.

Returns
Type Description
MethodInfo[]

An array of event methods.

Overrides
EventInfo.GetOtherMethods(Boolean)
| Improve this Doc View Source

GetRaiseMethod(Boolean)

Gets the method that is called when the event is raised.

Declaration
public override sealed MethodInfo GetRaiseMethod(bool nonPublic)
Parameters
Type Name Description
Boolean nonPublic

true if non-public methods can be returned; otherwise, false.

Returns
Type Description
MethodInfo

Raise method.

Overrides
EventInfo.GetRaiseMethod(Boolean)
Exceptions
Type Condition
MethodAccessException

nonPublic is true, the method is non-public, and the caller does not have permission to reflect on non-public methods.

| Improve this Doc View Source

GetRemoveMethod(Boolean)

Gets event unsubscription method.

Declaration
public override sealed MethodInfo GetRemoveMethod(bool nonPublic)
Parameters
Type Name Description
Boolean nonPublic

true if non-public methods can be returned; otherwise, false.

Returns
Type Description
MethodInfo

Event unsubscription method.

Overrides
EventInfo.GetRemoveMethod(Boolean)
Exceptions
Type Condition
MethodAccessException

nonPublic is true, the method used to remove an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods.

| Improve this Doc View Source

IsDefined(Type, Boolean)

Determines whether one or more attributes of the specified type or of its derived types is applied to this event.

Declaration
public override sealed bool IsDefined(Type attributeType, bool inherit)
Parameters
Type Name Description
Type attributeType

The type of custom attribute to search for. The search includes derived types.

Boolean inherit

true to search this member's inheritance chain to find the attributes; otherwise, false.

Returns
Type Description
Boolean

true if one or more instances of attributeType or any of its derived types is applied to this event; otherwise, false.

Overrides
MemberInfo.IsDefined(Type, Boolean)
| Improve this Doc View Source

RemoveEventHandler(Object, THandler)

Removes an event handler from an event source.

Declaration
public virtual bool RemoveEventHandler(object target, THandler handler)
Parameters
Type Name Description
Object target

The event source.

THandler handler

The delegate to be disassociated from the events raised by target.

Returns
Type Description
Boolean

true, if arguments are correct; otherwise, false.

| Improve this Doc View Source

ToString()

Returns textual representation of this event.

Declaration
public override sealed string ToString()
Returns
Type Description
String

The textual representation of this event.

Overrides
Object.ToString()

Explicit Interface Implementations

| Improve this Doc View Source

IMember<EventInfo>.RuntimeMember

Declaration
EventInfo IMember<EventInfo>.RuntimeMember { get; }
Returns
Type Description
EventInfo

Implements

IEvent
IMember<TMember>
System.Reflection.ICustomAttributeProvider
System.IEquatable<T>

Extension Methods

AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, CancellationToken)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>)
ObjectExtensions.As<T>(T)
CustomAttribute.IsDefined<TAttribute>(ICustomAttributeProvider, Boolean)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX