Table of Contents

Class XmlItem

Namespace: FastReport.Olap.Utils
Assembly: FastCube.Core.dll

Represents a xml node.

public class XmlItem

Inheritance

objectXmlItem

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

int

Items

Gets a list of children in this node.

public List<XmlItem> Items { get; }

Property Value

List<XmlItem>

Name

Gets or sets the node name.

public string Name { get; set; }

Property Value

string

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

XmlItem

Properties

Gets or sets a list of properties in this node.

public XmlProperty[] Properties { get; set; }

Property Value

XmlProperty[]

Root

Gets the root node which owns this node.

public XmlItem Root { get; }

Property Value

XmlItem

Value

Gets or sets the node value.

public string Value { get; set; }

Property Value

string

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

XmlItem

Methods

Add()

Adds a new child node to this node.

public XmlItem Add()

Returns

XmlItem

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

int

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

XmlItem

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

bool

GetDateProp(string)

Gets property value as datetime.

public DateTime GetDateProp(string index)

Parameters

index string

Returns

DateTime

GetDecimalProp(string)

Gets property value as decimal.

public decimal GetDecimalProp(string index)

Parameters

index string

Returns

decimal

GetFloatProp(string)

Gets property value as float.

public double GetFloatProp(string index)

Parameters

index string

Returns

double

GetIntProp(string)

Gets propertu value as int.

public int GetIntProp(string index)

Parameters

index string

Returns

int

GetProp(string)

Gets a property with specified name.

public string GetProp(string key)

Parameters

key string

The property name.

Returns

string

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

int

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

bool

RemoveProp(string)

Removes a property with specified name.

public bool RemoveProp(string key)

Parameters

key string

The property name.

Returns

bool

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