Example #1
0
 private void treeView1_BeforeSelect(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     getSubDirs(e.Node);                                 // 取得选择节点的子文件夹
     textBox1.Text = fixPath(e.Node);                    // 更新文本框内容
     folder        = new DirectoryInfo(e.Node.FullPath); // 获得它的目录信息
     fillListView(listView1, fixPath(e.Node));
 }
Example #2
0
		protected override void OnBeforeExpand(TreeViewCancelEventArgs e) {
			var node = e.Node as TreeNodeX;
			if (node != null) {
				node.OnExpand();
			}
			base.OnBeforeExpand(e);
		}
 /// <summary> method _folderTreeView_BeforeSelect
 /// <para>Before we select a tree node we want to make sure that we scan the soon to be selected
 /// tree node for any sub-folders.  this insures proper tree construction on the fly.</para>
 /// <param name="sender">The object that invoked this event</param>
 /// <param name="e">The TreeViewCancelEventArgs event arguments.</param>
 /// <see cref="System.Windows.Forms.TreeViewCancelEventArgs"/>
 /// <see cref="System.Windows.Forms.TreeView"/>
 /// </summary>
 private void _folderTreeView_BeforeSelect(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     getSubDirs(e.Node);                               // get the sub-folders for the selected node.
     _pathTextBox.Text = fixPath(e.Node);              // update the user selection text box.
     _pathTextBox.Select(_pathTextBox.Text.Length, 0); // Cursor at the end
     folder = new DirectoryInfo(e.Node.FullPath);      // get it's Directory info.
 }
        protected override void OnBeforeSelect(TreeViewCancelEventArgs e)
        {
            base.OnBeforeSelect(e);

            bool controlKeyDown = (Control.ModifierKeys == Keys.Control);
            bool shiftKeyDown = (Control.ModifierKeys == Keys.Shift);

            if (controlKeyDown
                && _selectedNodes.Contains(e.Node))
            {
                // Unselect it (let framework know we don't want selection this time)
                e.Cancel = true;

                // Update nodes
                e.Node.BackColor = this.BackColor;
                e.Node.ForeColor = this.ForeColor;
                _selectedNodes.Remove(e.Node);

                if (this.SelectionChanged != null)
                {
                    this.SelectionChanged(this, EventArgs.Empty);
                }
            }
            else
            {
                _lastNode = e.Node;
                if (!shiftKeyDown)
                {
                    _firstNode = e.Node;
                }
            }
        }
Example #5
0
 private void TreeViewBoards_BeforeSelect(object sender, TreeViewCancelEventArgs e)
 {
     if (e.Node != null)
     {
         mainController.RunAction(ActionRes.LoadCard, e.Node.Tag);
     }
 }
 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     if ( method.MethodSpecs.Count > 0 )
     {
         this.Nodes.Add( new MethodSpecCollectionTreeNode( method.MethodSpecs ) );
     }
 }
 private void BeforeSelect(object source, TreeViewCancelEventArgs e)
 {
     TreeNode node = e.Node;
     string[] strArray = node.FullPath.Split(new char[] { '\\' });
     node.SelectedImageIndex = strArray.Length - 1;
     this.exit = false;
 }
Example #8
0
 private void m_arbre_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     if (e.Node.Nodes.Count == 1 && e.Node.Nodes[0].Tag == null)
     {
         FillChilds(e.Node);
     }
 }
