コード例 #1
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);
        }
コード例 #2
0
 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;
 }
コード例 #3
0
        public List <LayoutAttribute> GetAttributesCollection(XmlNode xn)
        {
            List <LayoutAttribute> lstXmlAttr = new List <LayoutAttribute>();
            int attrCount = xn.Attributes.Count;

            while (attrCount > 0)
            {
                attrCount--;
                LayoutAttribute xa = new LayoutAttribute();
                xa.Name  = Utils.CleanString(xn.Attributes[attrCount].Name);
                xa.Value = Utils.CleanString(xn.Attributes[attrCount].Value);
                xa.Type  = GetXmlAttributeType(xa);
                lstXmlAttr.Add(xa);
            }
            return(lstXmlAttr);
        }
コード例 #4
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;
 }
コード例 #5
0
        public List<LayoutAttribute> GetAttributesCollection(XmlNode xn)
        {
            List<LayoutAttribute> lstXmlAttr = new List<LayoutAttribute>();
            int attrCount = xn.Attributes.Count;
            while (attrCount > 0)
            {
                attrCount--;
                LayoutAttribute xa = new LayoutAttribute();
                xa.Name = Utils.CleanString(xn.Attributes[attrCount].Name);
                xa.Value = Utils.CleanString(xn.Attributes[attrCount].Value);
                xa.Type = GetXmlAttributeType(xa);
                lstXmlAttr.Add(xa);

            }
            return lstXmlAttr;
        }