Method | Description | |
---|---|---|
DynamicCast ( this targetType, object value ) : object |
Cast an object from one type to the other using .Net conversion There's a similar ConvertTo method in this library that is much more complicated and doesn't allow for user defined conversions |
|
GetCastMethod ( |
Gets the most appropriate cast method from one type to another
|
|
GetLoadableTypes ( this assembly ) : IEnumerable |
Thank you Jon Skeet. http://stackoverflow.com/questions/7889228/how-to-prevent-reflectiontypeloadexception-when-calling-assembly-gettypes Calling GetTypes() on an assembly that inherits from a non-referenced assembly will throw exceptions. This extension method will only get the types from the assembly that we actually can load.
|
public static DynamicCast ( this targetType, object value ) : object | ||
targetType | this | |
value | object | |
return | object |
public static GetCastMethod ( |
||
from | Type of initial object | |
to | Type of casted object | |
return |
public static GetLoadableTypes ( this assembly ) : IEnumerable |
||
assembly | this | |
return | IEnumerable |