C# Класс Tools.XmlConfigMerge.ConfigFileManager

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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.

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

Метод Описание
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

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

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

public ConfigFileManager ( string masterConfigPath ) : System
masterConfigPath string
Результат System

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

public ConfigFileManager ( string masterConfigPath, string mergeFromConfigPath ) : System
masterConfigPath string
mergeFromConfigPath string
Результат System

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

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
Результат System

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

public FromLastInstallConfigPathExists ( ) : bool
Результат bool

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

public GetAllKeyValuePairs ( ) : Hashtable
Результат System.Collections.Hashtable

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

public GetKeyValue ( string key ) : string
key string
Результат string

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

public GetXPathValue ( string xPath ) : string
xPath string
Результат string

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

public ReplaceXPathValues ( string xPath, string replaceWith ) : string[]
xPath string
replaceWith string
Результат string[]

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

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.
Результат string[]

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

public Save ( ) : void
Результат void

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

public Save ( string saveAsName ) : void
saveAsName string
Результат void

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

public SetKeyValue ( string key, string value ) : void
key string
value string
Результат void

UpdateExistingElementsAndAttribs() публичный статический Метод

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
Результат void