public void EhNodesCleared(NGTreeNodeCollection orgNodes)
 {
     foreach (var orgNode in orgNodes)
     {
         GuiHelper.MirrorTreeNodeRemoved(orgNode);
     }
 }
        public void Contents_SetItems(NGTreeNodeCollection items)
        {
            // please note:
            // every time we change the count, we have to remove all items and add them again
            // this is because the group items have another heigth, but the MeasureItem routine is
            // only called once when the item is added into the list
            bool isFirstTime = this.m_Contents_lbContents.Nodes.Count == 0;

            this.m_Contents_lbContents.BeginUpdate();
            Hashtable selNGNodes = SelectedNGNodes(this.m_Contents_lbContents);

            this.m_Contents_lbContents.ClearSelNodes();
            this.m_Contents_lbContents.Nodes.Clear();
            Update(this.m_Contents_lbContents, this.m_Contents_lbContents.Nodes, items, selNGNodes);

            if (isFirstTime) // Expand all root items if this is the first time
            {
                for (int i = 0; i < m_Contents_lbContents.Nodes.Count; i++)
                {
                    m_Contents_lbContents.Nodes[i].Expand();
                }
            }

            this.m_Contents_lbContents.EndUpdate();
            this.m_Contents_lbContents.Focus();
        }
示例#3
0
        public FileSystemTreeController()
        {
            // Sorted = true;
            _rootNode = new NGTreeNode();
            Nodes     = _rootNode.Nodes;

            Initialize(true);
        }
示例#4
0
 public NGTreeNode(bool lazyLoadChildren)
 {
     if (lazyLoadChildren)
     {
         _nodes = new MyColl3(this)
         {
             _dummyNode
         };
     }
 }
        public void DataAvailable_Initialize(NGTreeNodeCollection nodes)
        {
            this.m_Content_tvDataAvail.BeginUpdate();
            // Clear the TreeView each time the method is called.
            this.m_Content_tvDataAvail.Nodes.Clear();

            Update(this.m_Content_tvDataAvail, this.m_Content_tvDataAvail.Nodes, nodes, null);

            this.m_Content_tvDataAvail.EndUpdate();
        }
 private NGTreeNode GetPathNode(NGTreeNodeCollection coll, string path)
 {
     foreach (NGTreeNode node in coll)
     {
         if (node.Text == path && node.Tag == null)
         {
             return(node);
         }
     }
     return(null);
 }
示例#7
0
		private void AddTopic(IOptionPanelDescriptor desc, NGTreeNodeCollection nodecoll)
		{
			var newNode = new NGTreeNode(desc.Label);
			newNode.Tag = desc;
			if (null != desc.ChildOptionPanelDescriptors)
			{
				foreach (var child in desc.ChildOptionPanelDescriptors)
					AddTopic(child, newNode.Nodes);
			}
			nodecoll.Add(newNode);
		}
示例#8
0
        private NGTreeNode FindNode(NGTreeNodeCollection nodecoll, string txt)
        {
            foreach (var nd in nodecoll)
            {
                if (nd.Text == txt)
                {
                    return(nd);
                }
            }

            return(null);
        }
        private void AddFitFunctionList(RootNode rootNode, Altaxo.Main.Services.IFitFunctionInformation[] info, FitFunctionContextMenuStyle menustyle)
        {
            NGTreeNodeCollection root = rootNode.Nodes;

            foreach (Altaxo.Main.Services.IFitFunctionInformation entry in info)
            {
                string[] path = entry.Category.Split(new char[] { '\\', '/' });

                var where = root;
                for (int j = 0; j < path.Length; j++)
                {
                    var node = GetPathNode(where, path[j]);
                    if (node == null)
                    {
                        node = new CategoryNode(path[j]);
                        where.Add(node);
                    }
                    where = node.Nodes;
                }

                var creationTime = entry.CreationTime;
                var nodeText     = entry.Name;

                if (null != creationTime)
                {
                    nodeText += " (" + creationTime.Value.ToString("yyyy-MM-dd HH:mm:ss") + ")";
                }

                var leaf = new FitFunctionLeafNode(nodeText, entry);

                switch (menustyle)
                {
                case FitFunctionContextMenuStyle.None:
                    leaf.SetMenuEnabled(false, false, false);
                    break;

                case FitFunctionContextMenuStyle.EditAndDelete:
                    //	leaf.ContextMenu = _userFileLeafNodeContextMenu;
                    leaf.SetMenuEnabled(false, true, true);
                    break;

                case FitFunctionContextMenuStyle.Edit:
                    //	leaf.ContextMenu = _appFileLeafNodeContextMenu;
                    leaf.SetMenuEnabled(true, false, false);
                    break;
                }
                where.Add(leaf);
            }
        }
