コード例 #1
0
        public static CT_SortState Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_SortState ctObj = new CT_SortState();

            ctObj.columnSort    = XmlHelper.ReadBool(node.Attributes["columnSort"]);
            ctObj.caseSensitive = XmlHelper.ReadBool(node.Attributes["caseSensitive"]);
            if (node.Attributes["sortMethod"] != null)
            {
                ctObj.sortMethod = (ST_SortMethod)Enum.Parse(typeof(ST_SortMethod), node.Attributes["sortMethod"].Value);
            }
            ctObj.@ref          = XmlHelper.ReadString(node.Attributes["ref"]);
            ctObj.sortCondition = new List <CT_SortCondition>();
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sortCondition")
                {
                    ctObj.sortCondition.Add(CT_SortCondition.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
コード例 #2
0
ファイル: AutoFilter.cs プロジェクト: hiodava/Romero
        public static CT_SortCondition Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_SortCondition ctObj = new CT_SortCondition();

            if (node.Attributes["descending"] != null)
            {
                ctObj.descending = XmlHelper.ReadBool(node.Attributes["descending"]);
            }
            if (node.Attributes["sortBy"] != null)
            {
                ctObj.sortBy = (ST_SortBy)Enum.Parse(typeof(ST_SortBy), node.Attributes["sortBy"].Value);
            }
            ctObj.@ref       = XmlHelper.ReadString(node.Attributes["ref"]);
            ctObj.customList = XmlHelper.ReadString(node.Attributes["customList"]);
            if (node.Attributes["dxfId"] != null)
            {
                ctObj.dxfId = XmlHelper.ReadUInt(node.Attributes["dxfId"]);
            }
            if (node.Attributes["iconSet"] != null)
            {
                ctObj.iconSet = XmlHelper.GetEnumValueFromString <ST_IconSetType>(node.Attributes["iconSet"].Value);
            }
            if (node.Attributes["iconId"] != null)
            {
                ctObj.iconId = XmlHelper.ReadUInt(node.Attributes["iconId"]);
            }
            return(ctObj);
        }
コード例 #3
0
ファイル: AutoFilter.cs プロジェクト: Reinakumiko/npoi
 public static CT_SortCondition Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_SortCondition ctObj = new CT_SortCondition();
     if (node.Attributes["descending"] != null)
         ctObj.descending = XmlHelper.ReadBool(node.Attributes["descending"]);
     if (node.Attributes["sortBy"] != null)
         ctObj.sortBy = (ST_SortBy)Enum.Parse(typeof(ST_SortBy), node.Attributes["sortBy"].Value);
     ctObj.@ref = XmlHelper.ReadString(node.Attributes["ref"]);
     ctObj.customList = XmlHelper.ReadString(node.Attributes["customList"]);
     if (node.Attributes["dxfId"] != null)
         ctObj.dxfId = XmlHelper.ReadUInt(node.Attributes["dxfId"]);
     if (node.Attributes["iconSet"] != null)
         ctObj.iconSet = XmlHelper.GetEnumValueFromString<ST_IconSetType>(node.Attributes["iconSet"].Value);
     if (node.Attributes["iconId"] != null)
         ctObj.iconId = XmlHelper.ReadUInt(node.Attributes["iconId"]);
     return ctObj;
 }