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


C# ITreeBuilder.HasChild方法代码示例

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


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

示例1: BuildChildNodes

        public override void BuildChildNodes(ITreeBuilder builder, object dataObject)
        {
            string path = GetFolderPath (dataObject);
            if (builder.Options ["ShowAllFiles"] && Directory.Exists (path))
            {
                Project project = (Project) builder.GetParentDataItem (typeof(Project), true);

                foreach (string file in Directory.GetFiles (path)) {
                    if (project.ProjectFiles.GetFile (file) == null)
                        builder.AddChild (new SystemFile (file, project));
                }

                foreach (string folder in Directory.GetDirectories (path))
                    if (!builder.HasChild (Path.GetFileName (folder), typeof(ProjectFolder)))
                        builder.AddChild (new ProjectFolder (folder, project));
            }
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:17,代码来源:ShowAllFilesBuilderExtension.cs

示例2: AddProjectContent

		void AddProjectContent (ITreeBuilder builder, Project p)
		{
			foreach (var ns in namesp.ChildNamespaces) {
				if (!builder.HasChild (ns.Name, typeof(NamespaceData)))
					builder.AddChild (new ProjectNamespaceData (project, ns));
			}
			bool nestedNs = builder.Options ["NestedNamespaces"];
			bool publicOnly = builder.Options ["PublicApiOnly"];
			
			foreach (var type in namesp.Types) {
				if (!publicOnly || type.IsPublic)
					builder.AddChild (new ClassData (project, type));
			}
			
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:15,代码来源:NamespaceData.cs

示例3: FillNamespaces

		public static void FillNamespaces (ITreeBuilder builder, Project project, INamespace ns)
		{
			var members = ns.Types;
			//IParserContext ctx = IdeApp.Workspace.ParserDatabase.GetProjectParserContext (project);
			if (members.Any ()) {
				if (builder.Options ["ShowProjects"])
					builder.AddChild (new ProjectNamespaceData (project, ns));
				else {
					if (!builder.HasChild (ns.Name, typeof (NamespaceData)))
						builder.AddChild (new ProjectNamespaceData (null, ns));
				}
			}
			foreach (var nSpace in ns.ChildNamespaces) {
				FillNamespaces (builder, project, nSpace);
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:16,代码来源:ProjectNodeBuilder.cs

示例4: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			if (!builder.Options ["ShowAllFiles"])
				return;

			string path = GetFolderPath (dataObject);
			if (Directory.Exists (path))
			{
				Project project = (Project) builder.GetParentDataItem (typeof(Project), true);
				SolutionFolderFileCollection folderFiles = null;
				if (dataObject is Solution)
					folderFiles = ((Solution)dataObject).RootFolder.Files;
				else if (dataObject is SolutionFolder)
					folderFiles = ((SolutionFolder)dataObject).Files;

				builder.AddChildren (Directory.EnumerateFiles (path)
									 .Where (file => (project == null || project.Files.GetFile (file) == null) && (folderFiles == null || !folderFiles.Contains (file)))
									 .Select (file => new SystemFile (file, project)));

				builder.AddChildren (Directory.EnumerateDirectories (path)
									 .Where (folder => !builder.HasChild (Path.GetFileName (folder), typeof (ProjectFolder)))
									 .Select (folder => new ProjectFolder (folder, project)));
			}
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:24,代码来源:ShowAllFilesBuilderExtension.cs

示例5: FillNamespaces

		public static void FillNamespaces (ITreeBuilder builder, Project project, string ns)
		{
			ProjectDom dom = ProjectDomService.GetProjectDom (project);
			List<IMember> members = dom.GetNamespaceContents (ns, false, false);
			//IParserContext ctx = IdeApp.Workspace.ParserDatabase.GetProjectParserContext (project);
			if (members.Count > 0) {
				if (builder.Options ["ShowProjects"])
					builder.AddChild (new ProjectNamespaceData (project, ns));
				else {
					if (!builder.HasChild (ns, typeof (NamespaceData)))
						builder.AddChild (new ProjectNamespaceData (null, ns));
				}
			}
			foreach (IMember ob in members) {
				if (ob is Namespace) {
					FillNamespaces (builder, project, ns + "." + ((Namespace)ob).Name);
				}
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:19,代码来源:ProjectNodeBuilder.cs

示例6: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			string path = GetFolderPath (dataObject);
			if (builder.Options ["ShowAllFiles"] && Directory.Exists (path))
			{
				Project project = (Project) builder.GetParentDataItem (typeof(Project), true);
				SolutionFolderFileCollection folderFiles = null;
				if (dataObject is Solution)
					folderFiles = ((Solution)dataObject).RootFolder.Files;
				else if (dataObject is SolutionFolder)
					folderFiles = ((SolutionFolder)dataObject).Files;
				
				foreach (string file in Directory.GetFiles (path)) {
					if ((project == null || project.Files.GetFile (file) == null) && (folderFiles == null || !folderFiles.Contains (file)))
						builder.AddChild (new SystemFile (file, project));
				}
				
				foreach (string folder in Directory.GetDirectories (path))
					if (!builder.HasChild (Path.GetFileName (folder), typeof(ProjectFolder)))
						builder.AddChild (new ProjectFolder (folder, project));
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:22,代码来源:ShowAllFilesBuilderExtension.cs

示例7: AddProjectContent

		void AddProjectContent (ITreeBuilder builder, Project p)
		{
			builder.AddChildren (namesp.GetNamespaceMembers ()
								 .Where (ns => !builder.HasChild (ns.Name, typeof (NamespaceData)))
								 .Select (ns => new ProjectNamespaceData (project, ns)));
			//			bool nestedNs = builder.Options ["NestedNamespaces"];
			bool publicOnly = builder.Options ["PublicApiOnly"];

			builder.AddChildren (namesp.GetAllTypes ()
								 .Where (type => !publicOnly || type.DeclaredAccessibility == Accessibility.Public)
								 .Select (type => new ClassData (project, type)));
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:12,代码来源:NamespaceData.cs

示例8: AddProjectContent

        void AddProjectContent(ITreeBuilder builder, Project project, NamespaceData nsData, ArrayList list)
        {
            bool nestedNs = builder.Options ["NestedNamespaces"];
            bool publicOnly = builder.Options ["PublicApiOnly"];

            foreach (object ob in list) {
                if (ob is string && nestedNs) {
                    string ns = nsData.FullName + "." + ob;
                    if (!builder.HasChild (ob as string, typeof(NamespaceData)))
                        builder.AddChild (new NamespaceData (project, ns));
                }
                else if (ob is IClass) {
                    if (!publicOnly || ((IClass)ob).IsPublic)
                        builder.AddChild (new ClassData (project, ob as IClass));
                }
            }
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:17,代码来源:NamespaceNodeBuilder.cs

示例9: FillNamespaces

        public static void FillNamespaces(ITreeBuilder builder, Project project, string ns)
        {
            IParserContext ctx = Runtime.ProjectService.ParserDatabase.GetProjectParserContext (project);
            if (ctx.GetClassList (ns, false, true).Length > 0) {
                if (builder.Options ["ShowProjects"])
                    builder.AddChild (new NamespaceData (project, ns));
                else {
                    if (!builder.HasChild (ns, typeof (NamespaceData)))
                        builder.AddChild (new NamespaceData (null, ns));
                }
            }

            string[] list = ctx.GetNamespaceList (ns, false, true);
            foreach (string subns in list)
                FillNamespaces (builder, project, ns + "." + subns);
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:16,代码来源:ProjectNodeBuilder.cs

示例10: AddProjectContent

		void AddProjectContent (ITreeBuilder builder, List<IMember> list)
		{
			bool nestedNs = builder.Options ["NestedNamespaces"];
			bool publicOnly = builder.Options ["PublicApiOnly"];

			foreach (IMember ob in list) {
				if (ob is Namespace && nestedNs) {
					Namespace nsob = (Namespace)ob;
					string ns = FullName + "." + nsob.Name;
					if (!builder.HasChild (nsob.Name, typeof(NamespaceData)))
						builder.AddChild (new ProjectNamespaceData (project, ns));
				}
				else if (ob is IType) {
					if (!publicOnly || ((IType)ob).IsPublic)
						builder.AddChild (new ClassData (project, ob as IType));
				}
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:18,代码来源:NamespaceData.cs

示例11: AddProjectContent

		void AddProjectContent (ITreeBuilder builder, Project p)
		{
			foreach (var ns in namesp.GetNamespaceMembers ()) {
				if (!builder.HasChild (ns.Name, typeof (NamespaceData)))
					builder.AddChild (new ProjectNamespaceData (project, ns));
			}
			//			bool nestedNs = builder.Options ["NestedNamespaces"];
			bool publicOnly = builder.Options ["PublicApiOnly"];

			foreach (var type in namesp.GetAllTypes ()) {
				if (!publicOnly || type.DeclaredAccessibility == Accessibility.Public)
					builder.AddChild (new ClassData (project, type));
			}
		}
开发者ID:xinfushe,项目名称:monodevelop,代码行数:14,代码来源:NamespaceData.cs


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