當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.TreeViewCancelEventArgs類代碼示例

本文整理匯總了C#中System.Windows.Forms.TreeViewCancelEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# TreeViewCancelEventArgs類的具體用法?C# TreeViewCancelEventArgs怎麽用?C# TreeViewCancelEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TreeViewCancelEventArgs類屬於System.Windows.Forms命名空間,在下文中一共展示了TreeViewCancelEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AddSubFoldersToCurrentFolder

        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);
                    }

                }
            }
        }
開發者ID:jameshollingshead,項目名稱:filetools,代碼行數:32,代碼來源:frmFileTools.cs

示例2: TilesetTree_BeforeExpand

        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);
                    }
                }
            }
        }
開發者ID:RyanTankersley,項目名稱:XNATools,代碼行數:27,代碼來源:TilesetTree.cs

示例3: TvWndList_BeforeExpand

        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);
            }
        }
開發者ID:burstas,項目名稱:rmps,代碼行數:35,代碼來源:SubWindow.cs

示例4: OnBeforeSelect

 // 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;
       }
 }
開發者ID:xenithorb,項目名稱:KeeAgent,代碼行數:8,代碼來源:TreeViewEx.cs

示例5: OnPopulate

 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     if ( method.MethodSpecs.Count > 0 )
     {
         this.Nodes.Add( new MethodSpecCollectionTreeNode( method.MethodSpecs ) );
     }
 }
開發者ID:jogibear9988,項目名稱:ormbattle,代碼行數:7,代碼來源:ExternalMethodTreeNode.cs

示例6: OnBeforeExpand

		protected override void OnBeforeExpand(TreeViewCancelEventArgs e) {
			var node = e.Node as TreeNodeX;
			if (node != null) {
				node.OnExpand();
			}
			base.OnBeforeExpand(e);
		}
開發者ID:mamingxiu,項目名稱:dnExplorer,代碼行數:7,代碼來源:TreeViewX.cs

示例7: OnBeforeSelect

        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;
                }
            }
        }
開發者ID:Christoph21x,項目名稱:ARGUS-TV,代碼行數:32,代碼來源:MultiSelectTreeView.cs

示例8: NodeTree_BeforeExpand

 private void NodeTree_BeforeExpand(object sender, TreeViewCancelEventArgs e)
 {
     ExplorerNode node = e.Node.Tag as ExplorerNode;
     if (node == null)
         return;
     node.BeforeExpand(sender, e);
 }
開發者ID:jijo-paulose,項目名稱:bistro-framework,代碼行數:7,代碼來源:Control.cs

示例9: f_filesView_BeforeSelect

        private void f_filesView_BeforeSelect(object sender, TreeViewCancelEventArgs e)
        {
            TreeNode selectedNode = f_filesView.SelectedNode;

            if (selectedNode == null)
                return;
        }
開發者ID:PhilBusko,項目名稱:C-Sharp,代碼行數:7,代碼來源:MainForm.cs

示例10: OnPopulate

 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     foreach ( TypeRefDeclaration externalType in this.decl.TypeRefs )
     {
         this.Nodes.Add( new ExternalTypeTreeNode( externalType ) );
     }
 }
開發者ID:jogibear9988,項目名稱:ormbattle,代碼行數:7,代碼來源:ExternalTypeTreeNode.cs

示例11: OnBeforeSelect

 protected override void OnBeforeSelect(TreeViewCancelEventArgs e)
 {
     if (Updating)
         e.Cancel = true;
     else
         base.OnBeforeSelect(e);
 }
開發者ID:Shraddha512,項目名稱:ICSE-2011-FireDetective,代碼行數:7,代碼來源:ItemsTreeView.cs

示例12: OnPopulate

 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     foreach ( InterfaceImplementationDeclaration interfaceImplementation in type.InterfaceImplementations )
     {
         this.Nodes.Add( new InterfaceImplementationTreeNode( interfaceImplementation.ImplementedInterface ) );
     }
 }
開發者ID:jogibear9988,項目名稱:ormbattle,代碼行數:7,代碼來源:InterfaceImplementationTreeNode.cs

示例13: OnPopulate

 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     foreach ( MethodSpecDeclaration methodSpec in methodSpecs )
     {
         this.Nodes.Add( new MethodSpecTreeNode( methodSpec ) );
     }
 }
開發者ID:jogibear9988,項目名稱:ormbattle,代碼行數:7,代碼來源:MethodSpecTreeNode.cs

示例14: OnPopulate

 protected internal override void OnPopulate( TreeViewCancelEventArgs e )
 {
     foreach ( GenericParameterDeclaration genericParameter in genericParameters )
     {
         this.Nodes.Add( new GenericParameterTreeNode( genericParameter ) );
     }
 }
開發者ID:jogibear9988,項目名稱:ormbattle,代碼行數:7,代碼來源:GenericParameterTreeNode.cs

示例15: treeView1_BeforeExpand

        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);
                        }

                    }

                }

            }
        }
開發者ID:RoykoSerhiy,項目名稱:visualStudio_projects,代碼行數:32,代碼來源:Form1.cs


注:本文中的System.Windows.Forms.TreeViewCancelEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。