当前位置: 首页>>代码示例>>C#>>正文


C# SharpTreeNode.OfType方法代码示例

本文整理汇总了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);
        }
开发者ID:nevzatalkan,项目名称:AssemblyVisualizer,代码行数:9,代码来源:BrowseInteractionsContextMenuEntry.cs

示例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);
        }
开发者ID:dalebrubaker,项目名称:ILSpy-Visualizer-Plugin,代码行数:10,代码来源:AddAssemblyContextMenuEntry.cs

示例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;
		}
开发者ID:ratoy,项目名称:SharpDevelop,代码行数:11,代码来源:XamlOutlineNode.cs

示例4: Execute

        public void Execute(SharpTreeNode[] selectedNodes)
        {
            var typeDefinition = selectedNodes
                .OfType<TypeTreeNode>()
                .Single().TypeDefinition;

            var window = new AncestryBrowserWindow(typeDefinition)
                         	{
                         		Owner = MainWindow.Instance
                         	};
            window.Show();
        }
开发者ID:dalebrubaker,项目名称:ILSpy-Visualizer-Plugin,代码行数:12,代码来源:BrowseAncestryContextMenuEntry.cs

示例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();
        }
开发者ID:nevzatalkan,项目名称:AssemblyVisualizer,代码行数:12,代码来源:BrowseDependenciesContextMenuEntry.cs

示例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();
        }
开发者ID:saeidmh83,项目名称:AssemblyVisualizer,代码行数:13,代码来源:BrowseInteractionsContextMenuEntry.cs

示例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();
        }
开发者ID:dalebrubaker,项目名称:ILSpy-Visualizer-Plugin,代码行数:13,代码来源:BrowseAssemblyContextMenuEntry.cs

示例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();
        }
开发者ID:nevzatalkan,项目名称:AssemblyVisualizer,代码行数:14,代码来源:VisualizeDescendantsContextMenuEntry.cs

示例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);
		}
开发者ID:ratoy,项目名称:SharpDevelop,代码行数:32,代码来源:XamlOutlineNode.cs

示例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);
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:6,代码来源:XamlOutlineNode.cs

示例11: Copy

 public override IDataObject Copy(SharpTreeNode[] nodes)
 {
     return treeNodeImpl.Data.Copy(nodes.OfType<DnSpySharpTreeNode>().Select(a => a.TreeNodeImpl.Data).ToArray());
 }
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:4,代码来源:DnSpySharpTreeNode.cs

示例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;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:13,代码来源:AssemblyTreeNode.cs

示例13: IsVisible

 public bool IsVisible(SharpTreeNode[] selectedNodes)
 {
     return selectedNodes.OfType<AssemblyTreeNode>().Count() > 0;
 }
开发者ID:nevzatalkan,项目名称:AssemblyVisualizer,代码行数:4,代码来源:BrowseDependenciesContextMenuEntry.cs

示例14: StartDrag

 public override void StartDrag(DependencyObject dragSource, SharpTreeNode[] nodes)
 {
     treeNodeImpl.Data.StartDrag(dragSource, nodes.OfType<DnSpySharpTreeNode>().Select(a => a.TreeNodeImpl.Data).ToArray());
 }
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:4,代码来源:DnSpySharpTreeNode.cs

示例15: DeleteWithoutConfirmation

		public override void DeleteWithoutConfirmation(SharpTreeNode[] nodes)
		{
			foreach (XamlOutlineNode xamlNode in nodes.OfType<XamlOutlineNode>()) {
				xamlNode.DeleteCore();
			}
		}
开发者ID:ratoy,项目名称:SharpDevelop,代码行数:6,代码来源:XamlOutlineNode.cs


注:本文中的ICSharpCode.TreeView.SharpTreeNode.OfType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。