public List <ExcelProperty> dfsLoadNode(XmlNode root) { List <ExcelProperty> lep = new List <ExcelProperty>(); XmlNodeList nodes = root.ChildNodes; foreach (XmlElement ele in nodes) { string type = ele.GetAttribute("type"); Debug.Log("type:" + type); if (type == "class") { List <ExcelProperty> ret = dfsLoadNode(ele); ExcelProperty np = new ExcelProperty(ele.InnerXml, ele.Name, type); np.SubclassProperties = ret; int maxCount = 1; int.TryParse(ele.GetAttribute("MaxCount"), out maxCount); np.MaxListCount = maxCount; lep.Add(np); } else if (type == "enum") { ExcelProperty ep = new ExcelProperty(ele.InnerXml, ele.Name, type); ep.enumType = ele.GetAttribute("etype"); lep.Add(ep); } else { lep.Add(new ExcelProperty(ele.InnerXml, ele.Name, type)); } } return(lep); }
public void SetProperty(string strKey, string strColumn, ExcelProperty Data, object Value) { string strKeyWord = GetKeyWord(strKey, strColumn); if (m_dictProperty.ContainsKey(strKeyWord) == false) { m_dictProperty[strKeyWord] = new Dictionary <ExcelProperty, object>(); } m_dictProperty[strKeyWord][Data] = Value; }
public bool Add(string property_prefix, string property_name, string property_value, bool visible) { bool result = false; if (property_name.Length == 0) return result; if (_list != null) { if (!_list.Contains(property_name)) { try { ExcelProperty _new_property = new ExcelProperty(property_prefix, property_name, property_value); if (_new_property != null) { _new_property.Visible = visible; int _old_size = _list.Count; _list.Add(property_name, _new_property); int _new_size = _list.Count; if (_old_size != _new_size) result = true; }; } catch { } }; }; return result; }