XMLBoolRef is a type converter for bool data with write access. More...
Public Member Functions | |
XMLBoolRef (XMLNode node, string attrName) | |
XMLBoolRef (XMLNode node, string attrName, bool def) | |
bool | boolValue () |
void | assign (bool value) |
Set bool value in referenced node. | |
Protected Attributes | |
XMLNode | _node |
string | _attrName |
Private Member Functions | |
void | init (XMLNode node, string attrName, bool def) |
XMLBoolRef is a type converter for bool data with write access.
Definition at line 125 of file XMLBool.cs.
XMLStorage::XMLBoolRef::XMLBoolRef | ( | XMLNode | node, |
string | attrName | ||
) | [inline] |
Definition at line 127 of file XMLBool.cs.
References init().
{ init(node, attrName, false); }
XMLStorage::XMLBoolRef::XMLBoolRef | ( | XMLNode | node, |
string | attrName, | ||
bool | def | ||
) | [inline] |
Definition at line 132 of file XMLBool.cs.
References init().
{ init(node, attrName, def); }
void XMLStorage::XMLBoolRef::assign | ( | bool | value ) | [inline] |
Set bool value in referenced node.
value |
Definition at line 164 of file XMLBool.cs.
References _attrName, _node, and XMLStorage::XMLNode::put().
Referenced by init().
bool XMLStorage::XMLBoolRef::boolValue | ( | ) | [inline] |
Definition at line 150 of file XMLBool.cs.
References _attrName, _node, and XMLStorage::XMLNode::get().
{ bool value; if (_node != null && bool.TryParse(_node.get(_attrName), out value)) return value; else return false; }
void XMLStorage::XMLBoolRef::init | ( | XMLNode | node, |
string | attrName, | ||
bool | def | ||
) | [inline, private] |
Definition at line 137 of file XMLBool.cs.
References _attrName, _node, assign(), and XMLStorage::XMLNode::get().
Referenced by XMLBoolRef().
{ _node = node; _attrName = attrName; if (node != null) if (node.get(attrName).Length == 0) assign(def); }
string XMLStorage::XMLBoolRef::_attrName [protected] |
Definition at line 171 of file XMLBool.cs.
Referenced by assign(), boolValue(), and init().
XMLNode XMLStorage::XMLBoolRef::_node [protected] |
Definition at line 170 of file XMLBool.cs.
Referenced by assign(), boolValue(), and init().