Class XmlItem
Namespace: FastReport.Olap.Utils
Assembly: FastCube.Core.dll
Represents a xml node.
public class XmlItem
Inheritance
Constructors
XmlItem()
Initializes a new instance of the XmlItem class with default settings.
public XmlItem()
Properties
Count
Gets a number of children in this node.
public int Count { get; }
Property Value
Items
Gets a list of children in this node.
public List<XmlItem> Items { get; }
Property Value
Name
Gets or sets the node name.
public string Name { get; set; }
Property Value
Remarks
This property will return "Node" for a node like <Node Text="" Left="0"/>
Parent
Gets or sets the parent for this node.
public XmlItem Parent { get; set; }
Property Value
Properties
Gets or sets a list of properties in this node.
public XmlProperty[] Properties { get; set; }
Property Value
Root
Gets the root node which owns this node.
public XmlItem Root { get; }
Property Value
Value
Gets or sets the node value.
public string Value { get; set; }
Property Value
Remarks
This property will return "ABC" for a node like <Node>ABC</Node>
this[int]
Gets a child node with specified index.
public XmlItem this[int index] { get; }
Property Value
Methods
Add()
Adds a new child node to this node.
public XmlItem Add()
Returns
The new child node.
AddItem(XmlItem)
Adds a specified node to this node.
public void AddItem(XmlItem item)
Parameters
item
XmlItem
The node to add.
Clear()
Clears the child nodes of this node.
public void Clear()
ClearProps()
Removes all properties.
public void ClearProps()
Dispose()
Disposes the node and all its children.
public void Dispose()
Find(string)
Finds the node with specified name.
public int Find(string name)
Parameters
name
string
The name of node to find.
Returns
The node with specified name, if found; null otherwise.
FindItem(string)
Finds the node with specified name.
public XmlItem FindItem(string name)
Parameters
name
string
The name of node to find.
Returns
The node with specified name, if found; the new node otherwise.
Remarks
This method adds the node with specified name to the child nodes if it cannot find the node.
GetBoolProp(string)
Gets property value as bool.
public bool GetBoolProp(string index)
Parameters
index
string
Returns
GetDateProp(string)
Gets property value as datetime.
public DateTime GetDateProp(string index)
Parameters
index
string
Returns
GetDecimalProp(string)
Gets property value as decimal.
public decimal GetDecimalProp(string index)
Parameters
index
string
Returns
GetFloatProp(string)
Gets property value as float.
public double GetFloatProp(string index)
Parameters
index
string
Returns
GetIntProp(string)
Gets propertu value as int.
public int GetIntProp(string index)
Parameters
index
string
Returns
GetProp(string)
Gets a property with specified name.
public string GetProp(string key)
Parameters
key
string
The property name.
Returns
The value of property, if found; empty string otherwise.
Remarks
This property will return "0" when you request the "Left" property for a node
like <Node Text="" Left="0"/>
IndexOf(XmlItem)
Gets the index of specified node in the child nodes list.
public int IndexOf(XmlItem item)
Parameters
item
XmlItem
The node to find.
Returns
Zero-based index of node, if found; -1 otherwise.
InsertItem(int, XmlItem)
Inserts a specified node to this node.
public void InsertItem(int index, XmlItem item)
Parameters
index
int
Position to insert.
item
XmlItem
Node to insert.
PropExists(string)
Checks if prop is exists.
public bool PropExists(string key)
Parameters
key
string
Returns
RemoveProp(string)
Removes a property with specified name.
public bool RemoveProp(string key)
Parameters
key
string
The property name.
Returns
Returns true if property is removed, false otherwise.
SetBoolProp(string, bool)
Set property value.
public void SetBoolProp(string index, bool value)
Parameters
index
string
value
bool
SetDateProp(string, DateTime)
Set property value.
public void SetDateProp(string index, DateTime value)
Parameters
index
string
value
DateTime
SetDecimalProp(string, decimal)
Set property value.
public void SetDecimalProp(string index, decimal value)
Parameters
index
string
value
decimal
SetFloatProp(string, double)
Set property value.
public void SetFloatProp(string index, double value)
Parameters
index
string
value
double
SetIntProp(string, int)
Set property value.
public void SetIntProp(string index, int value)
Parameters
index
string
value
int
SetProp(string, string)
Sets the value for a specified property.
public void SetProp(string key, string value)
Parameters
key
string
The property name.
value
string
Value to set.
Remarks
For example, you have a node like <Node Text="" Left="0"/>
. When you set the
"Text" property to "test", the node will be <Node Text="test" Left="0"/>
.
If property with specified name is not exist, it will be added.
SetRawProp(string)
Set property value as null.
public void SetRawProp(string index)
Parameters
index
string