C# Class DeftTech.DuckTyping.InterfaceStaticDuckCaster

Static duck casting strategy that casts a static type to an interface.
Inheritance: IStaticDuckCaster
Exibir arquivo Open project: deftflux/DuckTyping

Public Methods

Method Description
CanStaticCast ( Type toType, Type staticType ) : bool
PrepareStaticCast ( Type toType, Type staticType ) : void
ShouldStaticCast ( Type toType, Type staticType ) : bool
StaticCast ( Type toType, Type staticType ) : object

Private Methods

Method Description
GetProxyType ( Type interfaceType, Type duckType ) : InterfaceDuckProxyType

Gets the InterfaceDuckProxyType object for a given cast.

InterfaceStaticDuckCaster ( ) : System

Initializes static members.

Method Details

CanStaticCast() public method

public CanStaticCast ( Type toType, Type staticType ) : bool
toType System.Type
staticType System.Type
return bool

PrepareStaticCast() public method

public PrepareStaticCast ( Type toType, Type staticType ) : void
toType System.Type
staticType System.Type
return void

ShouldStaticCast() public method

public ShouldStaticCast ( Type toType, Type staticType ) : bool
toType System.Type
staticType System.Type
return bool

StaticCast() public method

public StaticCast ( Type toType, Type staticType ) : object
toType System.Type
staticType System.Type
return object