Show / Hide Table of Contents

Class Wrapper<T>

Provides a way to wrap an object of type T.

Inheritance
Object
Wrapper<T>
Hierarchy<T>
XmlWrapper
Implements
IWrapper<T>
IData
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 Doc View Source

Wrapper()

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

Declaration
protected Wrapper()
| Improve this Doc View Source

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.

MemberInfo memberReference

The member from where instance was referenced.

Properties

| Improve this Doc View Source

Data

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
IDictionary<String, Object>

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

| Improve this Doc View Source

HasMemberReference

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

Declaration
public virtual bool HasMemberReference { get; }
Property Value
Type Description
Boolean

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

| Improve this Doc View Source

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.

| Improve this Doc View Source

InstanceType

Gets the type of the object that this wrapper represents.

Declaration
public virtual Type InstanceType { get; protected set; }
Property Value
Type Description
Type

The type of the that this wrapper represents.

| Improve this Doc View Source

MemberReference

Gets the member from where Instance was referenced.

Declaration
public virtual MemberInfo MemberReference { get; protected set; }
Property Value
Type Description
MemberInfo

The member from where Instance was referenced.

Methods

| Improve this Doc View Source

InstanceAs<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
InvalidCastException

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

FormatException

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

OverflowException

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

| Improve this Doc View Source

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
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
InvalidCastException

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

FormatException

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

OverflowException

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

| Improve this Doc View Source

ToString()

Returns a String that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
String

A String that represents this instance.

Overrides
Object.ToString()

Implements

IWrapper<T>
IData
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright 2008-2022 Geekle. All rights reserved. Code with passion and love; deploy with confidence. 👨‍💻️🔥❤️🚀😎
Generated by DocFX