Table of Contents

Class Wrapper<T>

Namespace
Cuemon
Assembly
Cuemon.Core.dll

Provides a way to wrap an object of type T.

public class Wrapper<T> : IWrapper<T>, IData

Type Parameters

T

The type of the object to wrap.

Inheritance
Object
Wrapper<T>
Implements
Derived

Constructors

Wrapper()

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

protected Wrapper()

Wrapper(T, MemberInfo)

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

public Wrapper(T instance, MemberInfo memberReference = null)

Parameters

instance T

The instance that this wrapper object represents.

memberReference MemberInfo

The member from where instance was referenced.

Properties

Data

Gets a collection of key/value pairs that provide additional user-defined information about this wrapper object.

public virtual IDictionary<string, object> Data { get; }

Property Value

IDictionary<String, Object>

An object that implements the System.Collections.Generic.IDictionary<TKey, TValue> interface and contains a collection of user-defined key/value pairs.

HasMemberReference

Gets a value indicating whether this instance has a member reference.

public virtual bool HasMemberReference { get; }

Property Value

Boolean

true if this instance has a member reference; otherwise, false.

Instance

Gets the object that this wrapper represents.

public virtual T Instance { get; protected set; }

Property Value

T

The object that this wrapper represents.

InstanceType

Gets the type of the object that this wrapper represents.

public virtual Type InstanceType { get; protected set; }

Property Value

Type

The type of the that this wrapper represents.

MemberReference

Gets the member from where Instance was referenced.

public virtual MemberInfo MemberReference { get; protected set; }

Property Value

MemberInfo

The member from where Instance was referenced.

Methods

InstanceAs<TResult>()

Returns a value that is equivalent to the instance of the object that this wrapper represents.

public TResult InstanceAs<TResult>()

Returns

TResult

A value that is equivalent to the instance of the object that this wrapper represents.

Type Parameters

TResult

The type of the return value.

Exceptions

System.InvalidCastException

The conversion is not supported - or - Instance does not implement the System.IConvertible interface.

System.FormatException

Instance is not in a format for T recognized by System.Globalization.CultureInfo.InvariantCulture.

System.OverflowException

Instance represents a number that is out of the range of T.

InstanceAs<TResult>(IFormatProvider)

Returns a value that is equivalent to the instance of the object that this wrapper represents.

public TResult InstanceAs<TResult>(IFormatProvider provider)

Parameters

provider IFormatProvider

An object that supplies culture-specific formatting information.

Returns

TResult

A value that is equivalent to the instance of the object that this wrapper represents.

Type Parameters

TResult

The type of the return value.

Exceptions

System.InvalidCastException

The conversion is not supported - or - Instance does not implement the System.IConvertible interface.

System.FormatException

Instance is not in a format for T recognized by provider.

System.OverflowException

Instance represents a number that is out of the range of T.

ToString()

Returns a System.String that represents this instance.

public override string ToString()

Returns

String

A System.String that represents this instance.