本文整理汇总了C#中ITreeBuilder类的典型用法代码示例。如果您正苦于以下问题:C# ITreeBuilder类的具体用法?C# ITreeBuilder怎么用?C# ITreeBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITreeBuilder类属于命名空间,在下文中一共展示了ITreeBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BuildNode
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon)
{
SolutionFolder combine = dataObject as SolutionFolder;
label = GLib.Markup.EscapeText (combine.Name);
icon = Context.GetIcon (Stock.SolutionFolderOpen);
closedIcon = Context.GetIcon (Stock.SolutionFolderClosed);
}
开发者ID:nieve,项目名称:monodevelop,代码行数:7,代码来源:SolutionFolderNodeBuilder.cs
示例2: BuildChildNodes
public override void BuildChildNodes(ITreeBuilder treeBuilder, object dataObject)
{
var node = (DependencyNode)dataObject;
foreach (DependencyNode childNode in node.GetDependencies ()) {
treeBuilder.AddChild (childNode);
}
}
开发者ID:lordfinal,项目名称:monodevelop-dnx-addin,代码行数:7,代码来源:DependencyNodeBuilder.cs
示例3: BuildNode
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon)
{
ProjectReference pref = (ProjectReference) dataObject;
switch (pref.ReferenceType) {
case ReferenceType.Project:
label = pref.Reference;
icon = Context.GetIcon ("md-reference-project");
break;
case ReferenceType.Assembly:
label = Path.GetFileName(pref.Reference);
icon = Context.GetIcon ("md-reference-folder");
break;
case ReferenceType.Package:
label = pref.Reference.Split(',')[0];
icon = Context.GetIcon ("md-reference-package");
break;
default:
label = pref.Reference;
icon = Context.GetIcon (Stock.Reference);
break;
}
label = GLib.Markup.EscapeText (label);
if (!pref.IsValid) {
label = "<span color='red'>" + label + "</span>";
icon = Context.GetIcon ("md-reference-warning");
}
}
开发者ID:hippiehunter,项目名称:monodevelop,代码行数:30,代码来源:ProjectReferenceNodeBuilder.cs
示例4: BuildNode
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon)
{
var compilationUnit = (AssemblyLoader)dataObject;
label = Path.GetFileNameWithoutExtension (compilationUnit.FileName);
icon = Context.GetIcon (Stock.Reference);
}
开发者ID:head-thrash,项目名称:monodevelop,代码行数:7,代码来源:AssemblyNodeBuilder.cs
示例5: BuildNode
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon)
{
UnknownSolutionItem entry = (UnknownSolutionItem) dataObject;
if (entry.UnloadedEntry) {
icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Project);
Gdk.Pixbuf gicon = Context.GetComposedIcon (icon, "fade");
if (gicon == null) {
gicon = ImageService.MakeTransparent (icon, 0.5);
Context.CacheComposedIcon (icon, "fade", gicon);
}
icon = gicon;
label = GettextCatalog.GetString ("<span foreground='grey'>{0} <span size='small'>(Unavailable)</span></span>", GLib.Markup.EscapeText (entry.Name));
}
else if (entry.LoadError.Length > 0) {
icon = Context.GetIcon (Gtk.Stock.DialogError);
label = GettextCatalog.GetString ("{0} <span foreground='red' size='small'>(Load failed)</span>", GLib.Markup.EscapeText (entry.Name));
} else {
icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Project);
Gdk.Pixbuf gicon = Context.GetComposedIcon (icon, "fade");
if (gicon == null) {
gicon = ImageService.MakeTransparent (icon, 0.5);
Context.CacheComposedIcon (icon, "fade", gicon);
}
icon = gicon;
label = GLib.Markup.EscapeText (entry.Name);
}
}
开发者ID:fedorw,项目名称:monodevelop,代码行数:28,代码来源:UnknownEntryNodeBuilder.cs
示例6: BuildNode
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
//modules do no have names/IDs, but genrally the only reason they exist
//is because they have additional, optional dependencies
//so find the dependencies that are not referenced in other modules
//and use one as the label
var module = (ModuleDescription)dataObject;
var deps = new HashSet<string> ();
foreach (Dependency dep in module.Dependencies) {
deps.Add (dep.Name);
}
foreach (ModuleDescription other in module.ParentAddinDescription.AllModules) {
if (other == module) {
continue;
}
foreach (Dependency dep in other.Dependencies) {
deps.Remove (dep.Name);
}
}
if (deps.Count > 0) {
nodeInfo.Label = deps.First ().Split (new[] { ' '})[0];
} else {
nodeInfo.Label = "Module";
}
}
开发者ID:Therzok,项目名称:MonoDevelop.AddinMaker,代码行数:27,代码来源:ModuleNodeBuilder.cs
示例7: BuildChildNodes
public override void BuildChildNodes(ITreeBuilder treeBuilder, object dataObject)
{
var node = (DependenciesFolderNode)dataObject;
foreach (FrameworkNode frameworkFolderNode in node.GetFrameworkFolderNodes ()) {
treeBuilder.AddChild (frameworkFolderNode);
}
}
开发者ID:twing207,项目名称:monodevelop-dnx-addin,代码行数:7,代码来源:DependenciesFolderNodeBuilder.cs
示例8: GetNameWithGenericParameters
/*
private string GetNameWithGenericParameters (IType c)
{
if (c.TypeParameters != null && c.TypeParameters.Count > 0)
{
StringBuilder builder = new StringBuilder (c.Name);
builder.Append("<");
for (int i = 0; i < c.TypeParameters.Count; i++)
{
builder.Append(c.TypeParameters[i].Name);
if (i + 1 < c.TypeParameters.Count) builder.Append(", ");
}
builder.Append(">");
return builder.ToString();
}
else
return c.Name;
}*/
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
ClassData classData = dataObject as ClassData;
bool publicOnly = builder.Options ["PublicApiOnly"];
bool publicProtectedOnly = builder.Options ["PublicProtectedApiOnly"];
publicOnly |= publicProtectedOnly;
// Delegates have an Invoke method, which doesn't need to be shown.
if (classData.Class.ClassType == ClassType.Delegate)
return;
foreach (IType innerClass in classData.Class.InnerTypes)
if (innerClass.IsPublic || (innerClass.IsProtected && publicProtectedOnly) || !publicOnly)
builder.AddChild (new ClassData (classData.Project, innerClass));
foreach (IMethod method in classData.Class.Methods)
if (method.IsPublic || (method.IsProtected && publicProtectedOnly) || !publicOnly)
builder.AddChild (method);
foreach (IProperty property in classData.Class.Properties)
if (property.IsPublic || (property.IsProtected && publicProtectedOnly) || !publicOnly)
builder.AddChild (property);
foreach (IField field in classData.Class.Fields)
if (field.IsPublic || (field.IsProtected && publicProtectedOnly) || !publicOnly)
builder.AddChild (field);
foreach (IEvent e in classData.Class.Events)
if (e.IsPublic || (e.IsProtected && publicProtectedOnly) || !publicOnly)
builder.AddChild (e);
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:50,代码来源:ClassNodeBuilder.cs
示例9: BuildNode
/// <summary>Build the node in the project tree.</summary>
/// <param name="treeBuilder">An ITreeBuilder containing the project tree builder.</param>
/// <param name="dataObject">An object containing the current builder child.</param>
/// <param name="label">A string containing the label of the node.</param>
/// <param name="icon">A Pixbif containing the icon for the node.</param>
/// <param name="closedIcon">A Pixbif containing the closed icon for the node.</param>
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon)
{
label = GettextCatalog.GetString ("Web References");
icon = Context.GetIcon (Stock.OpenReferenceFolder);
closedIcon = Context.GetIcon (Stock.ClosedReferenceFolder);
}
开发者ID:llucenic,项目名称:monodevelop,代码行数:13,代码来源:WebReferenceFolderNodeBuilder.cs
示例10: BuildChildNodes
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
// TODO: Type system conversion.
/* ProjectReference pref = (ProjectReference) dataObject;
Dictionary<string, bool> namespaces = new Dictionary<string, bool> ();
bool nestedNs = builder.Options ["NestedNamespaces"];
foreach (string fileName in pref.GetReferencedFileNames (IdeApp.Workspace.ActiveConfiguration)) {
var unit = new CecilLoader ().LoadAssemblyFile (fileName);
if (unit == null)
continue;
foreach (var type in unit.GetTypes ()) {
if (type.IsSynthetic)
continue;
if (String.IsNullOrEmpty (type.Namespace)) {
builder.AddChild (new ClassData (unit, null, type));
continue;
}
string ns = type.Namespace;
if (nestedNs) {
int idx = ns.IndexOf ('.');
if (idx >= 0)
ns = ns.Substring (0, idx);
}
if (namespaces.ContainsKey (ns))
continue;
namespaces[ns] = true;
builder.AddChild (new CompilationUnitNamespaceData (null, ns));
}
}*/
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:30,代码来源:ReferenceNodeBuilder.cs
示例11: BuildNode
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
ProjectFile file = (ProjectFile) dataObject;
nodeInfo.Label = GLib.Markup.EscapeText (file.Link.IsNullOrEmpty ? file.FilePath.FileName : file.Link.FileName);
if (!File.Exists (file.FilePath)) {
nodeInfo.Label = "<span foreground='red'>" + nodeInfo.Label + "</span>";
}
nodeInfo.Icon = DesktopService.GetIconForFile (file.FilePath, Gtk.IconSize.Menu);
if (file.IsLink && nodeInfo.Icon != null) {
var overlay = ImageService.GetIcon ("md-link-overlay").WithSize (Xwt.IconSize.Small);
var cached = Context.GetComposedIcon (nodeInfo.Icon, overlay);
if (cached != null)
nodeInfo.Icon = cached;
else {
var ib = new Xwt.Drawing.ImageBuilder (nodeInfo.Icon.Width, nodeInfo.Icon.Height);
ib.Context.DrawImage (nodeInfo.Icon, 0, 0);
ib.Context.DrawImage (overlay, 0, 0);
var res = ib.ToVectorImage ();
ib.Dispose ();
Context.CacheComposedIcon (nodeInfo.Icon, overlay, res);
nodeInfo.Icon = res;
}
}
}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:27,代码来源:ProjectFileNodeBuilder.cs
示例12: BuildNode
public override void BuildNode(ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon)
{
ViewSchema schema = (ViewSchema) dataObject;
label = schema.Name;
string iconName = "md-mono-query-table";
icon = Context.GetIcon (iconName);
}
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:7,代码来源:ViewNodeBuilder.cs
示例13: BuildNode
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
ProjectReference pref = (ProjectReference) dataObject;
switch (pref.ReferenceType) {
case ReferenceType.Project:
nodeInfo.Label = pref.Reference;
nodeInfo.Icon = Context.GetIcon ("md-reference-project");
break;
case ReferenceType.Assembly:
nodeInfo.Label = Path.GetFileName(pref.Reference);
nodeInfo.Icon = Context.GetIcon ("md-reference-folder");
break;
case ReferenceType.Package:
nodeInfo.Label = pref.Reference.Split(',')[0];
nodeInfo.Icon = Context.GetIcon ("md-reference-package");
break;
default:
nodeInfo.Label = pref.Reference;
nodeInfo.Icon = Context.GetIcon (Stock.Reference);
break;
}
nodeInfo.Label = GLib.Markup.EscapeText (nodeInfo.Label);
if (!pref.IsValid) {
nodeInfo.Label = "<span color='red'>" + nodeInfo.Label + "</span>";
nodeInfo.Icon = Context.GetIcon ("md-reference-warning");
}
}
开发者ID:alexrp,项目名称:monodevelop,代码行数:30,代码来源:ProjectReferenceNodeBuilder.cs
示例14: BuildNode
public override void BuildNode (ITreeBuilder builder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon)
{
ViewNode node = dataObject as ViewNode;
label = node.View.Name;
icon = Context.GetIcon ("md-db-view");
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:7,代码来源:ViewNodeBuilder.cs
示例15: BuildNode
/* public override void GetNodeAttributes (ITreeNavigator parentNode, object dataObject, ref NodeAttributes attributes)
{
attributes |= NodeAttributes.UseMarkup;
}
*/
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
UnitTest test = dataObject as UnitTest;
nodeInfo.Icon = test.StatusIcon;
var title = RemoveGenericArgument (test.Title);
title = test.Title;
if (test.Status == TestStatus.Running) {
nodeInfo.Label = Ambience.EscapeText (title);
return;
} else if (test.Status == TestStatus.Loading) {
nodeInfo.Label = Ambience.EscapeText (title) + GettextCatalog.GetString (" (Loading)");
return;
} else if (test.Status == TestStatus.LoadError) {
nodeInfo.Label = Ambience.EscapeText (title) + GettextCatalog.GetString (" (Load failed)");
return;
} else {
nodeInfo.Label = Ambience.EscapeText (title);
UnitTestResult res = test.GetLastResult ();
if (res != null && treeBuilder.Options ["ShowTestCounters"] && (test is UnitTestGroup)) {
nodeInfo.Label += string.Format (GettextCatalog.GetString (" ({0} passed, {1} failed, {2} not run)"), res.Passed, res.ErrorsAndFailures, res.TestsNotRun);
}
if (treeBuilder.Options ["ShowTestTime"]) {
nodeInfo.Label += string.Format (" Time: {0}ms", res.Time.TotalMilliseconds);
}
}
}
开发者ID:powerumc,项目名称:monodevelop_korean,代码行数:34,代码来源:TestNodeBuilder.cs
示例16: BuildNode
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
SolutionFolder folder = dataObject as SolutionFolder;
nodeInfo.Label = folder.Name;
nodeInfo.Icon = Context.GetIcon (Stock.SolutionFolderOpen);
nodeInfo.ClosedIcon = Context.GetIcon (Stock.SolutionFolderClosed);
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:7,代码来源:CombineNodeBuilder.cs
示例17: BuildChildNodes
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
var config = (NUnitAssemblyGroupProjectConfiguration) dataObject;
foreach (TestAssembly ta in config.Assemblies)
builder.AddChild (ta);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:NUnitAssemblyGroupConfigurationNodeBuilder.cs
示例18: BuildNode
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon)
{
label = AddinCatalog.GetString ("Types");
icon = Context.GetIcon ("md-db-tables");
BaseNode node = (BaseNode) dataObject;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:7,代码来源:TypesNodeBuilder.cs
示例19: BuildChildNodes
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
PackagingProject project = dataObject as PackagingProject;
foreach (Package p in project.Packages)
builder.AddChild (p);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:PackagingProjectNodeBuilder.cs
示例20: BuildNode
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref string label, ref Pixbuf icon, ref Pixbuf closedIcon)
{
ExtensionNodeInfo ninfo = (ExtensionNodeInfo) dataObject;
ExtensionNodeDescription node = ninfo.Node;
label = GLib.Markup.EscapeText (node.NodeName);
StringBuilder desc = new StringBuilder ();
foreach (NodeAttribute at in node.Attributes) {
if (desc.Length > 0)
desc.Append (" ");
desc.Append (at.Name).Append ("=\"").Append (GLib.Markup.EscapeText (at.Value)).Append ('"');
}
if (desc.Length > 0)
label += "(<i>" + desc + "</i>)";
icon = Context.GetIcon ("md-extension-node");
if (treeBuilder.Options ["ShowExistingNodes"] && !ninfo.CanModify) {
Gdk.Pixbuf gicon = Context.GetComposedIcon (icon, "fade");
if (gicon == null) {
gicon = ImageService.MakeTransparent (icon, 0.5);
Context.CacheComposedIcon (icon, "fade", gicon);
}
icon = gicon;
}
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:26,代码来源:ExtensionNodeNodeBuilder.cs
注:本文中的ITreeBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论