Example #9
0
        private void TilesetTree_BeforeExpand(object sender, TreeViewCancelEventArgs e)
        {
            ObjectDirectory od = null;
            TreeNode node = null;

            foreach (TreeNode cNode in e.Node.Nodes)
            {
                if (cNode.Tag is ObjectDirectory && cNode.Nodes.Count == 0)
                {
                    od = cNode.Tag as ObjectDirectory;

                    foreach (ObjectDirectory c in od.ObjectDirectories)
                    {
                        node = new TreeNode(c.Name);
                        node.Tag = c;
                        cNode.Nodes.Add(node);
                    }

                    foreach (MapObject c in od.MapObjects)
                    {
                        node = new TreeNode(c.Name);
                        node.Tag = c;
                        cNode.Nodes.Add(node);
                    }
                }
            }
        }
        private static void AddSubFoldersToCurrentFolder(TreeViewCancelEventArgs e, string[] newSubs)
        {
            if (newSubs.Length > 0)
            {
                for (int k = 0; k < newSubs.Length; k++)
                {
                    //Only get the non-hidden folders and non-system folders
                    //TODO: Find out why C:\PerfLogs denies access in Win7 or at least some flag
                    //that it uses so I don't have to have the string hard-coded into the program
                    bool isHidden = ((File.GetAttributes(newSubs[k]) & FileAttributes.Hidden) ==
                        FileAttributes.Hidden);
                    bool isSystem = ((File.GetAttributes(newSubs[k]) & FileAttributes.System) ==
                        FileAttributes.System);
                    if (!isHidden && !newSubs[k].Contains("PerfLogs") && !isSystem)
                    {

                        TreeNode subNode = new TreeNode();
                        subNode.Name = newSubs[k];
                        string[] tokenPath = newSubs[k].Split(Path.DirectorySeparatorChar);
                        subNode.Text = tokenPath[tokenPath.Length - 1];
                        subNode.Tag = newSubs[k];
                        subNode.ImageIndex = (int)folderTypes.FolderClosed;
                        subNode.SelectedImageIndex = (int)folderTypes.FolderOpen;

                        AddPlaceholderForSubFolders(newSubs[k], subNode);

                        e.Node.Nodes.Add(subNode);
                    }

                }
            }
        }
Example #11
0
 /// //////////////////////////////////////////////////////
 private void m_arbre_BeforeCheck(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     if (m_bLockEdition && !m_bIsInitialising)
     {
         e.Cancel = true;
     }
 }
        /// <summary>
        /// Go to the drive and get all the files and directories directly under it
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GameDataTreeView_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            // Get our initial root path from our treeView Tag
            //	string rootPath = (string)e.Node.TreeView.Tag;

            if (e.Node.Nodes[0].Text == "BLANK")
            {
                try
                {
                    guiAssetTreeTag dirTag = (guiAssetTreeTag)e.Node.Tag;

                    MOG_ControllerSyncData targetGamdeData = null;

                    // Check if this directory has a targetGamdeData
                    if (dirTag.Object != null)
                    {
                        targetGamdeData = (MOG_ControllerSyncData)dirTag.Object;
                    }

                    if (Path.IsPathRooted(dirTag.FullFilename))
                    {
                        FillDirectory(e.Node, dirTag.FullFilename, targetGamdeData);
                    }
                }
                catch
                {
                }
            }
        }
Example #13
0
 // cancel selection just in case we get selected somehow
 protected override void OnBeforeSelect(TreeViewCancelEventArgs e)
 {
     base.OnBeforeSelect(e);
       if (e.Node.ForeColor == SystemColors.GrayText) {
     e.Cancel = true;
       }
 }
Example #14
0
        /// <summary>
        /// Finds other Forms in the MDI that want to switch to show this sprite's properties.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeView1_BeforeSelect(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            //TODO: use events instead, this is ugly...

            Sprite sp = this.SpriteFromNode(e.Node);

            //TODO: when not in Mdi mode
            if (this.MdiParent != null)
            {
                foreach (Form form in this.MdiParent.MdiChildren)
                {
                    System.Type type = form.GetType();
                    if (type == typeof(LocScaleRotEdit))
                    {
                        if (((LocScaleRotEdit)form).AutoswitchToSprite)
                        {
                            ((LocScaleRotEdit)form).EditSprite = sp;
                        }
                    }
                    else if (type == typeof(PropertyInspector))
                    {
                        if (((PropertyInspector)form).AutoswitchToSprite)
                        {
                            ((PropertyInspector)form).ShowProperties(sp);
                        }
                    }
                }
            }
        }
