本文整理汇总了C#中ICSharpCode.TreeView.SharpTreeNode类的典型用法代码示例。如果您正苦于以下问题:C# SharpTreeNode类的具体用法?C# SharpTreeNode怎么用?C# SharpTreeNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SharpTreeNode类属于ICSharpCode.TreeView命名空间,在下文中一共展示了SharpTreeNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ClearDescendants
void ClearDescendants(SharpTreeNode node)
{
var index = List.IndexOf(node);
while (index + 1 < List.Count && List[index + 1].Level > node.Level) {
RemoveAt(index + 1);
}
}
开发者ID:lucaslra,项目名称:SPM,代码行数:7,代码来源:TreeFlattener.cs
示例2: GetNodeByVisibleIndex
internal static SharpTreeNode GetNodeByVisibleIndex(SharpTreeNode root, int index)
{
root.GetTotalListLength(); // ensure all list lengths are calculated
Debug.Assert(index >= 0);
Debug.Assert(index < root.totalListLength);
SharpTreeNode node = root;
Debug.Assert(node != null);
while (true) {
if (node.left != null && index < node.left.totalListLength) {
Debug.Assert(node.left != null);
node = node.left;
} else {
if (node.left != null) {
index -= node.left.totalListLength;
}
if (node.isVisible) {
if (index == 0)
return node;
index--;
}
Debug.Assert(node.right != null);
node = node.right;
}
}
}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:25,代码来源:FlatListTreeNode.cs
示例3: Copy
public override IDataObject Copy(SharpTreeNode[] nodes)
{
var data = new DataObject();
var paths = SharpTreeNode.ActiveNodes.Cast<FileSystemNode>().Select(n => n.FullPath).ToArray();
data.SetData(typeof(string[]), paths);
return data;
}
开发者ID:lujinlong,项目名称:Apq,代码行数:7,代码来源:FileSystemNode.cs
示例4: Execute
public void Execute(SharpTreeNode[] selectedNodes)
{
//Cast
var node = (ILSpyTreeNode)selectedNodes[0];
//Checks if the selected node is an assembly
if (node is AssemblyTreeNode)
{
//Forces lazy-loading
node.EnsureLazyChildren();
//Checks if it's a multi-module assembly
if (node.Children.Count > 1)
{
MessageBox.Show("In a multi-module assembly select a specific module", "Select module", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
//Takes the first (and only) module
node = (ILSpyTreeNode)node.Children[0];
}
//Shows the injection window
new Injection.InjectWindow(node, 0, new InjectExistingEntry().IsVisible(selectedNodes)).ShowDialog();
}
开发者ID:95ulisse,项目名称:ILEdit,代码行数:25,代码来源:InjectNewEntry.cs
示例5: DeleteCore
public override void DeleteCore(SharpTreeNode[] nodes)
{
foreach (var node in nodes.ToArray())
{
node.Parent.Children.Remove(node);
}
}
开发者ID:lujinlong,项目名称:Apq,代码行数:7,代码来源:FileSystemNode.cs
示例6: Delete
public override void Delete(SharpTreeNode[] nodes)
{
if (MessageBox.Show("Sure?", "Delete", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
{
DeleteCore(nodes);
}
}
开发者ID:lujinlong,项目名称:Apq,代码行数:7,代码来源:FileSystemNode.cs
示例7: Execute
public void Execute(SharpTreeNode[] selectedNodes)
{
// TODO: figure out when equivalent nodes are already present
// and focus those instead.
foreach (IMemberTreeNode node in selectedNodes) {
Analyze(node.Member);
}
}
开发者ID:95ulisse,项目名称:ILEdit,代码行数:8,代码来源:AnalyzeContextMenuEntry.cs
示例8: IsEnabled
public bool IsEnabled(SharpTreeNode[] selectedNodes)
{
foreach (IMemberTreeNode node in selectedNodes) {
if (!(node.Member is FieldDefinition || node.Member is MethodDefinition))
return false;
}
return true;
}
开发者ID:tanujmathur,项目名称:ILSpy,代码行数:8,代码来源:AnalyzeContextMenuEntry.cs
示例9: TreeFlattener
public TreeFlattener(SharpTreeNode modelRoot, bool includeRoot)
{
this.root = modelRoot;
while (root.listParent != null)
root = root.listParent;
root.treeFlattener = this;
this.includeRoot = includeRoot;
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:8,代码来源:TreeFlattener.cs
示例10: ImportCore
protected override IMetadataTokenProvider ImportCore(MemberImportingOptions options, SharpTreeNode node)
{
//Checks that the task hasn't been canceled
options.CancellationToken.ThrowIfCancellationRequested();
//Imports and returns
return Session.DestinationModule.Import((TypeReference)Member);
}
开发者ID:95ulisse,项目名称:ILEdit,代码行数:8,代码来源:TypeReferenceInModuleImporter.cs
示例11: Insert
void Insert(int index, SharpTreeNode node)
{
List.Insert(index, node);
node.PropertyChanged += node_PropertyChanged;
if (node.IsExpanded) {
node.Children.CollectionChanged += node_ChildrenChanged;
}
}
开发者ID:lucaslra,项目名称:SPM,代码行数:8,代码来源:TreeFlattener.cs
示例12: GoForward
public SharpTreeNode GoForward(SharpTreeNode oldNode)
{
if (oldNode != null)
back.Add(oldNode);
SharpTreeNode node = forward[forward.Count - 1];
forward.RemoveAt(forward.Count - 1);
return node;
}
开发者ID:richardschneider,项目名称:ILSpy,代码行数:9,代码来源:NavigationHistory.cs
示例13: GoBack
public SharpTreeNode GoBack(SharpTreeNode oldNode)
{
if (oldNode != null)
forward.Add(oldNode);
SharpTreeNode node = back[back.Count - 1];
back.RemoveAt(back.Count - 1);
return node;
}
开发者ID:richardschneider,项目名称:ILSpy,代码行数:9,代码来源:NavigationHistory.cs
示例14: Execute
public void Execute(SharpTreeNode[] selectedNodes)
{
var types = selectedNodes
.OfType<TypeTreeNode>()
.Select(n => HAL.Converter.Type(n.TypeDefinition))
.ToArray();
Services.BrowseInteractions(types, true);
}
开发者ID:nevzatalkan,项目名称:AssemblyVisualizer,代码行数:9,代码来源:BrowseInteractionsContextMenuEntry.cs
示例15: IsVisible
protected override bool IsVisible(SharpTreeNode node)
{
return node is EventTreeNode
|| node is FieldTreeNode
|| node is MethodTreeNode
|| node is PropertyTreeNode
|| node is TypeTreeNode
|| node is AssemblyReferenceTreeNode
|| node is ResourceTreeNode;
}
开发者ID:XQuantumForceX,项目名称:Reflexil,代码行数:10,代码来源:BaseMemberContextMenu.cs
示例16: Execute
public void Execute(SharpTreeNode[] selectedNodes)
{
var assemblyDefinitions = selectedNodes
.OfType<AssemblyTreeNode>()
.Select(n => n.LoadedAssembly.AssemblyDefinition)
.ToList();
var window = WindowManager.AssemblyBrowsers.Single();
window.ViewModel.AddAssemblies(assemblyDefinitions);
}
开发者ID:dalebrubaker,项目名称:ILSpy-Visualizer-Plugin,代码行数:10,代码来源:AddAssemblyContextMenuEntry.cs
示例17: GetDataObject
protected override IDataObject GetDataObject(SharpTreeNode[] nodes)
{
string[] data = nodes
.OfType<XamlOutlineNode>()
.Select(item => item.GetMarkupText())
.ToArray();
var dataObject = new DataObject();
dataObject.SetData(typeof(string[]), data);
return dataObject;
}
开发者ID:ratoy,项目名称:SharpDevelop,代码行数:11,代码来源:XamlOutlineNode.cs
示例18: IsEnabled
public bool IsEnabled(SharpTreeNode[] selectedNodes)
{
foreach (IMemberTreeNode node in selectedNodes) {
if (!(node.Member is FieldDefinition
|| node.Member is MethodDefinition
|| Analyzer.AnalyzedPropertyTreeNode.CanShow(node.Member)
|| Analyzer.AnalyzedEventTreeNode.CanShow(node.Member)))
return false;
}
return true;
}
开发者ID:ThomasZitzler,项目名称:ILSpy,代码行数:11,代码来源:AnalyzeContextMenuEntry.cs
示例19: ActivateItem
internal static bool ActivateItem(SharpTreeNode node, TypeDefinition def)
{
if (def != null) {
var assemblyListNode = node.Ancestors().OfType<AssemblyListTreeNode>().FirstOrDefault();
if (assemblyListNode != null) {
assemblyListNode.Select(assemblyListNode.FindTypeNode(def));
return true;
}
}
return false;
}
开发者ID:95ulisse,项目名称:ILEdit,代码行数:11,代码来源:BaseTypesEntryNode.cs
示例20: Execute
public void Execute(SharpTreeNode[] selectedNodes)
{
var assemblyDefinitions = selectedNodes
.OfType<AssemblyTreeNode>()
.Select(n => n.LoadedAssembly.AssemblyDefinition);
var window = new DependencyBrowserWindow(assemblyDefinitions.Select(HAL.Converter.Assembly))
{
Owner = Services.MainWindow
};
window.Show();
}
开发者ID:nevzatalkan,项目名称:AssemblyVisualizer,代码行数:12,代码来源:BrowseDependenciesContextMenuEntry.cs
注:本文中的ICSharpCode.TreeView.SharpTreeNode类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论