C# Class Zetetic.Chain.Xml.XmlConfig

Exibir arquivo Open project: skradel/Zetetic.Chain Class Usage Examples

Private Properties

Property Type Description
GetPropValue string

Public Methods

Method Description
ChangeType ( object value, Type conversionType ) : object

Returns an Object with the specified Type and whose value is equivalent to the specified object. Swiped from http://aspalliance.com/852_CodeSnip_ConvertChangeType_Wrapper_that_Handles_Nullable_Types

This method exists as a workaround to System.Convert.ChangeType(Object, Type) which does not handle nullables as of version 2.0 (2.0.50727.42) of the .NET Framework. The idea is that this method will be deleted once Convert.ChangeType is updated in a future version of the .NET Framework to handle nullable types, so we want this to behave as closely to Convert.ChangeType as possible. This method was written by Peter Johnson at: http://aspalliance.com/author.aspx?uId=1026.

CreateFromICommand ( ICommand cmd ) : XmlConfig
ResolveInternals ( ) : ICommand

Protected Methods

Method Description
DeserializeProperties ( ICommand target ) : ICommand

Deserialize the properties of the current XmlChain / XmlCommand and try to set the writeable properties of the output ICommand

ExcludeProperty ( PropertyInfo pi ) : bool

Don't discover properties with XmlIgnoreAttribute, nor the reserved 'Name' property.

IsChainRequired ( PropertyInfo pi ) : bool
SerializeProperties ( ICommand cmd, XmlConfig target ) : void

Investigate writeable, IConvertible properties of ICommand 'cmd' and write them into the XML-serializable properties of 'target'

Private Methods

Method Description
GetPropValue ( string key ) : string

Method Details

ChangeType() public static method

Returns an Object with the specified Type and whose value is equivalent to the specified object. Swiped from http://aspalliance.com/852_CodeSnip_ConvertChangeType_Wrapper_that_Handles_Nullable_Types
This method exists as a workaround to System.Convert.ChangeType(Object, Type) which does not handle nullables as of version 2.0 (2.0.50727.42) of the .NET Framework. The idea is that this method will be deleted once Convert.ChangeType is updated in a future version of the .NET Framework to handle nullable types, so we want this to behave as closely to Convert.ChangeType as possible. This method was written by Peter Johnson at: http://aspalliance.com/author.aspx?uId=1026.
public static ChangeType ( object value, Type conversionType ) : object
value object An Object that implements the IConvertible interface.
conversionType System.Type The Type to which value is to be converted.
return object

CreateFromICommand() public static method

public static CreateFromICommand ( ICommand cmd ) : XmlConfig
cmd ICommand
return XmlConfig

DeserializeProperties() protected method

Deserialize the properties of the current XmlChain / XmlCommand and try to set the writeable properties of the output ICommand
If ChainRequired property is absent
protected DeserializeProperties ( ICommand target ) : ICommand
target ICommand
return ICommand

ExcludeProperty() protected static method

Don't discover properties with XmlIgnoreAttribute, nor the reserved 'Name' property.
protected static ExcludeProperty ( PropertyInfo pi ) : bool
pi System.Reflection.PropertyInfo
return bool

IsChainRequired() protected static method

protected static IsChainRequired ( PropertyInfo pi ) : bool
pi System.Reflection.PropertyInfo
return bool

ResolveInternals() public abstract method

public abstract ResolveInternals ( ) : ICommand
return ICommand

SerializeProperties() protected static method

Investigate writeable, IConvertible properties of ICommand 'cmd' and write them into the XML-serializable properties of 'target'
If ChainRequired property is absent
protected static SerializeProperties ( ICommand cmd, XmlConfig target ) : void
cmd ICommand
target XmlConfig
return void