Example #15
0
        private static void TvWndList_BeforeExpand(object sender, TreeViewCancelEventArgs e)
        {
            TreeNode node = e.Node;
            if (node.Nodes[0].Name != "none")
            {
                return;
            }
            node.Nodes.Clear();

            string name = node.Name;
            if (!Regex.IsMatch(name, "^\\d+$"))
            {
                return;
            }

            var intPtr = (IntPtr)int.Parse(name);
            if (intPtr == IntPtr.Zero)
            {
                return;
            }

            IntPtr subPtr = IntPtr.Zero;
            var classList = new Dictionary<string, int>();
            while (true)
            {
                subPtr = User32API.FindWindowEx(intPtr, subPtr, null, null);
                if (subPtr == IntPtr.Zero)
                {
                    break;
                }
                var temp = new TreeNode { Name = subPtr.ToString(), Text = DisplayNote(subPtr, classList) };
                temp.Nodes.Add(new TreeNode { Name = "none" });
                node.Nodes.Add(temp);
            }
        }
Example #16
0
        private void tvClassifications_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            classTreeNode ctn = e.Node as classTreeNode;

            if (ctn != null && !ctn.FilledIn)
            {
                Cursor.Current = Cursors.WaitCursor;

                // kill the dummy node
                ctn.Nodes.Clear();

                // if we have an associated assettreenode
                if (ctn.assetTreeNode != null)
                {
                    // populate the next level based on the asset tree node
                    foreach (AssetTreeNode subAssetNode in ctn.assetTreeNode.Nodes)
                    {
                        ctn.Nodes.Add(EncodeNode(subAssetNode, ctn.props));
                    }

                    // make sure we don't reload this level again
                    ctn.FilledIn      = true;
                    ctn.assetTreeNode = null;
                }

                Cursor.Current = Cursors.Default;
            }
        }
Example #17
0
 private void NodeTree_BeforeExpand(object sender, TreeViewCancelEventArgs e)
 {
     ExplorerNode node = e.Node.Tag as ExplorerNode;
     if (node == null)
         return;
     node.BeforeExpand(sender, e);
 }
Example #18
0
    private void tvwRoot_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
    {
        // Before expanding a node, remove existing child nodes.
        // This emulates Windows Explorer's behavior -- if
        // there are directories and/or files within the drive, the
        // TreeView will display them. if not, the + sign simply
        // disappears when you attempt to expand the node.
        try
        {
            e.Node.Nodes.Clear();

            // Go out and get the folder and file names.
            AddFolders(e.Node);
            AddFiles(e.Node);
        }
        catch (IOException)
        {
            // Perhaps the drive isn't ready. In that
            // case, simply disregard the error.
        }
        catch (Exception exp)
        {
            // if any other error occurs, display an alert.
            MessageBox.Show(exp.ToString(), this.Text);
        }
    }
Example #19
0
        protected void OnBeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            // Set cursor as wait
            Cursor.Current = Cursors.WaitCursor;

            // Populate sub directory in depth 2
            try {
                PopulateSubDirectory(e.Node, 2);
                Cursor.Current = Cursors.Default;

                // Set icon as opened
                if (e.Node.Parent != null)
                {
                    //e.node.ImageIndex = e.node.SelectedImageIndex = 1;
                }
            }
            catch (Exception excpt) {
                // Show error message and cancel expand
                BugTracking.WriteExceptionRecord(excpt);
                MessageBox.Show(excpt.Message, "Device Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                e.Cancel = true;
            }

            // Set cursor as default
            Cursor.Current = Cursors.Default;
        }
 protected override void OnBeforeSelect(TreeViewCancelEventArgs e)
 {
     if (Updating)
         e.Cancel = true;
     else
         base.OnBeforeSelect(e);
 }
