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
T
The 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
T
instance.
Type Parameters
TObject
The type to which to cast the
T
instance.
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
T
instance.
Type Parameters
TObject
The type to which to cast the
T
instance.
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
param
TObjectThe cast object.
Returns
Type Parameters
TObject
The type to which to cast the
TObject
instance.
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
param
TObjectThe cast object.
Returns
Type Parameters
TObject
The type to which to cast the
TObject
instance.