public static string[] GetSupportAttributes() { string[] result; try { List <string> list = new List <string>(); XmlDocument xmlDocumentDTD = DrawDriverXmlOp.GetXmlDocumentDTD(); XmlCommomOp.xmlPath = DrawDriverXmlOp.strXmlDocumentDTDFilePath; XmlNode[] xmlNodeByTagname = XmlCommomOp.GetXmlNodeByTagname("SupportAttribute"); if (xmlNodeByTagname == null || xmlNodeByTagname.Length <= 0) { result = null; } else { foreach (XmlNode xmlNode in xmlNodeByTagname[0]) { list.Add(xmlNode.Name); } result = list.ToArray(); } } catch (Exception ex) { throw ex; } return(result); }
public static string[] GetSupportChildTypeByXmlNode(XmlNode _node) { string[] result; try { if (_node == null) { throw new NullReferenceException(); } List <string> list = new List <string>(); XmlDocument xmlDocumentDTD = DrawDriverXmlOp.GetXmlDocumentDTD(); XmlCommomOp.xmlPath = DrawDriverXmlOp.strXmlDocumentDTDFilePath; XmlNode[] xmlNodeByTagname = XmlCommomOp.GetXmlNodeByTagname(_node.Name); if (xmlNodeByTagname == null || xmlNodeByTagname.Length <= 0) { result = null; } else { XmlNode[] array = xmlNodeByTagname; for (int i = 0; i < array.Length; i++) { XmlNode xmlNode = array[i]; XmlNode parentNode = xmlNode.ParentNode; if (parentNode != null) { if (parentNode.Name.ToLower().Trim().Equals("LabelContains".ToLower())) { XmlElement xmlElement = (XmlElement)xmlNode; foreach (XmlAttribute xmlAttribute in xmlElement.Attributes) { if (xmlAttribute.Name.ToLower().Equals("Contains".ToLower())) { string text = xmlAttribute.Value.ToLower(); result = text.Split(new char[] { ',' }); return(result); } } } } } result = null; } } catch (Exception ex) { throw ex; } return(result); }
public static DrawType GetDrawTypeByXmlNode(XmlNode _node) { DrawType result; try { if (_node == null) { throw new NullReferenceException(); } List <string> list = new List <string>(); XmlDocument xmlDocumentDTD = DrawDriverXmlOp.GetXmlDocumentDTD(); XmlCommomOp.xmlPath = DrawDriverXmlOp.strXmlDocumentDTDFilePath; XmlNode[] xmlNodeByTagname = XmlCommomOp.GetXmlNodeByTagname(_node.Name); if (xmlNodeByTagname == null || xmlNodeByTagname.Length <= 0) { result = DrawType.None; } else { XmlNode[] array = xmlNodeByTagname; for (int i = 0; i < array.Length; i++) { XmlNode xmlNode = array[i]; XmlNode parentNode = xmlNode.ParentNode; if (parentNode != null) { if (parentNode.Name.ToLower().Trim().Equals("SupportLabels".ToLower())) { XmlElement xmlElement = (XmlElement)xmlNode; foreach (XmlAttribute xmlAttribute in xmlElement.Attributes) { if (xmlAttribute.Name.ToLower().Equals("DrawType".ToLower())) { string text = xmlAttribute.Value.ToLower(); if (text.Equals("string")) { result = DrawType.String; return(result); } if (text.Equals("line")) { result = DrawType.Line; return(result); } if (text.Equals("image")) { result = DrawType.Image; return(result); } if (text.Equals("fillrectangle")) { result = DrawType.FillRectangle; return(result); } if (text.Equals("rectangle")) { result = DrawType.Rectangle; return(result); } if (text.Equals("circle")) { result = DrawType.Circle; return(result); } result = DrawType.None; return(result); } } } } } result = DrawType.None; } } catch (Exception ex) { throw ex; } return(result); }