Class TypeCastObject<T>
The interface which allows defined objects to be cast to each other.
public abstract class TypeCastObject<T> where T : class
Type Parameters
TThe type of the object to cast.
- Inheritance
-
TypeCastObject<T>
- Derived
- Inherited Members
- Extension Methods
Constructors
TypeCastObject()
Initializes a new instance of the TypeCastObject<T> class.
protected TypeCastObject()
Methods
As<TObject>()
Unsafely casts the current T instance to the specified TObject type.
public TObject As<TObject>() where TObject : class, T
Returns
- TObject
The cast
Tinstance.
Type Parameters
TObjectThe type to which to cast the
Tinstance.
Cast<TObject>()
Unsafely casts the current T instance to the specified TObject type.
public TObject Cast<TObject>() where TObject : class, T
Returns
- TObject
The cast
Tinstance.
Type Parameters
TObjectThe type to which to cast the
Tinstance.
Cast<TObject>(out TObject)
Safely casts the current TObject instance to the specified TObject type.
public bool Cast<TObject>(out TObject param) where TObject : class, T
Parameters
paramTObjectThe cast object.
Returns
Type Parameters
TObjectThe type to which to cast the
TObjectinstance.
Is<TObject>(out TObject)
Safely casts the current TObject instance to the specified TObject type.
public bool Is<TObject>(out TObject param) where TObject : class, T
Parameters
paramTObjectThe cast object.
Returns
Type Parameters
TObjectThe type to which to cast the
TObjectinstance.