Example #21
0
		/// <summary>
		/// Raises the <see cref="TreeView.BeforeExpand"/> event.
		/// </summary>
		/// <remarks>
		/// This ensures that the children of a node that is about to be exanded are loaded.
		/// </remarks>
		/// <param name="e">A <see cref="TreeViewCancelEventArgs"/> describing the event arguments.</param>
		protected override void OnBeforeExpand(TreeViewCancelEventArgs e)
		{
			foreach (XmlTreeNode xtnChild in e.Node.Nodes)
				if (!xtnChild.IsLoaded)
					xtnChild.LoadChildren();
			base.OnBeforeExpand(e);
		}
Example #22
0
        private void tvwServerExplorer_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            // List all Tables for selected Database

            if (e.Node.ImageIndex == 0)
            {
                this.Cursor = Cursors.WaitCursor;
                // Set database to get tables from
                SqlProvider.obj.Database = e.Node.Text;

                // Clear dummy node
                e.Node.Nodes.Clear();

                try
                {
                    ProjectBuilder.ProjectName  = txtSiteName.Text;
                    ProjectBuilder.ProjectPort  = txtProjectPort.Text;
                    ProjectBuilder.ServerName   = txtServerName.Text;
                    ProjectBuilder.PhysicalPath = txtphysicalPath.Text;
                    ProjectBuilder.ProjectName  = txtSiteName.Text;
                    ProjectBuilder.HasMasterBox = cbHasMasterBox.Checked;
                    ProjectBuilder.ProjectType  = (ProjectType)selProjectType.SelectedIndex;
                    ProjectBuilder.CreateProject();
                    this.Cursor = Cursors.Default;
                }
                catch (Exception ex)
                {
                    this.Cursor         = Cursors.Default;
                    statbarpnlMain.Text = "Problem listing Tables...";

                    MessageBox.Show(ex.Message);
                }
            }
        }
Example #23
0
 ///<Summary>Should never occur since if the condition tested for is True,
 /// the user should never be able to Collapse the node. However, it is
 /// theoretically possible for the code to request a collapse of this node
 /// If it occurs, cancel it</Summary>
 private void tv1_BeforeCollapse(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     if (!tv1.ShowRootLines && e.Node == Root)
     {
         e.Cancel = true;
     }
 }
Example #24
0
        private void tvMain_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            // get the subdirectories if needed.
            GetSubDirectoryNodes(e.Node);

            Application.DoEvents();
        }
Example #25
0
 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     foreach ( MethodSemanticDeclaration method in @event.Members )
     {
         this.Nodes.Add( new MethodTreeNode( method.Method ) );
     }
 }
 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     foreach ( MethodSpecDeclaration methodSpec in methodSpecs )
     {
         this.Nodes.Add( new MethodSpecTreeNode( methodSpec ) );
     }
 }
Example #27
0
 private void BrowseTV_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     System.Windows.Forms.TreeNode node = e.Node;
     if (node != null && node.Parent == this.m_localNetwork)
     {
         if (node.Nodes.Count == 1 && node.Nodes[0].Text == "")
         {
             this.BrowseServers(node);
         }
     }
     if (this.IsServerNode(node))
     {
         if (node.Nodes.Count == 1 && node.Nodes[0].Text == "")
         {
             this.Connect(node);
         }
     }
     else if (this.IsBrowseElementNode(node))
     {
         if (node.Nodes.Count >= 1 && node.Nodes[0].Text == "")
         {
             this.Browse(node);
         }
     }
 }
Example #28
0
 void nodeTreeView_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     if (!this.nodeTreeView.SelectedNode.Equals(e.Node))
     {
         rebuild_node_tree(e.Node);
     }
 }
