C# Класс Uiml.Rendering.TypeDecoding.TypeDecoder

Class to convert between different types, amongst others to convert (typeless) data values from the UIML document to the types required by the specific toolkit (e.g. '255,0,0' to an instance of System.Drawing.Color).
Implements the Singleton pattern. http://msdn2.microsoft.com/en-us/library/ms954629.aspx
Наследование: ITypeDecoder
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
Instance TypeDecoder
PARSE string
SYSTEM_CONVERT_TYPES List

Защищенные свойства (Protected)

Свойство Тип Описание
m_registry TypeDecoderRegistry

Открытые методы

Метод Описание
GetArg ( object o, Type t ) : object
GetArgs ( System.Property p, Type types ) : object[]
GetMultipleArgs ( System.Property p, Type types ) : object[]

Given an array of properties and an array of types, this method will create an array of objects by converting each property value (p[i].Value) into its appropriate type according to the Type array (types[i]).

HasDecoder ( Type from, Type to ) : bool

Checks whether a decoder exists for a certain signature.

HasDecoder ( Type from, Type to, bool deep ) : bool

Checks whether a decoder exists for a certain signature.

HasDecoder ( string from, string to ) : bool

Checks whether a decoder exists for a certain signature.

HasDecoder ( string from, string to, bool deep ) : bool

Checks whether a decoder exists for a certain signature.

Register ( Assembly a ) : void
Register ( MethodInfo method ) : void

Register a new function for type decoding. The from and to types are automatically extracted.

Register ( Type t ) : void

Защищенные методы

Метод Описание
ConvertComplex ( Type t, System.Property p ) : object

Helper function to convert a property to a complex type.

ConvertComplex ( Type t, object oValue ) : object

Utility function to convert an arbitrary object to a complex type.

ConvertPrimitive ( Type t, System.Property p ) : object

Helper function to convert a property's value to a primitive type (e.g. char, int, float, ...).

ConvertPrimitive ( Type t, System oValue ) : object

Utility function to convert an arbitrary object to a primitive type using the object's Parse method (like the one in System.String).

SystemConvert ( Type t, object o ) : object

Приватные методы

Метод Описание
TypeDecoder ( ) : Uiml.Utils.Reflection

Описание методов

ConvertComplex() защищенный Метод

Helper function to convert a property to a complex type.
protected ConvertComplex ( Type t, System.Property p ) : object
t System.Type
p System.Property
Результат object

ConvertComplex() защищенный Метод

Utility function to convert an arbitrary object to a complex type.
protected ConvertComplex ( Type t, object oValue ) : object
t System.Type
oValue object
Результат object

ConvertPrimitive() защищенный Метод

Helper function to convert a property's value to a primitive type (e.g. char, int, float, ...).
protected ConvertPrimitive ( Type t, System.Property p ) : object
t System.Type
p System.Property
Результат object

ConvertPrimitive() защищенный Метод

Utility function to convert an arbitrary object to a primitive type using the object's Parse method (like the one in System.String).
protected ConvertPrimitive ( Type t, System oValue ) : object
t System.Type
oValue System
Результат object

GetArg() публичный Метод

public GetArg ( object o, Type t ) : object
o object
t System.Type
Результат object

GetArgs() публичный Метод

public GetArgs ( System.Property p, Type types ) : object[]
p System.Property
types System.Type
Результат object[]

GetMultipleArgs() публичный Метод

Given an array of properties and an array of types, this method will create an array of objects by converting each property value (p[i].Value) into its appropriate type according to the Type array (types[i]).
public GetMultipleArgs ( System.Property p, Type types ) : object[]
p System.Property
types System.Type
Результат object[]

HasDecoder() публичный Метод

Checks whether a decoder exists for a certain signature.
public HasDecoder ( Type from, Type to ) : bool
from System.Type The type that we want to decode from
to System.Type The type that we want to decode to
Результат bool

HasDecoder() публичный Метод

Checks whether a decoder exists for a certain signature.
public HasDecoder ( Type from, Type to, bool deep ) : bool
from System.Type The type that we want to decode from
to System.Type The type that we want to decode to
deep bool If true, specifies that we want to include indirect type decoders (e.g. types A->C through A->B and B->C)
Результат bool

HasDecoder() публичный Метод

Checks whether a decoder exists for a certain signature.
public HasDecoder ( string from, string to ) : bool
from string The name of the type that we want to decode from
to string The name of the type that we want to decode to
Результат bool

HasDecoder() публичный Метод

Checks whether a decoder exists for a certain signature.
public HasDecoder ( string from, string to, bool deep ) : bool
from string The name of the type that we want to decode from
to string The name of the type that we want to decode to
deep bool If true, specifies that we want to include indirect type decoders (e.g. types A->C through A->B and B->C)
Результат bool

Register() публичный Метод

public Register ( Assembly a ) : void
a System.Reflection.Assembly
Результат void

Register() публичный Метод

Register a new function for type decoding. The from and to types are automatically extracted.
/// Thrown when method does not have exactly one /// argument and a non-void return type. ///
public Register ( MethodInfo method ) : void
method System.Reflection.MethodInfo /// The function we want to register as a type decoder. ///
Результат void

Register() публичный Метод

public Register ( Type t ) : void
t System.Type
Результат void

SystemConvert() защищенный Метод

protected SystemConvert ( Type t, object o ) : object
t System.Type
o object
Результат object

Описание свойств

Instance публичное статическое свойство

public static TypeDecoder,Uiml.Rendering.TypeDecoding Instance
Результат TypeDecoder

PARSE публичное статическое свойство

public static string PARSE
Результат string

SYSTEM_CONVERT_TYPES публичное статическое свойство

public static List SYSTEM_CONVERT_TYPES
Результат List

m_registry защищенное свойство

protected TypeDecoderRegistry m_registry
Результат TypeDecoderRegistry