C# Class ZForge.Configuration.XMLConfigSetting

Represents a Configuration Node in the XML file
Inheritance: IConfigSetting
ファイルを表示 Open project: zhuangyy/Motion Class Usage Examples

Public Methods

Method Description
Children ( ) : IList

An IList compatible object describing each and every child node

Read only property

Clean ( ) : void

Removes any empty nodes from the tree, that is it removes a node, if it hasn't got any children, or neither of its children have got a value.

Copy ( XMLConfigSetting x ) : void

GetChildCount ( bool unique ) : int

Gets the number of children of the specific node

GetChildrenNames ( bool unique ) : IList

Gets the names of children of the specific node

GetNamedChildren ( String name ) : IList

Get all children with the same name, specified in the name parameter

GetNamedChildrenCount ( String name ) : int

Gets the number of childs with the specified name

Remove ( ) : void

Remove the specific node from the tree

RemoveChildren ( ) : void

Remove all children of the node, but keep the node itself

Validate ( ) : bool

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

XMLConfigSetting ( XmlNode node ) : System

Creates an instance of the class

this ( string path ) : IConfigSetting

Get a specific child node

Private Methods

Method Description
XMLConfigSetting ( ) : System

This class cannot be constructed directly. You will need to give a node to describe

Method Details

Children() public method

An IList compatible object describing each and every child node
Read only property
public Children ( ) : IList
return IList

Clean() public method

Removes any empty nodes from the tree, that is it removes a node, if it hasn't got any children, or neither of its children have got a value.
public Clean ( ) : void
return void

Copy() public method

public Copy ( XMLConfigSetting x ) : void
x XMLConfigSetting
return void

GetChildCount() public method

Gets the number of children of the specific node
public GetChildCount ( bool unique ) : int
unique bool /// If true, get only the number of children with distinct names. /// So if it has two nodes with "foo" name, and three nodes /// named "bar", the return value will be 2. In the same case, if unique /// was false, the return value would have been 2 + 3 = 5 ///
return int

GetChildrenNames() public method

Gets the names of children of the specific node
public GetChildrenNames ( bool unique ) : IList
unique bool /// If true, get only distinct names. /// So if it has two nodes with "foo" name, and three nodes /// named "bar", the return value will be {"bar","foo"} . /// In the same case, if unique was false, the return value /// would have been {"bar","bar","bar","foo","foo"} ///
return IList

GetNamedChildren() public method

Get all children with the same name, specified in the name parameter
public GetNamedChildren ( String name ) : IList
name String /// An alphanumerical string, containing the name of the child nodes to return ///
return IList

GetNamedChildrenCount() public method

Gets the number of childs with the specified name
public GetNamedChildrenCount ( String name ) : int
name String /// An alphanumerical string with the name of the nodes to look for ///
return int

Remove() public method

Remove the specific node from the tree
public Remove ( ) : void
return void

RemoveChildren() public method

Remove all children of the node, but keep the node itself
public RemoveChildren ( ) : void
return void

Validate() public method

Check if the node conforms with the config xml restrictions 1. No nodes with two children of the same name 2. Only alphanumerical names
public Validate ( ) : bool
return bool

XMLConfigSetting() public method

Creates an instance of the class
public XMLConfigSetting ( XmlNode node ) : System
node System.Xml.XmlNode /// the XmlNode to describe ///
return System

this() public method

Get a specific child node
public this ( string path ) : IConfigSetting
path string /// The path to the specific node. Can be either only a name, or a full path separated by '/' or '\' ///
return IConfigSetting