本文整理汇总了C#中ICSharpCode.TreeView.SharpTreeNode.OfType方法的典型用法代码示例。如果您正苦于以下问题:C# SharpTreeNode.OfType方法的具体用法?C# SharpTreeNode.OfType怎么用?C# SharpTreeNode.OfType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.TreeView.SharpTreeNode
的用法示例。
在下文中一共展示了SharpTreeNode.OfType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(SharpTreeNode[] selectedNodes)
{
var types = selectedNodes
.OfType<TypeTreeNode>()
.Select(n => HAL.Converter.Type(n.TypeDefinition))
.ToArray();
Services.BrowseInteractions(types, true);
}
示例2: 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);
}
示例3: 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;
}
示例4: Execute
public void Execute(SharpTreeNode[] selectedNodes)
{
var typeDefinition = selectedNodes
.OfType<TypeTreeNode>()
.Single().TypeDefinition;
var window = new AncestryBrowserWindow(typeDefinition)
{
Owner = MainWindow.Instance
};
window.Show();
}
示例5: 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();
}
示例6: Execute
public void Execute(SharpTreeNode[] selectedNodes)
{
var types = selectedNodes
.OfType<TypeTreeNode>()
.Select(n => HAL.Converter.Type(n.TypeDefinition))
.ToArray();
var window = new InteractionBrowserWindow(types, true)
{
Owner = MainWindow.Instance
};
window.Show();
}
示例7: Execute
public void Execute(SharpTreeNode[] selectedNodes)
{
var assemblyDefinitions = selectedNodes
.OfType<AssemblyTreeNode>()
.Select(n => n.LoadedAssembly.AssemblyDefinition)
.ToList();
var window = new AssemblyBrowserWindow(assemblyDefinitions)
{
Owner = MainWindow.Instance
};
window.Show();
}
示例8: Execute
public void Execute(SharpTreeNode[] selectedNodes)
{
var typeDefinition = selectedNodes
.OfType<TypeTreeNode>()
.Single().TypeDefinition;
var type = HAL.Converter.Type(typeDefinition);
var assembly = type.Module.Assembly;
var window = new AssemblyBrowserWindow(new [] { assembly }, type)
{
Owner = MainWindow.Instance
};
window.Show();
}
示例9: CanDelete
// public override void Drop(IDataObject data, int index, DropEffect finalEffect)
// {
// try {
// string insertText = (data.GetData(typeof(string[])) as string[])
// .Aggregate((text, part) => text += part);
// ITextAnchor marker;
// int length = 0;
// if (index == this.Children.Count) {
// if (index == 0)
// marker = null;
// else
// marker = (this.Children[index - 1] as XamlOutlineNode).EndMarker;
// if (marker == null) {
// marker = this.EndMarker;
// length = -1; // move backwards
// } else {
// length = 2 + (this.Children[index - 1] as XamlOutlineNode).elementName.Length;
// }
// } else
// marker = (this.Children[index] as XamlOutlineNode).Marker;
//
// int offset = marker.Offset + length;
// Editor.Document.Insert(offset, insertText);
// } catch (Exception ex) {
// throw ex;
// }
// }
public override bool CanDelete(SharpTreeNode[] nodes)
{
return nodes.OfType<XamlOutlineNode>().All(n => n.Parent != null);
}
示例10: DeleteCore
public override void DeleteCore(SharpTreeNode[] nodes)
{
foreach (XamlOutlineNode node in nodes.OfType<XamlOutlineNode>()) {
node.Editor.Document.Remove(node.Marker.Offset, node.EndMarker.Offset - node.Marker.Offset);
}
}
示例11: Copy
public override IDataObject Copy(SharpTreeNode[] nodes)
{
return treeNodeImpl.Data.Copy(nodes.OfType<DnSpySharpTreeNode>().Select(a => a.TreeNodeImpl.Data).ToArray());
}
示例12: Copy
public override IDataObject Copy(SharpTreeNode[] nodes) {
DataObject dataObject = new DataObject();
var listNode = GetNode<DnSpyFileListTreeNode>(this);
if (listNode == null)
return dataObject;
var dict = new Dictionary<AssemblyTreeNode, int>();
for (int i = 0; i < listNode.Children.Count; i++)
dict.Add((AssemblyTreeNode)listNode.Children[i], i);
var data = nodes.OfType<AssemblyTreeNode>().Where(f => dict.ContainsKey(f)).Select(f => dict[f]).ToArray();
if (data.Length != 0)
dataObject.SetData(DataFormat, data);
return dataObject;
}
示例13: IsVisible
public bool IsVisible(SharpTreeNode[] selectedNodes)
{
return selectedNodes.OfType<AssemblyTreeNode>().Count() > 0;
}
示例14: StartDrag
public override void StartDrag(DependencyObject dragSource, SharpTreeNode[] nodes)
{
treeNodeImpl.Data.StartDrag(dragSource, nodes.OfType<DnSpySharpTreeNode>().Select(a => a.TreeNodeImpl.Data).ToArray());
}
示例15: DeleteWithoutConfirmation
public override void DeleteWithoutConfirmation(SharpTreeNode[] nodes)
{
foreach (XamlOutlineNode xamlNode in nodes.OfType<XamlOutlineNode>()) {
xamlNode.DeleteCore();
}
}