C# Class 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
Inheritance: ITypeDecoder
Afficher le fichier Open project: jozilla/Uiml.net

Méthodes publiques

Свойство Type Description
Instance TypeDecoder
PARSE string
SYSTEM_CONVERT_TYPES List

Protected Properties

Свойство Type Description
m_registry TypeDecoderRegistry

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
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

Private Methods

Méthode Description
TypeDecoder ( ) : Uiml.Utils.Reflection

Method Details

ConvertComplex() protected méthode

Helper function to convert a property to a complex type.
protected ConvertComplex ( Type t, System.Property p ) : object
t System.Type
p System.Property
Résultat object

ConvertComplex() protected méthode

Utility function to convert an arbitrary object to a complex type.
protected ConvertComplex ( Type t, object oValue ) : object
t System.Type
oValue object
Résultat object

ConvertPrimitive() protected méthode

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
Résultat object

ConvertPrimitive() protected méthode

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
Résultat object

GetArg() public méthode

public GetArg ( object o, Type t ) : object
o object
t System.Type
Résultat object

GetArgs() public méthode

public GetArgs ( System.Property p, Type types ) : object[]
p System.Property
types System.Type
Résultat object[]

GetMultipleArgs() public méthode

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
Résultat object[]

HasDecoder() public méthode

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
Résultat bool

HasDecoder() public méthode

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)
Résultat bool

HasDecoder() public méthode

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
Résultat bool

HasDecoder() public méthode

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)
Résultat bool

Register() public méthode

public Register ( Assembly a ) : void
a System.Reflection.Assembly
Résultat void

Register() public méthode

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. ///
Résultat void

Register() public méthode

public Register ( Type t ) : void
t System.Type
Résultat void

SystemConvert() protected méthode

protected SystemConvert ( Type t, object o ) : object
t System.Type
o object
Résultat object

Property Details

Instance public_oe static_oe property

public static TypeDecoder,Uiml.Rendering.TypeDecoding Instance
Résultat TypeDecoder

PARSE public_oe static_oe property

public static string PARSE
Résultat string

SYSTEM_CONVERT_TYPES public_oe static_oe property

public static List SYSTEM_CONVERT_TYPES
Résultat List

m_registry protected_oe property

protected TypeDecoderRegistry m_registry
Résultat TypeDecoderRegistry