本文整理汇总了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);
}
}
示例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)));
}
示例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);
}
示例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);
}
示例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));
}
示例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;
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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));
}