当前位置: 首页>>代码示例>>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;未经允许,请勿转载。