protected bool IsDifferent() { IPersistence current = new XmlPersistenceImpl(FullPath, true); IBaseNodeInterface.Persist(current); IPersistence existing = new XmlPersistenceImpl(FullPath); return(current.RawContent != existing.RawContent); }
private void SaveTreeFile(IDecisionTree tree, string fileName) { IPersistence persistence = new XmlPersistenceImpl(fileName, true); if (tree.Save(persistence, fileName)) { if (persistence.SaveAs(fileName)) { IApplicationInterface.StatusLine = string.Format("{0} saved to disk", Path.GetFileName(fileName)); } } }
private void LoadFile(string fileName) { LastUsedFolder = fileName; IDecisionTree tree = IApplicationInterface.NewDescisionTree(); IPersistence persistence = new XmlPersistenceImpl(fileName); if (tree.Load(persistence, fileName)) { ctrl.AddTree(tree); IApplicationInterface.StatusLine = string.Format("Opened {0} from disk", Path.GetFileName(fileName)) + UI_Constants.ZoomPanHint; } }
private void tbxSourceFile_TextChanged(object sender, EventArgs e) { if (File.Exists(tbxSourceFile.Text)) { SourceTree = App.NewDescisionTree(); IPersistence persistence = new XmlPersistenceImpl(tbxSourceFile.Text); SrcVariables = SourceTree.LoadVariables(persistence); if (SrcVariables != null && SrcVariables.Nodes.Count > 0) { Analyze(); } } }
private void LoadFile(string fileName) { LastUsedFolder = fileName; IDecisionTree tree = IApplicationInterface.NewDescisionTree(); IPersistence persistence = new XmlPersistenceImpl(fileName); if (tree.Load(persistence, fileName)) { if (tree.RootNode.GetNode(eNodeType.DataObjects) == null) { IBaseNode dataObjects = tree.CreateNewNode(eNodeType.DataObjects, null, Constants.DataNodesTreeName); tree.RootNode.AddNode(dataObjects); } if (tree.RootNode.GetNode(eNodeType.DataSources) == null) { IBaseNode dataSources = tree.CreateNewNode(eNodeType.DataSources, null, Constants.DataSourcesTreeName); tree.RootNode.AddNode(dataSources); } ctrl.AddTree(tree); IApplicationInterface.StatusLine = string.Format("Opened {0} from disk", Path.GetFileName(fileName)) + UI_Constants.ZoomPanHint; } }