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


C# ITreeBuilder.GetParentDataItem方法代码示例

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


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

示例1: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			var serviceFolder = GetServiceStateFolder (treeBuilder, dataObject);
			if (!string.IsNullOrEmpty (serviceFolder)) {
				var project = (Project)treeBuilder.GetParentDataItem (typeof (Project), true);
				foreach (var file in Directory.GetFiles (serviceFolder)) {
					treeBuilder.AddChild (new Ide.Gui.Pads.ProjectPad.SystemFile (file, project));
				}
			}
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:10,代码来源:ConnectedServiceNodeBuilder.cs

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

示例3: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
			
			if (p == null) return;
			
			ProjectInformation info = ProjectInformationManager.Instance.Get (p);
			
			foreach (Macro m in info.Macros)
				treeBuilder.AddChild (m);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:11,代码来源:MacroDefinitionsNodeBuilder.cs

示例4: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			base.BuildChildNodes (treeBuilder, dataObject);
			DotNetProject p = (DotNetProject) treeBuilder.GetParentDataItem (typeof(DotNetProject), false);
			if (p != null) {
				AddinData data = AddinData.GetAddinData (p);
				if (data != null) {
					foreach (Dependency adep in data.CachedAddinManifest.MainModule.Dependencies)
						treeBuilder.AddChild (adep);
				}
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:12,代码来源:ReferencesFolderNodeBuilder.cs

示例5: HasChildNodes

		public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
		{
			if (base.HasChildNodes (builder, dataObject))
				return true;
			DotNetProject p = (DotNetProject) builder.GetParentDataItem (typeof(DotNetProject), false);
			if (p != null) {
				AddinData data = AddinData.GetAddinData (p);
				if (data != null)
					return data.CachedAddinManifest.MainModule.Dependencies.Count > 0;
			}
			return false;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:12,代码来源:ReferencesFolderNodeBuilder.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) {
				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

示例7: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
			
			if (p == null) return;
			
			ProjectInformation info = ProjectInformationManager.Instance.Get (p);
			
			Enumeration thisEnumeration = (Enumeration)dataObject;
			
			// Enumerators
			foreach (Enumerator e in info.Enumerators)
				if (e.Parent != null && e.Parent.Equals (thisEnumeration))
					treeBuilder.AddChild (e);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:15,代码来源:EnumerationNodeBuilder.cs

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

示例9: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
			
			if (p == null) return;
			
			bool publicOnly = treeBuilder.Options["PublicApiOnly"];
			ProjectInformation info = ProjectInformationManager.Instance.Get (p);
			
			Structure thisStruct = (Structure)dataObject;
			
			// Classes
			foreach (Class c in info.Classes)
				if (c.Parent != null && c.Parent.Equals (thisStruct) && (!publicOnly || c.Access == AccessModifier.Public))
					treeBuilder.AddChild (c);
			
			// Structures
			foreach (Structure s in info.Structures)
				if (s.Parent != null && s.Parent.Equals (thisStruct) && (!publicOnly || s.Access == AccessModifier.Public))
					treeBuilder.AddChild (s);
			
			// Unions
			foreach (Union u in info.Unions)
				if (u.Parent != null && u.Parent.Equals (thisStruct) && (!publicOnly || u.Access == AccessModifier.Public))
					treeBuilder.AddChild (u);
			
			// Enumerations
			foreach (Enumeration e in info.Enumerations)
				if (e.Parent != null && e.Parent.Equals (thisStruct) && (!publicOnly || e.Access == AccessModifier.Public))
					treeBuilder.AddChild (e);
			
			// Typedefs
			foreach (Typedef t in info.Typedefs)
				if (t.Parent != null && t.Parent.Equals (thisStruct) && (!publicOnly || t.Access == AccessModifier.Public))
					treeBuilder.AddChild (t);
			
			// Functions
			foreach (Function f in info.Functions)
				if (f.Parent != null && f.Parent.Equals (thisStruct) && (!publicOnly || f.Access == AccessModifier.Public))
					treeBuilder.AddChild (f);
			
			// Members
			foreach (Member m in info.Members)
				if (m.Parent != null && m.Parent.Equals (thisStruct) && (!publicOnly || m.Access == AccessModifier.Public))
					treeBuilder.AddChild (m);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:46,代码来源:StructureNodeBuilder.cs

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

示例11: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
			
			if (p == null) return;
			
			ProjectInformation info = ProjectInformationManager.Instance.Get (p);
			
			Namespace thisNamespace = ((Namespace)dataObject);
			
			// Namespaces
			if (treeBuilder.Options["NestedNamespaces"])
				foreach (Namespace n in info.Namespaces)
					if (n.Parent != null && n.Parent.Equals (thisNamespace))
						treeBuilder.AddChild (n);
			
			// Classes
			foreach (Class c in info.Classes)
				if (c.Parent != null && c.Parent.Equals (thisNamespace))
					treeBuilder.AddChild (c);
			
			// Structures
			foreach (Structure s in info.Structures)
				if (s.Parent != null && s.Parent.Equals (thisNamespace))
					treeBuilder.AddChild (s);
			
			// Unions
			foreach (Union u in info.Unions)
				if (u.Parent != null && u.Parent.Equals (thisNamespace))
					treeBuilder.AddChild (u);
			
			// Enumerations
			foreach (Enumeration e in info.Enumerations)
				if (e.Parent != null && e.Parent.Equals (thisNamespace))
					treeBuilder.AddChild (e);
			
			// Typedefs
			foreach (Typedef t in info.Typedefs)
				if (t.Parent != null && t.Parent.Equals (thisNamespace))
					treeBuilder.AddChild (t);
			
			// Functions
			foreach (Function f in info.Functions)
				if (f.Parent != null && f.Parent.Equals (thisNamespace))
					treeBuilder.AddChild (f);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:46,代码来源:NamespaceNodeBuilder.cs

示例12: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
			
			if (p == null) return;
			
			ProjectInformation info = ProjectInformationManager.Instance.Get (p);
			
			Union thisUnion = (Union)dataObject;
			
			// Classes
			foreach (Class c in info.Classes)
				if (c.Parent != null && c.Parent.Equals (thisUnion))
					treeBuilder.AddChild (c);
			
			// Structures
			foreach (Structure s in info.Structures)
				if (s.Parent != null && s.Parent.Equals (thisUnion))
					treeBuilder.AddChild (s);
			
			// Unions
			foreach (Union u in info.Unions)
				if (u.Parent != null && u.Parent.Equals (thisUnion))
					treeBuilder.AddChild (u);
			
			// Enumerations
			foreach (Enumeration e in info.Enumerations)
				if (e.Parent != null && e.Parent.Equals (thisUnion))
					treeBuilder.AddChild (e);
			
			// Typedefs
			foreach (Typedef t in info.Typedefs)
				if (t.Parent != null && t.Parent.Equals (thisUnion))
					treeBuilder.AddChild (t);
			
			// Functions
			foreach (Function f in info.Functions)
				if (f.Parent != null && f.Parent.Equals (thisUnion))
					treeBuilder.AddChild (f);
			
			// Members
			foreach (Member m in info.Members)
				if (m.Parent != null && m.Parent.Equals (thisUnion))
					treeBuilder.AddChild (m);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:45,代码来源:UnionNodeBuilder.cs

示例13: 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;
			ArrayList folders;
			GetFolderContent (project, path, out files, out folders);
			
			foreach (ProjectFile file in files)
				builder.AddChild (file);
			
			foreach (string folder in folders)
				builder.AddChild (new ProjectFolder (folder, project, dataObject));
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:18,代码来源:FolderNodeBuilder.cs

示例14: BuildChildNodes

		public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
			
			if (p == null) return;
			
			ProjectInformation info = ProjectInformationManager.Instance.Get (p);
			
			// Classes
			foreach (Class c in info.Classes)
				if (c.Parent == null)
					treeBuilder.AddChild (c);
			
			// Structures
			foreach (Structure s in info.Structures)
				if (s.Parent == null)
					treeBuilder.AddChild (s);
			
			// Unions
			foreach (Union u in info.Unions)
				if (u.Parent == null)
					treeBuilder.AddChild (u);
			
			// Enumerations
			foreach (Enumeration e in info.Enumerations)
				if (e.Parent == null)
					treeBuilder.AddChild (e);
			
			// Typedefs
			foreach (Typedef t in info.Typedefs)
				if (t.Parent == null)
					treeBuilder.AddChild (t);
			
			// Functions
			foreach (Function f in info.Functions)
				if (f.Parent == null)
					treeBuilder.AddChild (f);
			
			// Variables
			foreach (Variable v in info.Variables)
				treeBuilder.AddChild (v);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:42,代码来源:GlobalsNodeBuilder.cs

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


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