Example #1
0
 public void OnStructureChanged(TreePathEventArgs args)
 {
     if (StructureChanged != null)
     {
         StructureChanged(this, args);
     }
 }
Example #2
0
        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");
        }
Example #3
0
        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");
        }
Example #4
0
        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");
        }
Example #6
0
        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();
                }
               }
        }
Example #7
0
		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");
		}
Example #8
0
        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");
        }
Example #9
0
        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);
 }
Example #11
0
 internal void RaiseStructureChanged(TreePathEventArgs args)
 {
     base.OnStructureChanged(args);
 }
 public void CallStructureChanged(TreePathEventArgs args)
 {
     this.StructureChanged(this, args);
 }
Example #13
0
 void CheckBoxStateChanged(object sender, TreePathEventArgs e)
 {
     ComponentNode node = e.Path.LastNode as ComponentNode;
     if (node != null)
     {
         RecursiveCheckComponent(node.TypedContent);
     }
 }
Example #14
0
		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");
		}
Example #15
0
 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");
        }
Example #17
0
 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");
		}
Example #19
0
 public void OnStructureChanged(TreePathEventArgs args)
 {
     StructureChanged?.Invoke(this, args);
 }
Example #20
0
        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);
                }
            }
        }
Example #21
0
 public void OnStructureChanged(TreePathEventArgs args)
 {
     if (StructureChanged != null)
     StructureChanged(this, args);
 }
Example #22
0
 void _innerModel_StructureChanged(object sender, TreePathEventArgs e)
 {
     OnStructureChanged(e);
 }