Search Results for

    Show / Hide Table of Contents

    Class Singleton<T>

    A class to handle object instances.

    Inheritance
    System.Object
    TypeCastObject<T>
    Singleton<T>
    Inherited Members
    TypeCastObject<T>.Cast<TObject>()
    TypeCastObject<T>.Cast<TObject>(TObject)
    TypeCastObject<T>.As<TObject>()
    TypeCastObject<T>.Is<TObject>(TObject)
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.API.Features.Core.Generic
    Assembly: Exiled.API.dll
    Syntax
    public sealed class Singleton<T> : TypeCastObject<T> where T : class
    Type Parameters
    Name Description
    T

    The type of the object to handle the instance of.

    Constructors

    | Improve this Doc View Source

    Singleton(T)

    Initializes a new instance of the Singleton<T> class.

    Declaration
    public Singleton(T value)
    Parameters
    Type Name Description
    T value

    The branch to instantiate.

    Properties

    | Improve this Doc View Source

    Instance

    Gets the relative value.

    Declaration
    public static T Instance { get; }
    Property Value
    Type Description
    T

    Methods

    | Improve this Doc View Source

    Create(T)

    Declaration
    public static void Create(T object)
    Parameters
    Type Name Description
    T object
    | Improve this Doc View Source

    Destroy(T)

    Destroys the given T instance.

    Declaration
    public static bool Destroy(T object)
    Parameters
    Type Name Description
    T object

    The object to destroy.

    Returns
    Type Description
    System.Boolean

    true if the instance was destroyed; otherwise, false.

    | Improve this Doc View Source

    Finalize()

    Finalizes an instance of the Singleton<T> class.

    Declaration
    protected void Finalize()
    | Improve this Doc View Source

    TryGet<TObject>(out TObject)

    Tries to get the relative value.

    Declaration
    public static bool TryGet<TObject>(out TObject instance)
    
        where TObject : class
    Parameters
    Type Name Description
    TObject instance

    The object instance.

    Returns
    Type Description
    System.Boolean

    true if the object instance is not null and can be casted as the specified type; otherwise, false.

    Type Parameters
    Name Description
    TObject

    The type of the object.

    Operators

    | Improve this Doc View Source

    Implicit(Singleton<T> to T)

    Converts the given Singleton<T> instance into T.

    Declaration
    public static implicit operator T(Singleton<T> instance)
    Parameters
    Type Name Description
    Singleton<T> instance

    The Singleton<T> instance to convert.

    Returns
    Type Description
    T

    Extension Methods

    ReflectionExtensions.CopyProperties(Object, Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX