Class Wrapper<T>
Provides a way to wrap an object of type T
.
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public class Wrapper<T> : IWrapper<T>, IData
Type Parameters
Name | Description |
---|---|
T | The type of the object to wrap. |
Constructors
| Improve this DocWrapper()
Initializes a new instance of the Wrapper<T> class.
Declaration
protected Wrapper()
Wrapper(T, MemberInfo)
Initializes a new instance of the Wrapper<T> class.
Declaration
public Wrapper(T instance, MemberInfo memberReference = null)
Parameters
Type | Name | Description |
---|---|---|
T | instance | The instance that this wrapper object represents. |
System.Reflection.MemberInfo | memberReference | The member from where |
Properties
| Improve this DocData
Gets a collection of key/value pairs that provide additional user-defined information about this wrapper object.
Declaration
public virtual IDictionary<string, object> Data { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, System.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.
Declaration
public virtual bool HasMemberReference { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Instance
Gets the object that this wrapper represents.
Declaration
public virtual T Instance { get; protected set; }
Property Value
Type | Description |
---|---|
T | The object that this wrapper represents. |
InstanceType
Gets the type of the object that this wrapper represents.
Declaration
public virtual Type InstanceType { get; protected set; }
Property Value
Type | Description |
---|---|
System.Type | The type of the that this wrapper represents. |
MemberReference
Gets the member from where Instance was referenced.
Declaration
public virtual MemberInfo MemberReference { get; set; }
Property Value
Type | Description |
---|---|
System.Reflection.MemberInfo | The member from where Instance was referenced. |
Methods
| Improve this DocInstanceAs<TResult>()
Returns a value that is equivalent to the instance of the object that this wrapper represents.
Declaration
public TResult InstanceAs<TResult>()
Returns
Type | Description |
---|---|
TResult | A value that is equivalent to the instance of the object that this wrapper represents. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the return value. |
Exceptions
Type | Condition |
---|---|
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 |
System.OverflowException | Instance represents a number that is out of the range of |
InstanceAs<TResult>(IFormatProvider)
Returns a value that is equivalent to the instance of the object that this wrapper represents.
Declaration
public TResult InstanceAs<TResult>(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
TResult | A value that is equivalent to the instance of the object that this wrapper represents. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the return value. |
Exceptions
Type | Condition |
---|---|
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 |
System.OverflowException | Instance represents a number that is out of the range of |