-
public static List<CLocalTabStruct.ScreenLableItem> GetXmlLabelNameList(string fileFullName)
-
{
-
List<CLocalTabStruct.ScreenLableItem> listLabelItem = new List<CLocalTabStruct.ScreenLableItem>();
-
if (fileFullName.Equals(string.Empty))
-
return null;
-
-
XmlDocument tmpDoc = new XmlDocument();
-
tmpDoc.Load(fileFullName);
-
XmlNode rootNode = tmpDoc.SelectSingleNode("Controls");
-
-
XmlNodeList slblNodeList = null;
-
if (rootNode.SelectSingleNode("SmartLabels") != null)
-
slblNodeList = rootNode.SelectSingleNode("SmartLabels").ChildNodes;
-
-
if (slblNodeList == null)
-
return null;
-
-
foreach (XmlNode xn0 in slblNodeList)
-
{
-
XmlElement xe = (XmlElement)xn0;
-
CLocalTabStruct.ScreenLableItem lblItem = new CLocalTabStruct.ScreenLableItem();
-
lblItem.ItemName = xe.GetAttribute("Name");
-
lblItem.Text = xe.GetAttribute("Text");
-
-
listLabelItem.Add(lblItem);
-
}
-
listLabelItem.Sort(CompareObject);
-
-
return listLabelItem;
-
}
-
-
public static int CompareObject(CLocalTabStruct.ScreenLableItem x, CLocalTabStruct.ScreenLableItem y)
-
{
-
int result = 0;
-
result = y.ItemName.CompareTo(x.ItemName);
-
return result;
-
}
参考文献:
http://blog.csdn.net/zhouqinghe24/article/details/8649521
阅读(2430) | 评论(0) | 转发(0) |