C# Класс ZForge.Configuration.XMLConfigSetting

Represents a Configuration Node in the XML file
Наследование: IConfigSetting
Показать файл Открыть проект Примеры использования класса

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

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

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

Метод Описание
XMLConfigSetting ( ) : System

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

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

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

An IList compatible object describing each and every child node
Read only property
public Children ( ) : IList
Результат IList

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

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

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

public Copy ( XMLConfigSetting x ) : void
x XMLConfigSetting
Результат void

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

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

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

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"} ///
Результат IList

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

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

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

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

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

Remove the specific node from the tree
public Remove ( ) : void
Результат void

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

Remove all children of the node, but keep the node itself
public RemoveChildren ( ) : void
Результат void

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

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

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

Creates an instance of the class
public XMLConfigSetting ( XmlNode node ) : System
node System.Xml.XmlNode /// the XmlNode to describe ///
Результат System

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

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 '\' ///
Результат IConfigSetting