Generated by DocFX

Class WeakEventListener<TInstance, TSource, TEventArgs>

Implements a weak event listener that allows the owner to be garbage collected if its only remaining link is an event handler.

Inheritance
System.Object
WeakEventListener<TInstance, TSource, TEventArgs>
Namespace: ISynergy.Framework.Core.Events
Assembly: ISynergy.Framework.Core.dll
Syntax
public sealed class WeakEventListener<TInstance, TSource, TEventArgs> : object where TInstance : class
Type Parameters
Name Description
TInstance

Type of instance listening for the event.

TSource

Type of source for the event.

TEventArgs

Type of event arguments for the event.

Constructors

View Source

WeakEventListener(TInstance)

Initializes a new instance of the WeakEventListener<TInstance, TSource, TEventArgs> class.

Declaration
public WeakEventListener(TInstance instance)
Parameters
Type Name Description
TInstance instance

Instance subscribing to the event.

Properties

View Source

OnDetachAction

Gets or sets the method to call when detaching from the event.

Declaration
public Action<WeakEventListener<TInstance, TSource, TEventArgs>> OnDetachAction { get; set; }
Property Value
Type Description
Action<WeakEventListener<TInstance, TSource, TEventArgs>>
View Source

OnEventAction

Gets or sets the method to call when the event fires.

Declaration
public Action<TInstance, TSource, TEventArgs> OnEventAction { get; set; }
Property Value
Type Description
Action<TInstance, TSource, TEventArgs>

Methods

View Source

Detach()

Detaches from the subscribed event.

Declaration
public void Detach()
View Source

OnEvent(TSource, TEventArgs)

Handler for the subscribed event calls OnEventAction to handle it.

Declaration
public void OnEvent(TSource source, TEventArgs eventArgs)
Parameters
Type Name Description
TSource source

Event source.

TEventArgs eventArgs

Event arguments.

Extension Methods

Matrix.Replace<T>(T, Object, Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
EntityBaseExtensions.HasProperty(Object, String)
ArrayExtensions.Concatenate<T>(T, T[])
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, Boolean>)
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>)
ObjectExtensions.Clone<T>(T)
ObjectExtensions.To<T>(Object)
ObjectExtensions.To(Object, Type)
ObjectExtensions.HasMethod(Object, String)
ObjectExtensions.AddressOf<T>(T)
ReflectionExtensions.GetIdentityValue<T>(T)
ReflectionExtensions.GetIdentityValue<T, TResult>(T)
ReflectionExtensions.GetIdentityProperty<T>(T)
ReflectionExtensions.HasIdentityProperty<T>(T)
ReflectionExtensions.GetPropertyValue<T, TResult>(T, String, TResult)
ReflectionExtensions.GetPropertyInfo<T, TValue>(T, Expression<Func<T, TValue>>)
ReflectionExtensions.GetTitleValue<T>(T)
ReflectionExtensions.HasParentIdentityProperty<T>(T)
ReflectionExtensions.GetParentIdentityProperty<T>(T)
ReflectionExtensions.IsFreeApplication<T>(T)