示例#10
0
        private void AddTopic(IOptionPanelDescriptor desc, NGTreeNodeCollection nodecoll)
        {
            var newNode = new NGTreeNode(desc.Label)
            {
                Tag = desc
            };

            if (null != desc.ChildOptionPanelDescriptors)
            {
                foreach (var child in desc.ChildOptionPanelDescriptors)
                {
                    AddTopic(child, newNode.Nodes);
                }
            }
            nodecoll.Add(newNode);
        }
        void Update(MWControlSuite.MWTreeView view, TreeNodeCollection tree, NGTreeNodeCollection coll, Hashtable selectedNGNodes)
        {
            if (tree.Count != 0)
            {
                throw new ApplicationException("Tree must be empty here");
            }

            for (int i = 0; i < coll.Count; i++)
            {
                bool isExpanded = false;


                if (null != coll[i].GuiTag)
                {
                    TreeNode node = (TreeNode)coll[i].GuiTag;
                    isExpanded = node.IsExpanded;

                    node.Remove();
                    node.Nodes.Clear();
                    tree.Add(node);
                }
                else
                {
                    tree.Add(NewNode(coll[i]));
                }

                if (coll[i].Nodes.Count > 0)
                {
                    Update(view, tree[i].Nodes, coll[i].Nodes, selectedNGNodes);
                }

                if (isExpanded)
                {
                    tree[i].Expand();
                }
                if (null != selectedNGNodes && selectedNGNodes.ContainsKey(coll[i]))
                {
                    view.SelectNode(tree[i], false);
                    if (tree[i].Parent != null && !(tree[i].Parent.IsExpanded))
                    {
                        tree[i].Parent.Expand();
                    }
                }
            }
        }
        /// <summary>
        /// Initialize the controller with the document. If successfull, the function has to return true.
        /// </summary>
        /// <param name="args">The arguments neccessary to create the controller. Normally, the first argument is the document, the second can be the parent of the document and so on.</param>
        /// <returns>True if successfull, else false.</returns>
        public bool InitializeDocument(params object[] args)
        {
            if (args == null || args.Length == 0)
            {
                return(false);
            }
            _doc = _originalDoc = args[0] as PlotItemCollection;
            if (null == _originalDoc)
            {
                return(false);
            }

            if (_useDocument == UseDocument.Copy)
            {
                _doc = _originalDoc.Clone();
            }

            _plotItemsTree = _plotItemsRootNode.Nodes;
            SetElements(true);
            return(true);
        }
    public void DataAvailable_Initialize(NGTreeNodeCollection nodes)
    {
      this.m_Content_tvDataAvail.BeginUpdate();
      // Clear the TreeView each time the method is called.
      this.m_Content_tvDataAvail.Nodes.Clear();

      Update(this.m_Content_tvDataAvail,this.m_Content_tvDataAvail.Nodes, nodes,null);

      this.m_Content_tvDataAvail.EndUpdate();
    }
		public void AvailableLists_Initialize(NGTreeNodeCollection nodes)
		{
			_guiSL.AvailableLists_Initialize(nodes);
		}
    public void Contents_SetItems(NGTreeNodeCollection items)
    {
      // please note:
      // every time we change the count, we have to remove all items and add them again
      // this is because the group items have another heigth, but the MeasureItem routine is
      // only called once when the item is added into the list
      bool isFirstTime = this.m_Contents_lbContents.Nodes.Count == 0;
      this.m_Contents_lbContents.BeginUpdate();
      Hashtable selNGNodes = SelectedNGNodes(this.m_Contents_lbContents);
      this.m_Contents_lbContents.ClearSelNodes();
      this.m_Contents_lbContents.Nodes.Clear();
      Update(this.m_Contents_lbContents,this.m_Contents_lbContents.Nodes, items,selNGNodes);

      if (isFirstTime) // Expand all root items if this is the first time
      {
        for (int i = 0; i < m_Contents_lbContents.Nodes.Count; i++)
          m_Contents_lbContents.Nodes[i].Expand();
      }
      
      this.m_Contents_lbContents.EndUpdate();
      this.m_Contents_lbContents.Focus();



    }
    /// <summary>
    /// Initialize the controller with the document. If successfull, the function has to return true.
    /// </summary>
    /// <param name="args">The arguments neccessary to create the controller. Normally, the first argument is the document, the second can be the parent of the document and so on.</param>
    /// <returns>True if successfull, else false.</returns>
    public bool InitializeDocument(params object[] args)
    {
      if (args == null || args.Length == 0)
        return false;
      _doc = _originalDoc = args[0] as PlotItemCollection;
      if (null == _originalDoc)
        return false;

      if (_useDocument == UseDocument.Copy)
        _doc = _originalDoc.Clone();

      _plotItemsTree = _plotItemsRootNode.Nodes;
      SetElements(true);
      return true;
    }
 public void AvailableLists_Initialize(NGTreeNodeCollection nodes)
 {
     _guiSL.AvailableLists_Initialize(nodes);
 }
 public void AvailableItems_Initialize(NGTreeNodeCollection items)
 {
     _guiSL.AvailableItems_Initialize(items);
 }
		private NGTreeNode GetPathNode(NGTreeNodeCollection coll, string path)
		{
			foreach (NGTreeNode node in coll)
			{
				if (node.Text == path && node.Tag == null)
					return node;
			}
			return null;
		}
