public static XmlTag TagBuilder(string tagName, XmlTagTypes type, XmlAttributeTypes attType, string attName, string attValue, string innerHTML)
 {
     XmlTag tag = new XmlTag();
     tag.TagType = type;
     tag.TagName = tagName;
     tag.LSTAttributes = AddAttributes(attName, attValue, attType);
     tag.InnerHtml = innerHTML;
     return tag;
 }
Example #2
0
        /// <summary>
        /// Build XML tag.
        /// </summary>
        /// <param name="tagName">Tag name.</param>
        /// <param name="type">XML tag types.<see cref="T:SageFrame.Templating.xmlparser.XmlTagTypes"/></param>
        /// <param name="attType">XML attribute type.<see cref="T:SageFrame.Templating.xmlparser.XmlAttributeTypes"/></param>
        /// <param name="attName">Attribute name.</param>
        /// <param name="attValue">Attribute value.</param>
        /// <param name="innerHTML">Inner HTML.</param>
        /// <returns>Object of XmlTag class.</returns>
        public static XmlTag TagBuilder(string tagName, XmlTagTypes type, XmlAttributeTypes attType, string attName, string attValue, string innerHTML)
        {
            XmlTag tag = new XmlTag();

            tag.TagType       = type;
            tag.TagName       = tagName;
            tag.LSTAttributes = AddAttributes(attName, attValue, attType);
            tag.InnerHtml     = innerHTML;
            return(tag);
        }
Example #3
0
        public XmlAttributeTypes GetXmlAttributeType(LayoutAttribute xmlAttribute)
        {
            XmlAttributeTypes attrTypes = new XmlAttributeTypes();

            switch (xmlAttribute.Name)
            {
            case "name":
                attrTypes = XmlAttributeTypes.NAME;
                break;

            case "style":
                attrTypes = XmlAttributeTypes.STYLE;
                break;

            case "width":
                attrTypes = XmlAttributeTypes.WIDTH;
                break;

            case "type":
                attrTypes = XmlAttributeTypes.TYPE;
                break;

            case "wrapinner":
                attrTypes = XmlAttributeTypes.WRAPINNER;
                break;

            case "wrapouter":
                attrTypes = XmlAttributeTypes.WRAPOUTER;
                break;

            case "custom":
                attrTypes = XmlAttributeTypes.CUSTOM;
                break;

            case "mode":
                attrTypes = XmlAttributeTypes.MODE;
                break;

            case "class":
                attrTypes = XmlAttributeTypes.CLASS;
                break;

            case "depth":
                attrTypes = XmlAttributeTypes.DEPTH;
                break;

            case "layout":
                attrTypes = XmlAttributeTypes.LAYOUT;
                break;
            }
            return(attrTypes);
        }
 public static string GetAttributeValueByName(XmlTag tag, XmlAttributeTypes _type)
 {
     string value = string.Empty;
     string name = _type.ToString();
     LayoutAttribute attr = new LayoutAttribute();
     attr = tag.LSTAttributes.Find(
         delegate(LayoutAttribute attObj)
         {
             return (Utils.CompareStrings(attObj.Name, name));
         }
         );
     return attr == null ? "" : attr.Value;
 }
Example #5
0
        public static string GetAttributeValueByName(XmlTag tag, XmlAttributeTypes _type, string defaultValue)
        {
            string          value = string.Empty;
            string          name  = _type.ToString();
            LayoutAttribute attr  = new LayoutAttribute();

            attr = tag.LSTAttributes.Find(
                delegate(LayoutAttribute attObj)
            {
                return(Utils.CompareStrings(attObj.Name, name));
            }
                );
            return(attr == null ? defaultValue : attr.Value);
        }
 public static List<LayoutAttribute> AddAttributes(string attName, string attValue, XmlAttributeTypes attType)
 {
     List<LayoutAttribute> lstAttributes = new List<LayoutAttribute>();
     lstAttributes.Add(new LayoutAttribute(attName, attValue, attType));
     return lstAttributes;
 }
        /// <summary>
        /// Initializes an instance of LayoutAttribute class.
        /// </summary>
        /// <param name="name">Layout name.</param>
        /// <param name="value">Layout value.</param>
        /// <param name="_type">Attribute type.</param>
        public LayoutAttribute(string name, string value, XmlAttributeTypes _type)
		{
			this.Name = name;
			this.Value = value;
            this.Type = _type;
		}
Example #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="attName">Attribute name.</param>
        /// <param name="attValue">Attribute value.</param>
        /// <param name="attType">XML attribute type.<see cref="T:SageFrame.Templating.xmlparser.XmlAttributeTypes"/></param>
        /// <returns>List of LayoutAttribute class.</returns>
        public static List <LayoutAttribute> AddAttributes(string attName, string attValue, XmlAttributeTypes attType)
        {
            List <LayoutAttribute> lstAttributes = new List <LayoutAttribute>();

            lstAttributes.Add(new LayoutAttribute(attName, attValue, attType));
            return(lstAttributes);
        }
 public XmlAttributeTypes GetXmlAttributeType(LayoutAttribute xmlAttribute)
 {
     XmlAttributeTypes attrTypes = new XmlAttributeTypes();
     switch (xmlAttribute.Name)
     {
         case "name":
             attrTypes = XmlAttributeTypes.NAME;
             break;
         case "style":
             attrTypes = XmlAttributeTypes.STYLE;
             break;
         case "width":
             attrTypes = XmlAttributeTypes.WIDTH;
             break;
         case "type":
             attrTypes = XmlAttributeTypes.TYPE;
             break;
         case "wrapinner":
             attrTypes = XmlAttributeTypes.WRAPINNER;
             break;
         case "wrapouter":
             attrTypes = XmlAttributeTypes.WRAPOUTER;
             break;
         case "custom":
             attrTypes = XmlAttributeTypes.CUSTOM;
             break;
         case "mode":
             attrTypes = XmlAttributeTypes.MODE;
             break;
         case "class":
             attrTypes = XmlAttributeTypes.CLASS;
             break;
         case "depth":
             attrTypes = XmlAttributeTypes.DEPTH;
             break;
         case "layout":
             attrTypes = XmlAttributeTypes.LAYOUT;
             break;
     }
     return attrTypes;
 }
Example #10
0
 /// <summary>
 /// Initializes an instance of LayoutAttribute class.
 /// </summary>
 /// <param name="name">Layout name.</param>
 /// <param name="value">Layout value.</param>
 /// <param name="_type">Attribute type.</param>
 public LayoutAttribute(string name, string value, XmlAttributeTypes _type)
 {
     this.Name  = name;
     this.Value = value;
     this.Type  = _type;
 }