XMLNumberRef is a type converter for numeric data with write access. More...

Public Member Functions | |
| XMLNumberRef (XMLNode node, string attrName) | |
| XMLNumberRef (XMLNode node, string attrName, decimal def) | |
| decimal | decimalValue () |
| void | assign (decimal value) |
Protected Attributes | |
| XMLNode | _node |
| string | _attrName |
Private Member Functions | |
| void | init (XMLNode node, string attrName, decimal def) |
XMLNumberRef is a type converter for numeric data with write access.
Definition at line 126 of file XMLDecimal.cs.
| XMLStorage::XMLNumberRef::XMLNumberRef | ( | XMLNode | node, |
| string | attrName | ||
| ) | [inline] |
Definition at line 128 of file XMLDecimal.cs.
References init().
{
init(node, attrName, (decimal)0);
}

| XMLStorage::XMLNumberRef::XMLNumberRef | ( | XMLNode | node, |
| string | attrName, | ||
| decimal | def | ||
| ) | [inline] |
Definition at line 133 of file XMLDecimal.cs.
References init().
{
init(node, attrName, def);
}

| void XMLStorage::XMLNumberRef::assign | ( | decimal | value ) | [inline] |
Definition at line 158 of file XMLDecimal.cs.
References _attrName, _node, and XMLStorage::XMLNode::put().
Referenced by init().

| decimal XMLStorage::XMLNumberRef::decimalValue | ( | ) | [inline] |
Definition at line 148 of file XMLDecimal.cs.
References _attrName, _node, and XMLStorage::XMLNode::get().
{
decimal value;
if (_node!=null && decimal.TryParse(_node.get(_attrName), out value))
return value;
else
return (decimal)0;
}

| void XMLStorage::XMLNumberRef::init | ( | XMLNode | node, |
| string | attrName, | ||
| decimal | def | ||
| ) | [inline, private] |
Definition at line 138 of file XMLDecimal.cs.
References _attrName, _node, assign(), and XMLStorage::XMLNode::get().
Referenced by XMLNumberRef().
{
_node = node;
_attrName = attrName;
if (node != null)
if (node.get(attrName).Length == 0)
assign(def);
}

string XMLStorage::XMLNumberRef::_attrName [protected] |
Definition at line 165 of file XMLDecimal.cs.
Referenced by assign(), decimalValue(), and init().
XMLNode XMLStorage::XMLNumberRef::_node [protected] |
Definition at line 164 of file XMLDecimal.cs.
Referenced by assign(), decimalValue(), and init().
1.7.2