Show / Hide Table of Contents

Class DelegateReference

Represents a reference to a Delegate that may contain a WeakReference to the target. This class is used internally by the Composite Application Library.

Inheritance
object
DelegateReference
Implements
IDelegateReference
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Events
Assembly: Sartorius.SAF.dll
Syntax
public class DelegateReference : IDelegateReference

Constructors

View Source

DelegateReference(Delegate, bool)

Initializes a new instance of DelegateReference.

Declaration
public DelegateReference(Delegate @delegate, bool keepReferenceAlive)
Parameters
Type Name Description
Delegate delegate

The original Delegate to create a reference for.

bool keepReferenceAlive

If false the class will create a weak reference to the delegate, allowing it to be garbage collected. Otherwise it will keep a strong reference to the target.

Exceptions
Type Condition
ArgumentNullException

If the passed delegate is not assignable to Delegate.

Properties

View Source

Target

Gets the Delegate (the target) referenced by the current DelegateReference object.

Declaration
public Delegate Target { get; }
Property Value
Type Description
Delegate

null if the object referenced by the current DelegateReference object has been garbage collected; otherwise, a reference to the Delegate referenced by the current DelegateReference object.

Implements

IDelegateReference

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX