C# Class Tools.XmlConfigMerge.ConfigFileManager

Mostra file Open project: CompassPHS/scurrynet Class Usage Examples

Public Methods

Method Description
ConfigFileManager ( string masterConfigPath ) : System
ConfigFileManager ( string masterConfigPath, string mergeFromConfigPath ) : System
ConfigFileManager ( string masterConfigPath, string mergeFromConfigPath, bool makeMergeFromConfigPathTheSavePath ) : System

FromLastInstallConfigPathExists ( ) : bool
GetAllKeyValuePairs ( ) : Hashtable
GetKeyValue ( string key ) : string
GetXPathValue ( string xPath ) : string
ReplaceXPathValues ( string xPath, string replaceWith ) : string[]
ReplaceXPathValues ( string xPath, string replaceWith, Regex regexPattern ) : string[]

Search and replace on one or more specified values as specified by a single xpath expressino

Save ( ) : void
Save ( string saveAsName ) : void
SetKeyValue ( string key, string value ) : void
UpdateExistingElementsAndAttribs ( XmlDocument fromXdoc, XmlDocument toXdoc ) : void

Merge element and attribute values from one xml doc to another.

Multiple same-named peer elements, are merged in the ordinal order they appear.

Private Methods

Method Description
ClearSpecifiedFileAttributes ( string path, FileAttributes fileAttributes ) : void
GetKeyValueNode ( string key ) : XmlNode
GetTextElement ( XmlNode node ) : XmlNode
SelectSingleNodeMatchingNamespaceURI ( XmlNode node, XmlNode nodeName ) : XmlNode
SelectSingleNodeMatchingNamespaceURI ( XmlNode node, XmlNode nodeName, XmlAttribute keyAttrib ) : XmlNode
SelectSingleNodeMatchingNamespaceURI ( XmlNode node, XmlNode nodeName, XmlAttribute keyAttrib, int iSameElement ) : XmlNode
SelectSingleNodeMatchingNamespaceURI ( XmlNode node, XmlNode nodeName, int iSameElement ) : XmlNode
UpdateExistingElementsAndAttribsRecurse ( XmlNodeList fromNodes, XmlNode toParentNode ) : void

Method Details

ConfigFileManager() public method

public ConfigFileManager ( string masterConfigPath ) : System
masterConfigPath string
return System

ConfigFileManager() public method

public ConfigFileManager ( string masterConfigPath, string mergeFromConfigPath ) : System
masterConfigPath string
mergeFromConfigPath string
return System

ConfigFileManager() public method

if mergeFromConfigPath is specified but does not exist, and makeMergeFromConfigPathTheSavePath is false
public ConfigFileManager ( string masterConfigPath, string mergeFromConfigPath, bool makeMergeFromConfigPathTheSavePath ) : System
masterConfigPath string
mergeFromConfigPath string
makeMergeFromConfigPathTheSavePath bool
return System

FromLastInstallConfigPathExists() public method

public FromLastInstallConfigPathExists ( ) : bool
return bool

GetAllKeyValuePairs() public method

public GetAllKeyValuePairs ( ) : Hashtable
return System.Collections.Hashtable

GetKeyValue() public method

public GetKeyValue ( string key ) : string
key string
return string

GetXPathValue() public method

public GetXPathValue ( string xPath ) : string
xPath string
return string

ReplaceXPathValues() public method

public ReplaceXPathValues ( string xPath, string replaceWith ) : string[]
xPath string
replaceWith string
return string[]

ReplaceXPathValues() public method

Search and replace on one or more specified values as specified by a single xpath expressino
When no nodes match xpath-expression and no regexPattern is specified (is null), /// and can't auto-create the node (is not an appSettings expression).
public ReplaceXPathValues ( string xPath, string replaceWith, Regex regexPattern ) : string[]
xPath string
replaceWith string
regexPattern System.Text.RegularExpressions.Regex Optionally specify a regex pattern to search within the found values. /// If a single () group is found within this expression, only this portion is replaced.
return string[]

Save() public method

public Save ( ) : void
return void

Save() public method

public Save ( string saveAsName ) : void
saveAsName string
return void

SetKeyValue() public method

public SetKeyValue ( string key, string value ) : void
key string
value string
return void

UpdateExistingElementsAndAttribs() public static method

Merge element and attribute values from one xml doc to another.
Multiple same-named peer elements, are merged in the ordinal order they appear.
public static UpdateExistingElementsAndAttribs ( XmlDocument fromXdoc, XmlDocument toXdoc ) : void
fromXdoc System.Xml.XmlDocument
toXdoc System.Xml.XmlDocument
return void