本文整理汇总了C#中System.Windows.Forms.TreeViewCancelEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# TreeViewCancelEventArgs类的具体用法?C# TreeViewCancelEventArgs怎么用?C# TreeViewCancelEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreeViewCancelEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了TreeViewCancelEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: OnBeforeSelect
// 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
}
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:33,代码来源:TreeViewMS.cs
示例17: OnBeforeExpand
/// <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);
}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:14,代码来源:XmlTreeView.cs
示例18: OnPopulate
protected internal override void OnPopulate( TreeViewCancelEventArgs e )
{
foreach ( MethodSemanticDeclaration method in @event.Members )
{
this.Nodes.Add( new MethodTreeNode( method.Method ) );
}
}
开发者ID:jogibear9988,项目名称:ormbattle,代码行数:7,代码来源:EventTreeNode.cs
示例19: OnPopulate
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 ) );
}
}
开发者ID:jogibear9988,项目名称:ormbattle,代码行数:31,代码来源:InstructionBlockTreeNode.cs
示例20: BeforeSelect
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;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:QueuePathDialog.cs
注:本文中的System.Windows.Forms.TreeViewCancelEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论