gf.CreateImplementation = true; gf.OutputPath = fi.Directory.FullName; } /// <summary> /// save to file /// </summary> /// <param name='fullname'> /// Fullname. /// </param> private void doSave(String fullname, bool clear) { XmlDocument d = new XmlDocument(); if (clear) { d.Load(fullname); d.RemoveAll(); } XmlElement config = d.CreateElement("configuration"); d.AppendChild(config); XmlElement glade = d.CreateElement("glade"); config.AppendChild(glade); TreeNavigator tn = TsData.GetFirstNode(); do { GladeFile gf = (GladeFile)tn.GetValue(dfGladefile); gf.save(glade);
void UpdateChildrenForRootCheck(TreeNavigator rootnode, CheckBoxState newCheck) { if (!rootnode.MoveToChild()) { return; } do { rootnode.SetValue(nodeCheck, newCheck); } while (rootnode.MoveNext()); }
void LoadModes() { storeModes.Clear(); var currentMode = SelectedExecutionMode; bool nodeSelected = false; var ctx = new CommandExecutionContext(item, h => item.CanExecute(new ExecutionContext(h, null, IdeApp.Workspace.ActiveExecutionTarget), IdeApp.Workspace.ActiveConfiguration, SelectedConfiguration)); foreach (var modeSet in Runtime.ProcessService.GetExecutionModes()) { TreeNavigator setNode = null; foreach (var mode in modeSet.ExecutionModes) { if (ctx.CanExecute(mode.ExecutionHandler)) { if (setNode == null) { setNode = storeModes.AddNode(); setNode.SetValue(modeNameField, modeSet.Name); setNode.SetValue(modeField, mode); setNode.SetValue(modeSetField, modeSet); if (mode.Id == currentMode?.Id) { treeModes.SelectRow(setNode.CurrentPosition); nodeSelected = true; } } var node = storeModes.AddNode(setNode.CurrentPosition); node.SetValue(modeNameField, mode.Name); node.SetValue(modeField, mode); node.SetValue(modeSetField, modeSet); if (!nodeSelected && mode.Id == currentMode?.Id) { treeModes.SelectRow(node.CurrentPosition); nodeSelected = true; } } } // If the mode only has one child, remove it, we don't need to show it if (setNode != null && setNode.MoveToChild()) { var pos = setNode.Clone(); if (!setNode.MoveNext()) { pos.Remove(); } } } if (!nodeSelected && storeModes.GetFirstNode()?.CurrentPosition != null) { treeModes.SelectRow(storeModes.GetFirstNode().CurrentPosition); } }
void SelectAlgorithm(AlgorithmInfo algorithm) { TreeNavigator nav = store.GetFirstNode(); do { if (nav.GetValue(infoCol) == algorithm) { algorithmTree.SelectRow(nav.CurrentPosition); break; } } while (nav.MoveNext()); }
{ saveAs(); } /// <summary> /// remove the selected files from the treestore /// </summary> /// <param name='sender'> /// Sender. /// </param> /// <param name='e'> /// E. /// </param> void HandleBtnRemoveClicked (object sender, EventArgs e) { // TreePosition[] tp = Treeview1.SelectedRows; // foreach (TreePosition p in tp) // { // TsData.GetNavigatorAt(p).Remove(); // } TreeNavigator tn = TsData.GetFirstNode(); do {
void MoveBindingDown() { TaskBindingTreeNode bindingNode = GetSelectedBindingNode(); if (bindingNode?.MoveDown() == true) { TreeNavigator navigator = bindingsTreeStore.GetNavigatorAt(bindingsTreeView.SelectedRow); navigator.MoveNext(); TaskBindingTreeNode otherBindingNode = navigator.GetValue(bindingNodeField); navigator.SetValue(bindingNodeNameField, bindingNode.Name); navigator.SetValue(bindingNodeField, bindingNode); navigator.MovePrevious(); navigator.SetValue(bindingNodeNameField, otherBindingNode.Name); navigator.SetValue(bindingNodeField, otherBindingNode); } }
TreeNavigator SearchNode(string name) { TreeNavigator navigator = store.GetFirstNode(); if (navigator.CurrentPosition == null) { return(null); } do { if (name == navigator.GetValue(nameCol)) { return(navigator); } } while (navigator.MoveNext()); return(null); }
void ClearSiblingNodes(TreeNavigator navigator) { do { var node = navigator.GetValue(nodeField); if (node != null) { if (syncedNodes.Contains(node)) { syncedNodes.Remove(node); } if (nodePositions.ContainsKey(node)) { nodePositions.Remove(node); } } ClearChildNodes(navigator); } while (navigator.MoveNext()); }
TreeNavigator GetNavigator(TaskBindingTreeNode node) { TreeNavigator navigator = bindingsTreeStore.GetFirstNode(); TaskBindingTreeNode currentNode = navigator.GetValue(bindingNodeField); while (currentNode != node) { if (navigator.MoveNext()) { currentNode = navigator.GetValue(bindingNodeField); } else { LoggingService.LogError("Unable to find TreeNavigator for binding tree node {0}", node.Name); return(null); } } return(navigator); }
void ClearSiblingNodes (TreeNavigator navigator) { if (navigator.CurrentPosition == null) return; do { var node = navigator.GetValue (nodeField); if (node != null) { if (syncedNodes.Contains (node)) { syncedNodes.Remove (node); } if (nodePositions.ContainsKey (node)) { nodePositions.Remove (node); } } ClearChildNodes (navigator); } while (navigator.MoveNext ()); }