Example #29
0
        private void f_filesView_BeforeSelect(object sender, TreeViewCancelEventArgs e)
        {
            TreeNode selectedNode = f_filesView.SelectedNode;

            if (selectedNode == null)
                return;
        }
 private void _tvColumns_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     if (_controller != null)
     {
         _controller.EhView_BeforeExpand((NGTreeNode)e.Node.Tag);
     }
 }
 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     foreach ( GenericParameterDeclaration genericParameter in genericParameters )
     {
         this.Nodes.Add( new GenericParameterTreeNode( genericParameter ) );
     }
 }
Example #32
0
 private void OnBeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     Debug.Assert(e.Action == TreeViewAction.Expand);
     ExpandNode(e.Node);
     Cursor = Cursors.Default;
 }
Example #33
0
 private void mFileTreeView_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     //			if (e.Node.Tag is CategorizedInfo)
     //			{
     //				MessageBox.Show(((CategorizedInfo)(e.Node.Tag)).Text);
     //			}
 }
        /// <summary>
        /// Populates the Directory structure for a given path.
        /// </summary>
        /// <param name="parent">Parent node for which the data is to retrieve</param>
        /// <param name="e"><c>TreeViewCancelEventArgs</c> to abort current expanding.</param>
        protected virtual void RequestChildNodes(TreeNodePath parent, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            if (!parent.HasDummyNode || parent.Path == null)
            {
                return;
            }

            // everything ok, here we go
            this.BeginUpdate();

            try
            {
                parent.RemoveDummyNode();

                // if we have not scanned this folder before
                _dataProvider.RequestChildNodes(parent, e);
            }
            finally
            {
                this.EndUpdate();
            }
        }
        protected internal override void OnPopulate( TreeViewCancelEventArgs e )
        {
            if ( this.block.HasChildrenBlocks )
            {
                IEnumerator<InstructionBlock> children = this.block.GetChildrenEnumerator();
                while ( children.MoveNext() )
                {
                    this.Nodes.Add(
                        new InstructionBlockTreeNode( children.Current,
                                                      children.Current.HasExceptionHandlers
                                                          ? "protected block"
                                                          : "block" ) );
                }
            }

            if ( this.block.HasExceptionHandlers )
            {
                ExceptionHandler handler = this.block.FirstExceptionHandler;
                while ( handler != null )
                {
                    this.Nodes.Add( new ExceptionHandlerTreeNode( handler ) );
                    handler = handler.NextSiblingExceptionHandler;
                }
            }


            if ( this.block.HasLocalVariableSymbols )
            {
                this.Nodes.Add( new LocaVariableSymbolCollectionTreeNode( this.block ) );
            }
        }
Example #36
0
 private void tvModel_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     if (((RcTreeNode)e.Node).ChipType == RcChipType.Cowl && initializing)
     {
         e.Cancel = true;
     }
 }
Example #37
0
 private void TreeView_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     if (!m_AllowExpandCollapse)
     {
         e.Cancel = true;
     }
 }