示例#20
0
    public void EhNodesCleared(NGTreeNodeCollection orgNodes)
    {
      foreach (var orgNode in orgNodes)
        GuiHelper.MirrorTreeNodeRemoved(orgNode);

    }
    void Update(MWControlSuite.MWTreeView view, TreeNodeCollection tree, NGTreeNodeCollection coll, Hashtable selectedNGNodes)
    {
      if (tree.Count != 0)
        throw new ApplicationException("Tree must be empty here");

      for (int i = 0; i < coll.Count; i++)
      {
        bool isExpanded = false;
       

        if (null != coll[i].GuiTag)
        {
          TreeNode node = (TreeNode)coll[i].GuiTag;
          isExpanded = node.IsExpanded;
         
          node.Remove();
          node.Nodes.Clear();
          tree.Add(node);
          
        }
        else
        {
          tree.Add(NewNode(coll[i]));
        }

        if (coll[i].Nodes.Count > 0)
          Update(view,tree[i].Nodes, coll[i].Nodes,selectedNGNodes);

        if (isExpanded)
          tree[i].Expand();
        if (null != selectedNGNodes && selectedNGNodes.ContainsKey(coll[i]))
        {
          view.SelectNode(tree[i], false);
          if (tree[i].Parent != null && !(tree[i].Parent.IsExpanded))
            tree[i].Parent.Expand();
        }
      }
    }
示例#22
0
 public void AvailableItems_Initialize(NGTreeNodeCollection items)
 {
     _guiAvailableSymbols.ItemsSource = items;
 }
示例#23
0
 public void AvailableLists_Initialize(NGTreeNodeCollection nodes)
 {
     _guiAvailableLists.ItemsSource = nodes;
 }
示例#24
0
		public FileSystemTreeController()
		{
			// Sorted = true;
			_rootNode = new NGTreeNode();
			Nodes = _rootNode.Nodes;

			Initialize(true);
		}
示例#25
0
		public void AvailableItems_Initialize(NGTreeNodeCollection items)
		{
			_guiAvailableSymbols.ItemsSource = items;
		}
		public void AvailableItems_Initialize(NGTreeNodeCollection items)
		{
			_guiSL.AvailableItems_Initialize(items);
		}
 public void SetFitFunctions(NGTreeNodeCollection list)
 {
     _guiFitFunctions.ItemsSource = list;
 }
		private NGTreeNode FindNode(NGTreeNodeCollection nodecoll, string txt)
		{
			foreach (var nd in nodecoll)
				if (nd.Text == txt)
					return nd;

			return null;
		}
示例#29
0
		public void AvailableLists_Initialize(NGTreeNodeCollection nodes)
		{
			_guiAvailableLists.ItemsSource = nodes;
		}