C# 클래스 ZForge.Configuration.XMLConfig

The class which represents a configuration xml file
상속: IDisposable
파일 보기 프로젝트 열기: zhuangyy/Motion 1 사용 예제들

공개 메소드들

메소드 설명
Clean ( ) : void

Strip empty nodes from the whole tree.

Commit ( ) : bool

If loaded from a file, commit any changes, by overwriting the file

Dispose ( ) : void

Save any modifications to the XML file before destruction if CommitOnUnload is true

LoadXmlFromFile ( string filename ) : void

Load a new XmlDocument from a file

Throws an exception if file does not exist

LoadXmlFromFile ( string filename, bool create ) : void

Load a new XmlDocument from a file

LoadXmlFromString ( string xml ) : void

Load a new XmlDocument from a string

NewXml ( string rootelement ) : void

Load an empty XmlDocument

Reload ( ) : bool

If loaded from a file, trash any changes, and reload the file

Save ( System stream ) : void

Save configuration to a stream

Save ( string filename ) : void

Save configuration to an xml file

ValidateXML ( bool silent ) : bool

Check XML file if it conforms the config xml restrictions 1. No nodes with two children of the same name 2. Only alphanumerical names

XMLConfig ( ) : System

Create an XmlConfig from an empty xml file containing only the rootelement named as 'xml'

XMLConfig ( string xml ) : System
XMLConfig ( string loadfromfile, bool create ) : System

Create an XmlConfig from an existing file, or create a new one

메소드 상세

Clean() 공개 메소드

Strip empty nodes from the whole tree.
public Clean ( ) : void
리턴 void

Commit() 공개 메소드

If loaded from a file, commit any changes, by overwriting the file
public Commit ( ) : bool
리턴 bool

Dispose() 공개 메소드

Save any modifications to the XML file before destruction if CommitOnUnload is true
public Dispose ( ) : void
리턴 void

LoadXmlFromFile() 공개 메소드

Load a new XmlDocument from a file
Throws an exception if file does not exist
public LoadXmlFromFile ( string filename ) : void
filename string /// Path and filename from where to load the xml file ///
리턴 void

LoadXmlFromFile() 공개 메소드

Load a new XmlDocument from a file
public LoadXmlFromFile ( string filename, bool create ) : void
filename string /// Path and filename from where to load the xml file ///
create bool /// If file does not exist, create it, or throw an exception? ///
리턴 void

LoadXmlFromString() 공개 메소드

Load a new XmlDocument from a string
public LoadXmlFromString ( string xml ) : void
xml string /// XML string ///
리턴 void

NewXml() 공개 메소드

Load an empty XmlDocument
public NewXml ( string rootelement ) : void
rootelement string /// Name of root element ///
리턴 void

Reload() 공개 메소드

If loaded from a file, trash any changes, and reload the file
public Reload ( ) : bool
리턴 bool

Save() 공개 메소드

Save configuration to a stream
public Save ( System stream ) : void
stream System /// Stream where to save ///
리턴 void

Save() 공개 메소드

Save configuration to an xml file
public Save ( string filename ) : void
filename string /// Path and filname where to save ///
리턴 void

ValidateXML() 공개 메소드

Check XML file if it conforms the config xml restrictions 1. No nodes with two children of the same name 2. Only alphanumerical names
public ValidateXML ( bool silent ) : bool
silent bool /// Whether to return a true/false value, or throw an exception on failiure ///
리턴 bool

XMLConfig() 공개 메소드

Create an XmlConfig from an empty xml file containing only the rootelement named as 'xml'
public XMLConfig ( ) : System
리턴 System

XMLConfig() 공개 메소드

public XMLConfig ( string xml ) : System
xml string
리턴 System

XMLConfig() 공개 메소드

Create an XmlConfig from an existing file, or create a new one
public XMLConfig ( string loadfromfile, bool create ) : System
loadfromfile string /// Path and filename from where to load the xml file ///
create bool /// If file does not exist, create it, or throw an exception? ///
리턴 System