Example #38
0
        private void OnBeforeExpand(object o, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            if (DoubleClicked)
            {
                e.Cancel      = true;
                DoubleClicked = false;
                e.Node.Collapse();
            }
            else
            {
                DatabaseNode dbn = e.Node as DatabaseNode;
                if (dbn != null)
                {
                    if (dbn.Nodes.Count == 1)
                    {
                        HiddenNode hn = dbn.Nodes[0] as HiddenNode;
                        if (hn != null)
                        {
                            dbn.Nodes.Clear();

                            // build tables
                            TablesNode TableRoot = new TablesNode("Tables");

                            Collection <TableInfo> tables = DatabaseCtrl.GetTables(dbn.DbInfo);

                            foreach (TableInfo tbl in tables)
                            {
                                TableNode tNode = new TableNode(tbl);
                                foreach (ColumnInfo column in tbl.Columns)
                                {
                                    ColumnNode cNode = new ColumnNode(column.ColumnName);
                                    tNode.Nodes.Add(cNode);
                                }
                                TableRoot.Nodes.Add(tNode);
                            }

                            dbn.Nodes.Add(TableRoot);

                            // build views
                            TableRoot = new TablesNode("Views");

                            Collection <ViewInfo> views = DatabaseCtrl.GetViews(dbn.DbInfo);

                            foreach (ViewInfo view in views)
                            {
                                ViewNode vNode = new ViewNode(view.ViewName);
                                foreach (ColumnInfo column in view.Columns)
                                {
                                    ColumnNode cNode = new ColumnNode(column.ColumnName);
                                    vNode.Nodes.Add(cNode);
                                }
                                TableRoot.Nodes.Add(vNode);
                            }

                            dbn.Nodes.Add(TableRoot);
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Called before a node is about to expand.
        /// </summary>
        private void BrowseTV_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            TreeNode node = e.Node;

            if (node != null && node.Parent == m_localNetwork)
            {
                // browse server if not already done.
                if (node.Nodes.Count == 1 && node.Nodes[0].Text == "")
                {
                    BrowseServers(node);
                }
            }

            if (IsServerNode(node))
            {
                // connect to server if not already connected.
                if (node.Nodes.Count == 1 && node.Nodes[0].Text == "")
                {
                    Connect(node);
                }

                return;
            }

            if (IsBrowseElementNode(node))
            {
                // browse for children if not already fetched.
                if (node.Nodes.Count >= 1 && node.Nodes[0].Text == "")
                {
                    Browse(node);
                }

                return;
            }
        }
Example #40
0
 /// <summary>
 /// Clear previous selected node colors
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void GameDataTreeView_BeforeSelect(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     if (GameDataTreeView.SelectedNode != null)
     {
         GameDataTreeView.SelectedNode.BackColor = System.Drawing.SystemColors.Window;
     }
 }
        private void treeView1_BeforeExpand(object sender, TreeViewCancelEventArgs e)
        {
            if (e.Node.Nodes.Count > 0)
            {
                if (e.Node.Nodes[0].Text == "..." && e.Node.Nodes[0].Tag == null)
                {

                    e.Node.Nodes.Clear();
                    string[] dirs = Directory.GetDirectories(e.Node.Tag.ToString());
                    foreach(string dir in dirs)
                    {
                        if (dir != e.Node.Tag+"System Volume Information")
                        {
                            DirectoryInfo di = new DirectoryInfo(dir);
                            TreeNode node = new TreeNode(di.Name, 0, 1);

                            node.Tag = dir;
                            if (di.GetDirectories().Count() > 0)
                                node.Nodes.Add(null, "...");
                             e.Node.Nodes.Add(node);
                        }
                        else
                        {
                            MessageBox.Show(dir);
                        }

                    }

                }

            }
        }
Example #42
0
// Triggers
//
// (overriden method, and base class called to ensure events are triggered)


		protected override void OnBeforeSelect(TreeViewCancelEventArgs e)
		{
			base.OnBeforeSelect(e);
				
			bool bControl = (ModifierKeys==Keys.Control);
			bool bShift = (ModifierKeys==Keys.Shift);

			// selecting twice the node while pressing CTRL ?
			if (bControl && m_coll.Contains( e.Node ) )
			{
				// unselect it (let framework know we don't want selection this time)
				e.Cancel = true;
	
				// update nodes
				removePaintFromNodes();
				m_coll.Remove( e.Node );

        foreach (TreeNode node in e.Node.Nodes)
          if (m_coll.Contains(node))
            m_coll.Remove(node);

				paintSelectedNodes();
				return;
			}

			m_lastNode = e.Node;
			if (!bShift) m_firstNode = e.Node; // store begin of shift sequence
		}
Example #43
0
        private void treeView1_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            //获取发出信息的节点
            TreeNode node = e.Node;

            //设置它为treeView的当前节点
            this.treeView1.SelectedNode = node;
            string path = node.FullPath;

            string[] dirs = null;
            try
            {
                //获得当前节点所有的子节点
                dirs = Directory.GetDirectories(path);
            }
            catch (Exception error)
            {
                //错误处理为空,即忽略
            }

            if (dirs != null)
            {
                //为每一个当前节点的字节点添加子节点
                for (int j = 0; j < dirs.Length; j++)
                {
                    //如果当前节点的子节点数为0,则为它添加子节点
                    //否则说明已经添加过或则没有子目录
                    if (node.Nodes[j].Nodes.Count == 0)
                    {
                        //调用函数为子节点添加子节点
                        addDirectroy(node.Nodes[j], dirs[j]);
                    }
                }
            }
        }
Example #44
0
        protected internal override void OnPopulate( TreeViewCancelEventArgs e )
        {
            if ( this.module.AssemblyManifest != null )
            {
                this.Nodes.Add( new AssemblyTreeNode( this.module.AssemblyManifest ) );
            }

            if ( this.module.AssemblyRefs.Count > 0 ||
                 this.module.ModuleRefs.Count > 0 ||
                 this.module.TypeSpecs.Count > 0 )
            {
                this.Nodes.Add( new ExternalFoldersTreeNode( this.module ) );
            }

            if ( this.module.TypeRefs.Count > 0 )
            {
                this.Nodes.Add( new ExternalTypeFolderTreeNode( this.module, "External Types" ) );
            }

            if ( this.module.Types.Count > 0 )
            {
                this.Nodes.Add( new ModuleTypesFolderTreeNode( this.module ) );
            }

            if ( this.module.UnmanagedResources.Count > 0 )
            {
                this.Nodes.Add( new UnmanagedResourceFolderTreeNode( this.module.UnmanagedResources ) );
            }
        }
Example #45
0
        private void treeViewRP_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            Instance myInstance = null;
            Int32    i          = 0;

            while (i < myInstances.Count())
            {
                if (myInstances.ElementAt(i).node == e.Node)
                {
                    myInstance = myInstances.ElementAt(i);
                }
                i++;
            }

            if (myInstance != null && myInstance.expanded == false)
            {
                e.Node.Nodes.Clear();
                if (myInstance.attributeName != null)
                {
                    GetAttributeReferences(myInstance.ifcInstance, myInstance.attributeName, myInstance.attributeType, myInstance.node);
                }
                else
                {
                    InsertItemAttributesRP(IfcEngine.x64.sdaiGetInstanceType(myInstance.ifcInstance), myInstance.ifcInstance, myInstance.node);
                }
                myInstance.expanded = true;
            }
        }
Example #46
0
        private void tv1_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            Cursor oldCursor = Cursor;

            Cursor = Cursors.WaitCursor;
            if (e.Node.Nodes.Count == 1 && e.Node.Nodes[0].Text.Equals(" : "))
            {
                //Debug.WriteLine("Expanding -- " & e.Node.Text)
                e.Node.Nodes.Clear();
                CShItem        CSI = e.Node.Tag as CShItem;
                List <CShItem> D   = CSI.GetDirectories(true);

                if (D.Count > 0)
                {
                    D.Sort();                     //uses the class comparer
                    CShItem item;
                    foreach (CShItem tempLoopVar_item in D)
                    {
                        item = tempLoopVar_item;
                        if (!(item.IsHidden && !m_showHiddenFolders))
                        {
                            e.Node.Nodes.Add(MakeNode(item));
                        }
                    }
                }
            }
            else             //Ensure content is accurate
            {
                RefreshNode(e.Node);
            }
            Cursor = oldCursor;
        }
 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     foreach ( TypeRefDeclaration externalType in this.decl.TypeRefs )
     {
         this.Nodes.Add( new ExternalTypeTreeNode( externalType ) );
     }
 }
 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     foreach ( InterfaceImplementationDeclaration interfaceImplementation in type.InterfaceImplementations )
     {
         this.Nodes.Add( new InterfaceImplementationTreeNode( interfaceImplementation.ImplementedInterface ) );
     }
 }
        private void tvStrutsMappings_BeforeExpand(object sender, TreeViewCancelEventArgs e)
        {

            if (e.Node != null && e.Node.Tag != null)
            {
                onTreeViewBeforeExpand(e.Node, e.Node.Tag);
            }
        }
 protected override void OnBeforeCollapse(System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     // PATCH: if the node is being collapsed by a double click at the state image, cancel it
     if ((GetTreeNodeHitAtCheckBoxByScreenPosition(Control.MousePosition.X, Control.MousePosition.Y) != null))
     {
         e.Cancel = true;
     }
 }
