public string load( string loadFileName ) { string returnVal = ""; string xmlContents = ""; // Get the File and Load it to XML Doc try { XmlDocument doc = new XmlDocument(); doc.Load(loadFileName); xmlContents = doc.InnerXml; } catch (Exception ex) { returnVal = "Error loading file: " + loadFileName; } if (returnVal == "") { // Convert the XML Doc to the Class RuleMasterList rmTemp = new RuleMasterList(); rmTemp = (RuleMasterList)XMLUtility.Deserialize<RuleMasterList>(xmlContents); this.DataModel = rmTemp.DataModel; this.RuleListFileName = loadFileName; this.RuleListOwner = rmTemp.RuleListOwner; this.ruleMasters = rmTemp.ruleMasters; returnVal = "Rule Masters Loaded = " + this.ruleMasters.Count().ToString(); } return returnVal; }
private void tabRuleMasters_GotFocus(object sender, RoutedEventArgs e) { if (ruleMasterList == null) { ruleMasterList = new RuleMasterList(); ruleMasterList.ruleMasters = new List<RuleMaster>(); } if (ruleMasterList.ruleMasters != null && ruleMasterList.ruleMasters.Count > 0) { //-- set the treeview updateTreeRuleMaster(); } }