C# Class NStub.CSharp.ObjectGeneration.Builders.BuilderSerializer

Helper class to serialize BuildParametersBase{T} data classes of the IMemberBuilder family.
Inheritance: IBuilderSerializer
ファイルを表示 Open project: Jedzia/NStub

Public Methods

Method Description
DeserializeAllSetupData ( string xml, IBuildDataDictionary properties, IEnumerable handlers ) : IEnumerable

Set the parameters in the properties storage from a specified xml representation of the data.

DetermineIMemberBuilderFromXmlFragment ( string xml, IEnumerable handlers ) : IBuildHandler

Determines the matching member builder by the first childs name from a XML fragment.

GetMultiParameter ( System.Guid key, Type builderType, Type paraType, IBuildDataDictionary properties ) : IMultiBuildParameters

Get the parameters for the specified builder type, possibly creating it, if there is not yet one in the build data collection.

GetMultiParameters ( Type builderType, Type paraType, IBuildDataDictionary properties ) : IBuilderData>.IReadOnlyDictionary

Get the parameters for the specified builder type, possibly creating it, if there is not yet one in the build data collection.

GetParameters ( Type builderType, Type paraType, IBuildDataDictionary properties ) : IMemberBuildParameters

Get the parameters for the specified builder type, possibly creating it, if there is not yet one in the build data collection.

GetSampleSetupData ( Type builderType, Type paraType ) : string

Gets the sample setup xml data for a specified IMemberBuilder.

SerializeAllHandlers ( IBuildDataDictionary properties, IEnumerable handlers ) : string

Gets the xml data representation of all registered IBuildHandlers.

SerializeParametersForBuilderType ( Type builderType, IMemberBuildParameters parameters ) : string

Gets the xml data representation of a single registered IMemberBuilders parameters.

SetParameters ( string xml, IBuildDataDictionary properties, IBuildHandler handler ) : IMemberBuildParameters

Set the parameters in the properties storage from a specified xml representation of the data.

Private Methods

Method Description
PrettyPrintXml ( string xml ) : string

Pretty print XML data.

SerializeParameterToXmlDocument ( XmlDocument xmlDoc, XmlElement root, IMemberBuildParameters setupPara, string builderFullName ) : void
SerializeParametersForBuilderType ( Type builderType, string parameterTypeShortName, string parameterTypeXmlData ) : string

Gets the xml data representation of a single registered IMemberBuilders parameters.

SetSingleNode ( IBuildDataDictionary properties, IBuildHandler handler, XmlNode firstChild ) : IMemberBuildParameters

Method Details

DeserializeAllSetupData() public method

Set the parameters in the properties storage from a specified xml representation of the data.
InvalidCastException Problem building from serialization data.
public DeserializeAllSetupData ( string xml, IBuildDataDictionary properties, IEnumerable handlers ) : IEnumerable
xml string The xml representation of the data.
properties IBuildDataDictionary The global properties storage.
handlers IEnumerable The list of existing handlers to investigate.
return IEnumerable

DetermineIMemberBuilderFromXmlFragment() public method

Determines the matching member builder by the first childs name from a XML fragment.
public DetermineIMemberBuilderFromXmlFragment ( string xml, IEnumerable handlers ) : IBuildHandler
xml string The xml fragment.
handlers IEnumerable The list of existing handlers to investigate.
return IBuildHandler

GetMultiParameter() public method

Get the parameters for the specified builder type, possibly creating it, if there is not yet one in the build data collection.
The given was not present in the lookup.
public GetMultiParameter ( System.Guid key, Type builderType, Type paraType, IBuildDataDictionary properties ) : IMultiBuildParameters
key System.Guid The unique identifier of the parameter data set.
builderType System.Type Type of the builder to request a set of sample data for.
paraType System.Type Type of the parameter class.
properties IBuildDataDictionary The global properties storage.
return IMultiBuildParameters

GetMultiParameters() public method

Get the parameters for the specified builder type, possibly creating it, if there is not yet one in the build data collection.
The given was not present in the lookup.
public GetMultiParameters ( Type builderType, Type paraType, IBuildDataDictionary properties ) : IBuilderData>.IReadOnlyDictionary
builderType System.Type Type of the builder to request a set of sample data for.
paraType System.Type Type of the parameter class.
properties IBuildDataDictionary The global properties storage.
return IBuilderData>.IReadOnlyDictionary

GetParameters() public method

Get the parameters for the specified builder type, possibly creating it, if there is not yet one in the build data collection.
The given was not present in the lookup.
public GetParameters ( Type builderType, Type paraType, IBuildDataDictionary properties ) : IMemberBuildParameters
builderType System.Type Type of the builder to request a set of sample data for.
paraType System.Type Type of the parameter class.
properties IBuildDataDictionary The global properties storage.
return IMemberBuildParameters

GetSampleSetupData() public method

Gets the sample setup xml data for a specified IMemberBuilder.
public GetSampleSetupData ( Type builderType, Type paraType ) : string
builderType System.Type Type of the builder to request a set of sample data for.
paraType System.Type Type of the parameter class.
return string

SerializeAllHandlers() public method

Gets the xml data representation of all registered IBuildHandlers.
public SerializeAllHandlers ( IBuildDataDictionary properties, IEnumerable handlers ) : string
properties IBuildDataDictionary The properties storage which stores the data to serialize.
handlers IEnumerable The handlers with the links to the types.
return string

SerializeParametersForBuilderType() public method

Gets the xml data representation of a single registered IMemberBuilders parameters.
public SerializeParametersForBuilderType ( Type builderType, IMemberBuildParameters parameters ) : string
builderType System.Type Type of the builder to request data for.
parameters IMemberBuildParameters The parameters with the data to serialize.
return string

SetParameters() public method

Set the parameters in the properties storage from a specified xml representation of the data.
InvalidCastException Problem building from serialization data.
public SetParameters ( string xml, IBuildDataDictionary properties, IBuildHandler handler ) : IMemberBuildParameters
xml string The xml representation of the data.
properties IBuildDataDictionary The global properties storage.
handler IBuildHandler The handler that holds the builder- to parameter-type relation.
return IMemberBuildParameters