Example #51
0
 private void treeViewBrowser_BeforeExpand(object sender, TreeViewCancelEventArgs e)
 {
     Expanding = true;
     if (e.Node.Nodes[0].Text == "")
     {
         TreeNode node = fe.EnumerateDirectory(e.Node);
     }
 }
 private void cirTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e)
 {
     var nodeCount = cirTreeView.GetNodeCount(true);
     if (nodeCount < 1000)
         ViewHelpers.onBeforeExpand_tvFunctionMakesCallsTo(e.Node,false);
     else
         DI.log.error("in cirTreeView_BeforeExpand , Max number of items in TreeView:{0}", nodeCount);            
 }
Example #53
0
 protected override void OnBeforeSelect(TreeViewCancelEventArgs e)
 {
     if (!only_focus)
     {
         base.OnBeforeSelect(e);
         NewSelection(e.Node);
     }
 }
 protected override void OnBeforeCheck(TreeViewCancelEventArgs e)
 {
     base.OnBeforeCheck(e);
     // prevent checking/unchecking of HiddenCheckBoxTreeNode,
     // otherwise, we will have to repeat checkbox hiding
     if (e.Node is Custom_HiddenCheckBoxTreeNode)
         e.Cancel = true;
 }
		/// <summary>
		/// Occurs in case of node deploymentю
		/// </summary>
		/// <param name="e">TreeViewCancelEventArgs</param>
		protected override void OnBeforeSelect(TreeViewCancelEventArgs e)
		{
			e.Node.BackColor = Color.FromKnownColor(KnownColor.Highlight);

			// e.Node.ForeColor = Color.FromKnownColor(KnownColor.HighlightText);

			base.OnBeforeSelect(e);
		}
