public static CT_SortCondition Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_SortCondition ctObj = new CT_SortCondition(); if (node.Attribute("descending") != null) { ctObj.descending = XmlHelper.ReadBool(node.Attribute("descending")); } if (node.Attribute("sortBy") != null) { ctObj.sortBy = (ST_SortBy)Enum.Parse(typeof(ST_SortBy), node.Attribute("sortBy").Value); } ctObj.@ref = XmlHelper.ReadString(node.Attribute("ref")); ctObj.customList = XmlHelper.ReadString(node.Attribute("customList")); if (node.Attribute("dxfId") != null) { ctObj.dxfId = XmlHelper.ReadUInt(node.Attribute("dxfId")); } if (node.Attribute("iconSet") != null) { ctObj.iconSet = XmlHelper.GetEnumValueFromString <ST_IconSetType>(node.Attribute("iconSet").Value); } if (node.Attribute("iconId") != null) { ctObj.iconId = XmlHelper.ReadUInt(node.Attribute("iconId")); } return(ctObj); }
public static CT_SortState Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_SortState ctObj = new CT_SortState(); if (node.Attribute("columnSort") != null) { ctObj.columnSort = XmlHelper.ReadBool(node.Attribute("columnSort")); } if (node.Attribute("caseSensitive") != null) { ctObj.caseSensitive = XmlHelper.ReadBool(node.Attribute("caseSensitive")); } if (node.Attribute("sortMethod") != null) { ctObj.sortMethod = (ST_SortMethod)Enum.Parse(typeof(ST_SortMethod), node.Attribute("sortMethod").Value); } ctObj.@ref = XmlHelper.ReadString(node.Attribute("ref")); ctObj.sortCondition = new List <CT_SortCondition>(); foreach (XElement childNode in node.ChildElements()) { if (childNode.Name.LocalName == "extLst") { ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "sortCondition") { ctObj.sortCondition.Add(CT_SortCondition.Parse(childNode, namespaceManager)); } } return(ctObj); }