C# Class ZForge.Configuration.XMLConfigSetting

Represents a Configuration Node in the XML file
Inheritance: IConfigSetting
Afficher le fichier Open project: zhuangyy/Motion Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
XMLConfigSetting ( ) : System

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

Method Details

Children() public méthode

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

Clean() public méthode

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
Résultat void

Copy() public méthode

public Copy ( XMLConfigSetting x ) : void
x XMLConfigSetting
Résultat void

GetChildCount() public méthode

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 ///
Résultat int

GetChildrenNames() public méthode

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"} ///
Résultat IList

GetNamedChildren() public méthode

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 ///
Résultat IList

GetNamedChildrenCount() public méthode

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 ///
Résultat int

Remove() public méthode

Remove the specific node from the tree
public Remove ( ) : void
Résultat void

RemoveChildren() public méthode

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

Validate() public méthode

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
Résultat bool

XMLConfigSetting() public méthode

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

this() public méthode

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 '\' ///
Résultat IConfigSetting