Example #56
0
 protected override void OnBeforeCollapse(System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     // PATCH:如果节点正被坍塌的状态图像通过双击,取消
     if ((GetTreeNodeHitAtCheckBoxByScreenPosition(Control.MousePosition.X, Control.MousePosition.Y) != null))
     {
         e.Cancel = true;
     }
 }
Example #57
0
 private void tLoc_BeforeSelect(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     if (tLoc.SelectedNode != null)
     {
         tLoc.SelectedNode.BackColor = SystemColors.Window;
         tLoc.SelectedNode.ForeColor = SystemColors.WindowText;
     }
 }
Example #58
0
 private void treeFiles_BeforeExpand(object sender, TreeViewCancelEventArgs e)
 {
     FileSystemNode fsNode = e.Node.Tag as FileSystemNode;
     if (fsNode != null && !fsNode.Loaded) {
         AppendChildren(e.Node, fsNode.GetChildren());
         fsNode.Loaded = true;
     }
 }
Example #59
0
 protected override void OnBeforeExpand(System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     // PATCH:正在扩大,如果节点通过双击状态图像,取消
     if ((GetTreeNodeHitAtCheckBoxByScreenPosition(Control.MousePosition.X, Control.MousePosition.Y) != null))
     {
         e.Cancel = true;
     }
 }
Example #60
0
        protected override void OnBeforeSelect(TreeViewCancelEventArgs e)
        {
            // Never allow base.SelectedNode to be set!
            base.SelectedNode = null;
            e.Cancel = true;

            base.OnBeforeSelect(e);
        }