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


C# ITreeBuilder.AddChildren方法代码示例

本文整理汇总了C#中ITreeBuilder.AddChildren方法的典型用法代码示例。如果您正苦于以下问题:C# ITreeBuilder.AddChildren方法的具体用法?C# ITreeBuilder.AddChildren怎么用?C# ITreeBuilder.AddChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITreeBuilder的用法示例。


在下文中一共展示了ITreeBuilder.AddChildren方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildChildNodes

		/// <summary>Add entries for all the web references in the project to the tree builder.</summary>
		/// <param name="treeBuilder">An ITreeBuilder containing all the data for the current DotNet project.</param>
		/// <param name="dataObject">An object containing the data for the current node in the tree.</param>
		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			var folder = (WebReferenceFolder) dataObject;
			if (folder.IsWCF)
				treeBuilder.AddChildren (WebReferencesService.GetWebReferenceItemsWCF (folder.Project));
			else
				treeBuilder.AddChildren (WebReferencesService.GetWebReferenceItemsWS (folder.Project));
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:11,代码来源:WebReferenceFolderNodeBuilder.cs

示例2: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			Project p = ((WindowsFolder)dataObject).Project;
			GtkDesignInfo info = GtkDesignInfo.FromProject (p);
			if (!info.GuiBuilderProject.HasError) {
				builder.AddChild (new StockIconsNode (p));
				builder.AddChildren (info.GuiBuilderProject.Windows);
				builder.AddChildren (info.GuiBuilderProject.SteticProject.ActionGroups);
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:10,代码来源:WindowsFolderNodeBuilder.cs

示例3: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			string path = GetFolderPath (dataObject);
			
			Project project = builder.GetParentDataItem (typeof(Project), true) as Project;
			if (project == null)
				return;

			ProjectFileCollection files;
			List<string> folders;

			GetFolderContent (project, path, out files, out folders);

			builder.AddChildren (files);
			builder.AddChildren (folders.Select (f => new ProjectFolder (f, project, dataObject)));
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:16,代码来源:FolderNodeBuilder.cs

示例4: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			Namespace ns = (Namespace)dataObject;
			bool publicOnly = ctx.Options ["PublicApiOnly"];
			if (ns.Types != null) 
				ctx.AddChildren (publicOnly ? ns.Types.Where (t => t.IsPublic) : ns.Types);
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:7,代码来源:NamespaceBuilder.cs

示例5: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			SolutionFolder combine = (SolutionFolder) dataObject;
			if (builder.Options ["ShowProjects"]) {
				builder.AddChildren (combine.Items);
			} else {
				AddClasses (builder, combine);
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:9,代码来源:CombineNodeBuilder.cs

示例6: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			ProjectReferenceCollection refs = (ProjectReferenceCollection) dataObject;
			ctx.AddChildren (refs);

			// For portable libraries, add node that represents all framework assemblies
			var project = (DotNetProject) ctx.GetParentDataItem (typeof(DotNetProject), false);
			if (project != null && project.IsPortableLibrary)
				ctx.AddChild (new PortableFrameworkSubset (project));
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:10,代码来源:ProjectReferenceFolderNodeBuilder.cs

示例7: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			var project = ((PortableFrameworkSubset) dataObject).Project;

			if (!project.TargetRuntime.IsInstalled (project.TargetFramework)) {
				string msg = GettextCatalog.GetString ("Framework not installed: {0}", project.TargetFramework.Id);
				treeBuilder.AddChild (new TreeViewItem (msg, Stock.Warning));
			}

			treeBuilder.AddChildren (project.TargetRuntime.AssemblyContext.GetAssemblies (project.TargetFramework)
									 .Where (asm => asm.Package.IsFrameworkPackage && asm.Name != "mscorlib")
									 .Select (asm => new ImplicitFrameworkAssemblyReference (asm)));
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:13,代码来源:PortableFrameworkSubsetNodeBuilder.cs

示例8: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			ProjectReferenceCollection refs = (ProjectReferenceCollection) dataObject;
			ctx.AddChildren (refs);

			// For portable libraries, add node that represents all framework assemblies
			var project = (DotNetProject) ctx.GetParentDataItem (typeof(DotNetProject), false);
			if (project != null) {
				var tfm = project.TargetFramework.Id;
				if (tfm.Identifier == MonoDevelop.Core.Assemblies.TargetFrameworkMoniker.ID_PORTABLE && tfm.Version != "5.0") {
					ctx.AddChild (new PortableFrameworkSubset (project));
				}
			}
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:14,代码来源:ProjectReferenceFolderNodeBuilder.cs

示例9: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			var referenceFolder = (AssemblyReferenceFolder)dataObject;
			var wrapper = (AssemblyLoader)ctx.GetParentDataItem (typeof (AssemblyLoader), false);
			
			foreach (AssemblyNameReference assemblyNameReference in referenceFolder.AssemblyReferences) {
				try {
					string assemblyFile = wrapper.LookupAssembly (assemblyNameReference.FullName);
					if (assemblyFile != null && System.IO.File.Exists (assemblyFile)) {
						ctx.AddChild (assemblyNameReference);
					} else {
						ctx.AddChild (new Error (MonoDevelop.Core.GettextCatalog.GetString ("Can't load:") + assemblyNameReference.FullName));
					}
				} catch (Exception) {
					//	ctx.AddChild (new Error (MonoDevelop.Core.GettextCatalog.GetString ("Error while loading:") + assemblyNameReference.FullName + "/" + e.Message));
				}
			}

			ctx.AddChildren (referenceFolder.ModuleReferences);
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:20,代码来源:AssemblyReferenceFolderNodeBuilder.cs

示例10: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			var extensions = (ExtensionCollection)dataObject;
			treeBuilder.AddChildren (extensions);
		}
开发者ID:Therzok,项目名称:MonoDevelop.AddinMaker,代码行数:5,代码来源:ExtensionFolderNodeBuilder.cs

示例11: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			var type = (IUnresolvedTypeDefinition)dataObject;
			var list = new System.Collections.ArrayList ();
			list.Add (new BaseTypeFolder (type));
			bool publicOnly = Widget.PublicApiOnly;
			foreach (var t in type.NestedTypes.Where (m => !m.IsSynthetic && (m.IsPublic || m.IsProtected || !publicOnly))) {
				list.Add (t);
			}
			foreach (var m in type.Members.Where (m => !m.IsSynthetic && (m.IsPublic || m.IsProtected || !publicOnly)))
				list.Add (m);
			builder.AddChildren (list);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:13,代码来源:DomTypeNodeBuilder.cs

示例12: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			var baseTypeFolder = (BaseTypeFolder)dataObject;
			builder.AddChildren (baseTypeFolder.Type.BaseTypes);
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:5,代码来源:BaseTypeFolderNodeBuilder.cs

示例13: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			SolutionFolder folder = (SolutionFolder) dataObject;
			ctx.AddChildren (folder.Items);
			ctx.AddChildren (folder.Files.Select (file => new SolutionFolderFileNode (file, folder)));
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:6,代码来源:SolutionFolderNodeBuilder.cs

示例14: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			IType type = (IType)dataObject;
			ctx.AddChild (new BaseTypeFolder (type));
			bool publicOnly = ctx.Options ["PublicApiOnly"];
			ctx.AddChildren (type.Members.Where (member => !(member.IsSpecialName && !(member is IMethod && ((IMethod)member).IsConstructor)) && !(publicOnly && !(member.IsPublic || member.IsProtected))));
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:7,代码来源:DomTypeNodeBuilder.cs

示例15: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			var compilationUnit = (AssemblyLoader)dataObject;
			if (compilationUnit.Assembly == null)
				return;
			var references = new AssemblyReferenceFolder (compilationUnit.Assembly);
			if (references.AssemblyReferences.Any () || references.ModuleReferences.Any ())
				treeBuilder.AddChild (references);
			
			var resources = new AssemblyResourceFolder (compilationUnit.Assembly);
			if (resources.Resources.Any ())
				treeBuilder.AddChild (resources);
			
			var namespaces = new Dictionary<string, Namespace> ();
			bool publicOnly = Widget.PublicApiOnly;
			
			foreach (var type in compilationUnit.UnresolvedAssembly.TopLevelTypeDefinitions) {
				string namespaceName = string.IsNullOrEmpty (type.Namespace) ? "-" : type.Namespace;
				if (!namespaces.ContainsKey (namespaceName))
					namespaces [namespaceName] = new Namespace (namespaceName);
				
				var ns = namespaces [namespaceName];
				ns.Types.Add (type);
			}

			treeBuilder.AddChildren (namespaces.Values.Where (ns => !publicOnly || ns.Types.Any (t => t.IsPublic)));
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:27,代码来源:AssemblyNodeBuilder.cs


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