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


C# ITreeBuilder.AddChild方法代码示例

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


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

示例1: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			var compilationUnit = (AssemblyLoader)dataObject;
			
			var references = new AssemblyReferenceFolder (compilationUnit.Assembly);
			if (references.AssemblyReferences.Any () || references.ModuleReferences.Any ())
				builder.AddChild (references);
			
			var resources = new AssemblyResourceFolder (compilationUnit.Assembly);
			if (resources.Resources.Any ())
				builder.AddChild (resources);
			
			var namespaces = new Dictionary<string, Namespace> ();
			bool publicOnly = builder.Options ["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);
			}
			
			foreach (var ns in namespaces.Values) {
				builder.AddChild (ns);
			}
		}
开发者ID:head-thrash,项目名称:monodevelop,代码行数:28,代码来源:AssemblyNodeBuilder.cs

示例2: 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

示例3: BuildChildNodes

        public override void BuildChildNodes(ITreeBuilder builder, object dataObject)
        {
            ClassData classData = dataObject as ClassData;
            bool publicOnly = builder.Options ["PublicApiOnly"];

            foreach (IClass innerClass in classData.Class.InnerClasses)
                if (innerClass.IsPublic || !publicOnly)
                    builder.AddChild (innerClass);

            foreach (IMethod method in classData.Class.Methods)
                if (method.IsPublic || !publicOnly)
                    builder.AddChild (method);

            foreach (IProperty property in classData.Class.Properties)
                if (property.IsPublic || !publicOnly)
                    builder.AddChild (property);

            foreach (IField field in classData.Class.Fields)
                if (field.IsPublic || !publicOnly)
                    builder.AddChild (field);

            foreach (IEvent e in classData.Class.Events)
                if (e.IsPublic || !publicOnly)
                    builder.AddChild (e);
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:25,代码来源:ClassNodeBuilder.cs

示例4: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			DomCecilProperty property = (DomCecilProperty)dataObject;
			if (property.HasGet && property.GetMethod != null)
				ctx.AddChild (property.GetMethod);
			if (property.HasSet && property.SetMethod != null)
				ctx.AddChild (property.SetMethod);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:8,代码来源:DomPropertyNodeBuilder.cs

示例5: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			SolutionFolder folder = (SolutionFolder) dataObject;
			foreach (SolutionFolderItem entry in folder.Items)
				ctx.AddChild (entry);
			foreach (FilePath file in folder.Files)
				ctx.AddChild (new SolutionFolderFileNode (file, folder));
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:8,代码来源:SolutionFolderNodeBuilder.cs

示例6: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			HeapBuddyProfilingSnapshot snapshot = (HeapBuddyProfilingSnapshot)dataObject;
			builder.AddChild (new HistoryNode (snapshot));
			builder.AddChild (new TypesNode (snapshot));
			builder.AddChild (new BacktracesNode (snapshot));
			builder.Expanded = true;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:HeapBuddyProfilingSnapshotNodeBuilder.cs

示例7: BuildChildNodes

        public override void BuildChildNodes(ITreeBuilder builder, object dataObject)
        {
            Project project = (Project) dataObject;
            builder.AddChild (project.ProjectReferences);
            builder.AddChild (new ResourceFolder (project));

            base.BuildChildNodes (builder, dataObject);
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:8,代码来源:ProjectNodeBuilder.cs

示例8: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			var project = (DotNetProject) dataObject;
			if (WebReferencesService.GetWebReferenceItemsWS (project).Any ())
				treeBuilder.AddChild (new WebReferenceFolder (project, false));
			if (WebReferencesService.GetWebReferenceItemsWCF (project).Any ())
				treeBuilder.AddChild (new WebReferenceFolder (project, true));
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:ProjectNodeBuilder.cs

示例9: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			var property = (IUnresolvedProperty)dataObject;
			if (property.CanGet)
				ctx.AddChild (property.Getter);
			if (property.CanSet)
				ctx.AddChild (property.Setter);
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:8,代码来源:DomPropertyNodeBuilder.cs

示例10: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			AddinData data = (AddinData) dataObject;
			ProjectFile file = data.Project.GetProjectFile (data.AddinManifestFileName);
			if (file != null)
				builder.AddChild (file);
			builder.AddChild (data.CachedAddinManifest.ExtensionPoints);
			builder.AddChild (data.CachedAddinManifest.MainModule.Extensions);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:9,代码来源:AddinFolderNodeBuilder.cs

示例11: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			IEvent evt = (IEvent)dataObject;
			if (evt.AddMethod != null)
				ctx.AddChild (evt.AddMethod);
			if (evt.RemoveMethod != null)
				ctx.AddChild (evt.RemoveMethod);
			if (evt.RaiseMethod != null)
				ctx.AddChild (evt.RaiseMethod);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:10,代码来源:DomEventNodeBuilder.cs

示例12: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
		{
			var evt = (IUnresolvedEvent)dataObject;
			if (evt.CanAdd)
				ctx.AddChild (evt.AddAccessor);
			if (evt.CanRemove)
				ctx.AddChild (evt.RemoveAccessor);
			if (evt.CanInvoke)
				ctx.AddChild (evt.InvokeAccessor);
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:10,代码来源:DomEventNodeBuilder.cs

示例13: 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)
				foreach (WebReferenceItem item in WebReferencesService.GetWebReferenceItemsWCF (folder.Project))
					treeBuilder.AddChild(item);
			else
				foreach (WebReferenceItem item in WebReferencesService.GetWebReferenceItemsWS (folder.Project))
					treeBuilder.AddChild(item);
		}
开发者ID:powerumc,项目名称:monodevelop_korean,代码行数:13,代码来源:WebReferenceFolderNodeBuilder.cs

示例14: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			Solution sol = (Solution) dataObject;
			SolutionAddinData data = sol.GetAddinData ();
			if (data != null && data.Registry != null) {
				foreach (var ad in data.Registry.GetAddinRoots ())
					treeBuilder.AddChild (ad.Description);
				foreach (var ad in data.Registry.GetAddins ())
					treeBuilder.AddChild (ad.Description);
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:11,代码来源:SolutionNodeBuilder.cs

示例15: BuildChildNodes

        public override void BuildChildNodes(ITreeBuilder ctx, object dataObject)
        {
            ProjectReferenceCollection refs = (ProjectReferenceCollection) dataObject;
            foreach (ProjectReference pref in refs)
                ctx.AddChild (pref);

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


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