public void OnStructureChanged(TreePathEventArgs args) { if (StructureChanged != null) { StructureChanged(this, args); } }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) { throw new ArgumentNullException(); } TreeNodeAdv node = FindNode(e.Path); if (node == null) { return; } ReadChilds(node); UpdateSelection(); if (_completeSuspendUpdate) { return; } this.FullUpdate(); this.Invalidate(); //else // throw new ArgumentException("Path not found"); }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) { throw new ArgumentNullException(); } TreeNodeAdv node = FindNode(e.Path); if (node != null) { if (node != Root) { node.IsLeaf = Model.IsLeaf(GetPath(node)); } var list = new Dictionary <object, object>(); SaveExpandedNodes(node, list); ReadChilds(node); RestoreExpandedNodes(node, list); UpdateSelection(); SmartFullUpdate(); } //else // throw new ArgumentException("Path not found"); }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) { throw new ArgumentNullException(); } TreeNodeAdv node = FindNode(e.Path); if (node != null) { if (node != Root) { node.IsLeaf = Model.IsLeaf(GetPath(node)); } var list = new Dictionary <object, object>(); var selObjects = SelectedNodes.Select(n => n.Tag).ToArray(); SaveExpandedNodes(node, list); ReadChilds(node); RestoreExpandedNodes(node, list); //UpdateSelection(); SmartFullUpdate(); BeginUpdate(); var nodes = selObjects.Select(obj => FindNodeByTag(obj)).Where(n => n != null).ToList(); if (!nodes.SequenceEqual(SelectedNodes)) { // Must rebuild selection: ClearSelectionInternal(); if (nodes.Count > 0) { foreach (var n in nodes) { n.IsSelected = true; } EnsureVisible(nodes.First()); ScrollTo(nodes.First()); } OnSelectionChanged(); } EndUpdate(); } //else // throw new ArgumentException("Path not found"); }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) { throw new ArgumentNullException(); } TreeNodeAdv node = FindNode(e.Path); if (node != null) { ReadChilds(node); UpdateSelection(); SmartFullUpdate(); } //else // throw new ArgumentException("Path not found"); }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) throw new ArgumentNullException(); TreeNodeAdv node = FindNode(e.Path); if (node != null) { ReadChilds(node); UpdateSelection(); if (!_completeSuspendUpdate) { this.FullUpdate(); this.Invalidate(); } } }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) throw new ArgumentNullException(); TreeNodeAdv node = FindNode(e.Path); if (node != null) { if (node != Root) node.IsLeaf = Model.IsLeaf(GetPath(node)); var list = new Dictionary<object, object>(); SaveExpandedNodes(node, list); ReadChilds(node); RestoreExpandedNodes(node, list); UpdateSelection(); SmartFullUpdate(); } //else // throw new ArgumentException("Path not found"); }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) throw new ArgumentNullException(); TreeNodeAdv node = FindNode(e.Path); if (node != null) { ReadChilds(node); UpdateSelection(); SmartFullUpdate(); } //else // throw new ArgumentException("Path not found"); }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) throw new ArgumentNullException(); TreeNodeAdv node = FindNode(e.Path); if (node != null) { Collection<ExpandedNode> expandedNodes = null; if (KeepNodesExpanded && node.IsExpanded) { expandedNodes = FindExpandedNodes(node); } _structureUpdating = true; try { ReadChilds(node, expandedNodes); UpdateSelection(); } finally { _structureUpdating = false; } SmartFullUpdate(); } }
void _innerModel_StructureChanged(object sender, TreePathEventArgs e) { OnStructureChanged(e); }
internal void RaiseStructureChanged(TreePathEventArgs args) { base.OnStructureChanged(args); }
public void CallStructureChanged(TreePathEventArgs args) { this.StructureChanged(this, args); }
void CheckBoxStateChanged(object sender, TreePathEventArgs e) { ComponentNode node = e.Path.LastNode as ComponentNode; if (node != null) { RecursiveCheckComponent(node.TypedContent); } }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) throw new ArgumentNullException(); TreeNodeAdv node = FindNode(e.Path); if (node != null) { if (node != Root) node.IsLeaf = Model.IsLeaf(GetPath(node)); object[] currentPath = GetRelativePath(node, _currentNode); object[] selectionStartPath = GetRelativePath(node, _selectionStart); List<object[]> selectionPaths = new List<object[]>(); List<TreeNodeAdv> preservedSelection = new List<TreeNodeAdv>(); foreach (var selectionNode in Selection) { object[] selectionPath = GetRelativePath(node, selectionNode); if (selectionPath != null) selectionPaths.Add(selectionPath); else //preserve selection because this selectionNode is not a child of node preservedSelection.Add(selectionNode); } var list = new Dictionary<object, object>(); SaveExpandedNodes(node, list); ReadChilds(node); bool suspendSelectionEventBefore = SuspendSelectionEvent; bool suspendUpdateBefore = _suspendUpdate; bool fireSelectionBefore = _fireSelectionEvent; SuspendSelectionEvent = true; _suspendUpdate = true; RestoreExpandedNodes(node, list); //Restore Selection: _selection.Clear(); //restore preserved selection. _selection.AddRange(preservedSelection); //restore selection for child nodes. foreach ( var selectionPath in selectionPaths) { TreeNodeAdv selectionNode = FindChildNode(node, selectionPath, 0, false); if (selectionNode != null) { selectionNode.SetSelectedInternal(true); _selection.Add(selectionNode); } else fireSelectionBefore = true; // selection changed. } if (currentPath != null) _currentNode = FindChildNode(node, currentPath, 0, false); if (selectionStartPath != null) _selectionStart = FindChildNode(node, selectionStartPath, 0, false); _fireSelectionEvent = fireSelectionBefore; _suspendUpdate = suspendUpdateBefore; SuspendSelectionEvent = suspendSelectionEventBefore; UpdateSelection(); SmartFullUpdate(); } //else // throw new ArgumentException("Path not found"); }
private void TreeStructureChanged(object sender, TreePathEventArgs e) { OnStructureChanged(e); }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) { throw new ArgumentNullException(); } TreeNodeAdv node = FindNode(e.Path); if (node != null) { if (node != Root) { node.IsLeaf = Model.IsLeaf(GetPath(node)); } object[] currentPath = GetRelativePath(node, _currentNode); object[] selectionStartPath = GetRelativePath(node, _selectionStart); List <object[]> selectionPaths = new List <object[]>(); List <TreeNodeAdv> preservedSelection = new List <TreeNodeAdv>(); foreach (var selectionNode in Selection) { object[] selectionPath = GetRelativePath(node, selectionNode); if (selectionPath != null) { selectionPaths.Add(selectionPath); } else //preserve selection because this selectionNode is not a child of node { preservedSelection.Add(selectionNode); } } var list = new Dictionary <object, object>(); SaveExpandedNodes(node, list); ReadChilds(node); bool suspendSelectionEventBefore = SuspendSelectionEvent; bool suspendUpdateBefore = _suspendUpdate; bool fireSelectionBefore = _fireSelectionEvent; SuspendSelectionEvent = true; _suspendUpdate = true; RestoreExpandedNodes(node, list); //Restore Selection: _selection.Clear(); //restore preserved selection. _selection.AddRange(preservedSelection); //restore selection for child nodes. foreach (var selectionPath in selectionPaths) { TreeNodeAdv selectionNode = FindChildNode(node, selectionPath, 0, false); if (selectionNode != null) { selectionNode.SetSelectedInternal(true); _selection.Add(selectionNode); } else { fireSelectionBefore = true; // selection changed. } } if (currentPath != null) { _currentNode = FindChildNode(node, currentPath, 0, false); } if (selectionStartPath != null) { _selectionStart = FindChildNode(node, selectionStartPath, 0, false); } _fireSelectionEvent = fireSelectionBefore; _suspendUpdate = suspendUpdateBefore; SuspendSelectionEvent = suspendSelectionEventBefore; UpdateSelection(); SmartFullUpdate(); } //else // throw new ArgumentException("Path not found"); }
private void OnTreeModelStructureChanged(object sender, TreePathEventArgs e) { var rootNode = m_treeModel.Root.Nodes.ElementAt(0); m_view.SetExpanded(rootNode); if (m_treeModel.FilterIO || m_treeModel.FilterNet || m_treeModel.FilterSecurity) { ExpandAll(rootNode); } }
private void _model_StructureChanged(object sender, TreePathEventArgs e) { if (e.Path == null) throw new ArgumentNullException(); TreeNodeAdv node = FindNode(e.Path); if (node == null) return; ReadChilds(node); UpdateSelection(); if (_completeSuspendUpdate) return; this.FullUpdate(); this.Invalidate(); //else // throw new ArgumentException("Path not found"); }
public void OnStructureChanged(TreePathEventArgs args) { StructureChanged?.Invoke(this, args); }
private void NotifyStructureChanged(RepositoryItem repositoryItem) { if (!_notify) return; var model = FindModel(); if (model != null && this.Parent != null) { TreePath path = model.GetPath(repositoryItem); if (path != null) { var args = new TreePathEventArgs(path); model.RaiseStructureChanged(args); } } }
public void OnStructureChanged(TreePathEventArgs args) { if (StructureChanged != null) StructureChanged(this, args); }
void _innerModel_StructureChanged(object sender, TreePathEventArgs e) { OnStructureChanged(e); }