本文整理汇总了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));
}
示例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);
}
}
示例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)));
}
示例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);
}
示例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);
}
}
示例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));
}
示例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)));
}
示例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));
}
}
}
示例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);
}
示例10: BuildChildNodes
public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
{
var extensions = (ExtensionCollection)dataObject;
treeBuilder.AddChildren (extensions);
}
示例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);
}
示例12: BuildChildNodes
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
var baseTypeFolder = (BaseTypeFolder)dataObject;
builder.AddChildren (baseTypeFolder.Type.BaseTypes);
}
示例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)));
}
示例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))));
}
示例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)));
}