Parser.ParserBase.TagXmlNodeToTag C# (CSharp) Method

TagXmlNodeToTag() protected method

Converts the specified tag xml node into a tag.
protected TagXmlNodeToTag ( XmlNode node ) : TagBase
node System.Xml.XmlNode
return TagBase
        protected TagBase TagXmlNodeToTag(XmlNode node)
        {
            #region Check arguments

            if (node == null)
                throw new ArgumentNullException("node");

            #endregion

            #region Get tag parameters

            XmlAttribute myTagTypeXmlAttribute = node.Attributes[cTagTypeXmlAttributeName];
            if (myTagTypeXmlAttribute == null)
                throw new Exception("Cannot find the tag type attribute");
            string myTagType = myTagTypeXmlAttribute.Value;

            XmlAttribute myValueXmlAttribute = node.Attributes[cValueXmlAttributeName];
            string myTagValue;
            if (myValueXmlAttribute == null)
                myTagValue = null;
            else
                myTagValue = myValueXmlAttribute.Value;

            #endregion

            return GetTagFromType(myTagType, myTagValue, node.ChildNodes.Count > 0);
        }