Search Results for

    Show / Hide Table of Contents

    Class TransientReference

    A comparable weak reference to an object which will not prevent garbage collection. It will positively compare against similar targeted reference trackers as well as the actual target object.

    Inheritance
    System.Object
    System.WeakReference
    TransientReference
    Implements
    System.Runtime.Serialization.ISerializable
    System.IComparable
    System.IComparable<TransientReference>
    System.IComparable<System.WeakReference>
    System.IEquatable<TransientReference>
    System.IEquatable<System.WeakReference>
    Inherited Members
    System.WeakReference.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
    System.WeakReference.IsAlive
    System.WeakReference.Target
    System.WeakReference.TrackResurrection
    Namespace: GDX.Developer
    Syntax
    public class TransientReference : WeakReference, ISerializable, IComparable, IComparable<TransientReference>, IComparable<WeakReference>, IEquatable<TransientReference>, IEquatable<WeakReference>
    Remarks

    There isn't a lot of great use cases for using this sort of thing; System.WeakReference on its own is sufficient in most of the use cases, however this particular arrangement is useful for developer-ish stuff.

    Constructors

    | Improve this Doc View Source

    TransientReference(Object)

    Create a TransientReference referencing the target.

    Declaration
    public TransientReference(object target)
    Parameters
    Type Name Description
    System.Object target

    The target System.Object to reference.

    | Improve this Doc View Source

    TransientReference(Object, Boolean)

    Create a TransientReference referencing the target.

    Declaration
    public TransientReference(object target, bool trackResurrection)
    Parameters
    Type Name Description
    System.Object target

    The target System.Object to reference.

    System.Boolean trackResurrection

    Should the object remain tracked after it has been finalized.

    | Improve this Doc View Source

    TransientReference(SerializationInfo, StreamingContext)

    Create a TransientReference from the info.

    Declaration
    protected TransientReference(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    A System.Runtime.Serialization.SerializationInfo representation of a TransientReference.

    System.Runtime.Serialization.StreamingContext context

    Describes the source of the System.Runtime.Serialization.SerializationInfo.

    Methods

    | Improve this Doc View Source

    CompareTo(TransientReference)

    Compare this TransientReference to the target TransientReference.

    Declaration
    public int CompareTo(TransientReference obj)
    Parameters
    Type Name Description
    TransientReference obj

    The target TransientReference to compare against.

    Returns
    Type Description
    System.Int32

    1 if the same, 0 otherwise.

    | Improve this Doc View Source

    CompareTo(Object)

    Compare this TransientReference to the target System.Object.

    Declaration
    public int CompareTo(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The target System.Object to compare against.

    Returns
    Type Description
    System.Int32

    1 if the same, 0 otherwise.

    | Improve this Doc View Source

    CompareTo(WeakReference)

    Compare this TransientReference to the target System.WeakReference.

    Declaration
    public int CompareTo(WeakReference obj)
    Parameters
    Type Name Description
    System.WeakReference obj

    The target System.WeakReference to compare against.

    Returns
    Type Description
    System.Int32

    1 if the same, 0 otherwise.

    | Improve this Doc View Source

    Equals(TransientReference)

    Does this TransientReference equal the target TransientReference.

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

    The target TransientReference to compare with.

    Returns
    Type Description
    System.Boolean

    true if it is the same, false otherwise.

    | Improve this Doc View Source

    Equals(Object)

    Does this TransientReference equal the target System.Object.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The target System.Object to compare with.

    Returns
    Type Description
    System.Boolean

    true if it is the same, false otherwise.

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

    Equals(WeakReference)

    Does this TransientReference equal the target System.WeakReference.

    Declaration
    public bool Equals(WeakReference other)
    Parameters
    Type Name Description
    System.WeakReference other

    The target System.WeakReference to compare with.

    Returns
    Type Description
    System.Boolean

    true if it is the same, false otherwise.

    | Improve this Doc View Source

    GetHashCode()

    Return the hashcode of the System.WeakReference.Target.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    Returns the System.WeakReference.Target's hash code, or -1 if null.

    Overrides
    System.Object.GetHashCode()

    Operators

    | Improve this Doc View Source

    Equality(TransientReference, TransientReference)

    Compare TransientReferences to see if they are equal.

    Declaration
    public static bool operator ==(TransientReference left, TransientReference right)
    Parameters
    Type Name Description
    TransientReference left

    Left-side TransientReference.

    TransientReference right

    Right-side TransientReference.

    Returns
    Type Description
    System.Boolean

    true/false if they are equal.

    | Improve this Doc View Source

    Inequality(TransientReference, TransientReference)

    Compare TransientReferences to see if they are not equal.

    Declaration
    public static bool operator !=(TransientReference left, TransientReference right)
    Parameters
    Type Name Description
    TransientReference left

    Left-side TransientReference.

    TransientReference right

    Right-side TransientReference.

    Returns
    Type Description
    System.Boolean

    true/false if they are not equal.

    Implements

    System.Runtime.Serialization.ISerializable
    System.IComparable
    System.IComparable<T>
    System.IComparable<T>
    System.IEquatable<T>
    System.IEquatable<T>
    • Improve this Doc
    • View Source
    In This Article
    Back to top Built on 2024-01-01 against 1f69a68.
    Generated by Dox+DocFX.