Search Results for

    Show / Hide Table of Contents

    Class Enhancing.Enhancer<TEnhancement>

    Wrap and unwrap the instances of model classes with enhancement.

    Inheritance
    System.Object
    Enhancing.Enhancer<TEnhancement>
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: AasCore.Aas3_0_RC02
    Assembly: AasCore.Aas3_0_RC02.dll
    Syntax
    public class Enhancer<TEnhancement>
        where TEnhancement : class
    Type Parameters
    Name Description
    TEnhancement

    type of the enhancement

    Constructors

    | Improve this Doc View Source

    Enhancer(Func<IClass, TEnhancement>)

    Declaration
    public Enhancer(Func<IClass, TEnhancement> enhancementFactory)
    Parameters
    Type Name Description
    System.Func<IClass, TEnhancement> enhancementFactory

    how to enhance the instances.

    If it returns null, the instance will not be wrapped. However, the wrapping will continue recursively.

    Methods

    | Improve this Doc View Source

    MustUnwrap(IClass)

    Unwrap the given model instance.

    Declaration
    public TEnhancement MustUnwrap(IClass that)
    Parameters
    Type Name Description
    IClass that

    model instance to be unwrapped

    Returns
    Type Description
    TEnhancement

    Enhancement wrapped around that

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when that has not been wrapped yet

    | Improve this Doc View Source

    Unwrap(IClass)

    Unwrap the given model instance.

    Declaration
    public TEnhancement Unwrap(IClass that)
    Parameters
    Type Name Description
    IClass that

    model instance to be unwrapped

    Returns
    Type Description
    TEnhancement

    Enhancement, or null if that has not been wrapped yet.

    | Improve this Doc View Source

    Wrap(IClass)

    Wrap the instance with an enhancement.

    Declaration
    public IClass Wrap(IClass that)
    Parameters
    Type Name Description
    IClass that

    model instance to be wrapped

    Returns
    Type Description
    IClass

    that instance wrapped recursively with enhancements

    Remarks

    Double wraps are not allowed to prevent runtime leakage.

    If you use references to the instance objects, you have to update them after the wrapping, as the wrapping is recursive.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when that has been already wrapped

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX