public override void BuildNode(ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
        {
            ProtobuildReference reference = (ProtobuildReference)dataObject;

            nodeInfo.Icon = Context.GetIcon(MonoDevelop.Ide.Gui.Stock.Reference);
            nodeInfo.Label = GLib.Markup.EscapeText (reference.Name);
        }
		public override void BuildNode(ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			ProtobuildPackage package = (ProtobuildPackage) dataObject;

			nodeInfo.Icon = Context.GetIcon(MonoDevelop.Ide.Gui.Stock.Reference);

			if (package.IsBinary)
			{
				var overlay = ImageService.GetIcon ("md-command").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, 8, 8, 8, 8);
					var res = ib.ToVectorImage ();
					ib.Dispose ();
					Context.CacheComposedIcon (nodeInfo.Icon, overlay, res);
					nodeInfo.Icon = res;
				}
			}

			nodeInfo.Label = GettextCatalog.GetString(
				"{0} <span foreground='grey'><span size='small'>({1}@{2})</span></span>", 
				GLib.Markup.EscapeText(package.Folder),
				GLib.Markup.EscapeText(package.Uri),
				GLib.Markup.EscapeText(package.GitRef));
		}
コード例 #3
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			nodeInfo.Label = AddinCatalog.GetString ("Types");
			nodeInfo.Icon = Context.GetIcon ("md-db-tables");
			
			BaseNode node = (BaseNode) dataObject;
		}
コード例 #4
0
		public override void BuildNode (ITreeBuilder builder, object dataObject, NodeInfo nodeInfo)
		{
			nodeInfo.Label = AddinCatalog.GetString ("Database Connections");
			nodeInfo.Icon = Context.GetIcon ("md-db-connection");
			
			this.builder = builder;
		}
コード例 #5
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			var service = (ConnectedServiceNode)dataObject;
			nodeInfo.Label = service.DisplayName;
			nodeInfo.Icon = Context.GetIcon ("md-service");
			nodeInfo.ClosedIcon = Context.GetIcon ("md-service");
		}
コード例 #6
0
		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.StatusSeverity = TaskSeverity.Error;
				nodeInfo.DisabledStyle = true;
				nodeInfo.StatusMessage = pref.ValidationErrorMessage;
			}
		}
コード例 #7
0
ファイル: DPrjRefNode.cs プロジェクト: DinrusGroup/Mono-D
		public override void BuildNode(ITreeBuilder treeBuilder, object dataObject, NodeInfo n)
		{
			var pref = (DProjectReference)dataObject;
			switch (pref.ReferenceType)
			{
				case ReferenceType.Project:
					n.Icon = Context.GetIcon("md-reference-project");
					break;
				case ReferenceType.Package:
					n.Icon = Context.GetIcon("md-reference-folder");
					break;
				/*
			case ReferenceType.Assembly:
				label = Path.GetFileName(pref.Reference);
				icon = Context.GetIcon ("md-reference-folder");
				break;
				default:
				label = pref.Reference;
				icon = Context.GetIcon (Stock.Reference);
				break;*/
			}

			n.Label = GLib.Markup.EscapeText(pref.Name);

			if (!pref.IsValid)
			{
				n.Label = "<span color='red'>" + n.Label + "</span>";
				n.Icon = Context.GetIcon("md-reference-warning");
			}
		}
        public override void BuildNode(ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
        {
			var externalRef = (ProtobuildExternalRef) dataObject;

			nodeInfo.Label = GLib.Markup.EscapeText(externalRef.Name ?? externalRef.Path);
			nodeInfo.Icon = Context.GetIcon(Stock.Reference);
        }
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			nodeInfo.Label = GettextCatalog.GetString ("Addin References");
			//TODO: better icons
			nodeInfo.Icon = Context.GetIcon (Stock.OpenReferenceFolder);
			nodeInfo.ClosedIcon = Context.GetIcon (Stock.ClosedReferenceFolder);
		}
コード例 #10
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			var project = (Project)dataObject;
			
			nodeInfo.Label = project.Name;
			nodeInfo.Icon = Context.GetIcon (project.StockIcon);
		}
        /*public override Type CommandHandlerType
        {
            get { return typeof (ProtobuildProjectFileNodeCommandHandler); }
        }*/

        public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
        {
            base.BuildNode(treeBuilder, dataObject, nodeInfo);

            ProtobuildProjectFile projectFile = (ProtobuildProjectFile)dataObject;

            SolutionConfiguration conf = projectFile.Project.ParentSolution.GetConfiguration(IdeApp.Workspace.ActiveConfiguration);

            var notActive = false;

            if (projectFile.IncludePlatforms != null) {
                if (!projectFile.IncludePlatforms.Contains (conf.Id)) {
                    notActive = true;
                }
            }

            if (projectFile.ExcludePlatforms != null)
            {
                if (projectFile.ExcludePlatforms.Contains(conf.Id))
                {
                    notActive = true;
                }
            }

            if (notActive)
            {
                nodeInfo.DisabledStyle = true;
                nodeInfo.StatusSeverity = TaskSeverity.Information;
                nodeInfo.StatusMessage = GettextCatalog.GetString("File not active for " + conf.Name);
            }
        }
コード例 #12
0
		public override void BuildNode(ITreeBuilder treeBuilder, object dataObject, NodeInfo n)
		{
			n.Label = GettextCatalog.GetString("References");
			n.Icon = Context.GetIcon(Stock.OpenReferenceFolder.Name);
			n.ClosedIcon = Context.GetIcon(Stock.ClosedReferenceFolder.Name);
			//base.BuildNode(treeBuilder, dataObject, nodeInfo);
		}
コード例 #13
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			Translation translation = dataObject as Translation;
			if (translation == null)
				return;
			int idx = translation.IsoCode.IndexOf ('_');
			string language;
			string country;
			if (idx > 0) {
				language = translation.IsoCode.Substring (0, idx);
				country  = translation.IsoCode.Substring (idx + 1);
				
			} else {
				language = translation.IsoCode;
				country  = "";
			}
			
			if (IsoCodes.IsKnownLanguageCode (language)) {
				if (IsoCodes.IsKnownCountryCode (country)) {
					nodeInfo.Label = IsoCodes.LookupLanguageCode (language).Name + "/" + IsoCodes.LookupCountryCode (country).Name + " (" + translation.IsoCode + ")";
				} else {
					nodeInfo.Label = IsoCodes.LookupLanguageCode (language).Name +  " (" + translation.IsoCode + ")";
				}
			} else {
				nodeInfo.Label = "(" + translation.IsoCode + ")";
			}			
			nodeInfo.Icon = Context.GetIcon ("md-po-file");
		}
コード例 #14
0
		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");
			}
		}
コード例 #15
0
 public override void BuildNode(ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
 {
     var node = (DependenciesFolderNode)dataObject;
     nodeInfo.Label = node.GetLabel ();
     nodeInfo.Icon = Context.GetIcon (node.Icon);
     nodeInfo.ClosedIcon = Context.GetIcon (node.ClosedIcon);
 }
コード例 #16
0
/*		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);
				}
			}
		}
コード例 #17
0
		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";
			}
		}
コード例 #18
0
		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);
		}
コード例 #19
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			var compilationUnit = (AssemblyLoader)dataObject;
			
			nodeInfo.Label = Path.GetFileNameWithoutExtension (compilationUnit.FileName);
			nodeInfo.Icon = Context.GetIcon (Stock.Reference);
		}
コード例 #20
0
		public override void BuildNode (ITreeBuilder builder, object dataObject, NodeInfo nodeInfo)
		{
			ViewNode node = dataObject as ViewNode;

			nodeInfo.Label = node.View.Name;
			nodeInfo.Icon = Context.GetIcon ("md-db-view");
		}
コード例 #21
0
		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;
				}
			}
		}
コード例 #22
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			UnknownSolutionItem entry = (UnknownSolutionItem) dataObject;
			
			if (entry.UnloadedEntry) {
				nodeInfo.Icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Project);
				Xwt.Drawing.Image gicon = Context.GetComposedIcon (nodeInfo.Icon, "fade");
				if (gicon == null) {
					gicon = nodeInfo.Icon.WithAlpha (0.5);
					Context.CacheComposedIcon (nodeInfo.Icon, "fade", gicon);
				}
				nodeInfo.Icon = gicon;
				nodeInfo.Label = GettextCatalog.GetString ("<span foreground='grey'>{0} <span size='small'>(Unavailable)</span></span>", GLib.Markup.EscapeText (entry.Name));
			}
			else if (entry.LoadError.Length > 0) {
				nodeInfo.Icon = Context.GetIcon (Gtk.Stock.DialogError);
				nodeInfo.Label = GettextCatalog.GetString ("{0} <span foreground='red' size='small'>(Load failed)</span>", GLib.Markup.EscapeText (entry.Name));
			} else {
				nodeInfo.Icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Project);
				var gicon = Context.GetComposedIcon (nodeInfo.Icon, "fade");
				if (gicon == null) {
					gicon = nodeInfo.Icon.WithAlpha (0.5);
					Context.CacheComposedIcon (nodeInfo.Icon, "fade", gicon);
				}
				nodeInfo.Icon = gicon;
				nodeInfo.Label = GLib.Markup.EscapeText (entry.Name);
			}
		}
コード例 #23
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			UnknownSolutionItem entry = (UnknownSolutionItem) dataObject;
			
			if (entry is UnloadedSolutionItem) {
				nodeInfo.Icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Project);
				Xwt.Drawing.Image gicon = Context.GetComposedIcon (nodeInfo.Icon, "fade");
				if (gicon == null) {
					gicon = nodeInfo.Icon.WithAlpha (0.5);
					Context.CacheComposedIcon (nodeInfo.Icon, "fade", gicon);
				}
				nodeInfo.Icon = gicon;
				nodeInfo.Label = GettextCatalog.GetString ("{0} <span size='small'>(Unavailable)</span>", GLib.Markup.EscapeText (entry.Name));
				nodeInfo.DisabledStyle = true;
			}
			else if (entry.LoadError.Length > 0) {
				nodeInfo.Icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Project).WithAlpha (0.5);
				nodeInfo.Label = entry.Name;
				nodeInfo.StatusSeverity = TaskSeverity.Error;
				nodeInfo.StatusMessage = GettextCatalog.GetString ("Load failed: ") + entry.LoadError;
				nodeInfo.DisabledStyle = true;
			} else {
				nodeInfo.Icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Project);
				var gicon = Context.GetComposedIcon (nodeInfo.Icon, "fade");
				if (gicon == null) {
					gicon = nodeInfo.Icon.WithAlpha (0.5);
					Context.CacheComposedIcon (nodeInfo.Icon, "fade", gicon);
				}
				nodeInfo.Icon = gicon;
				nodeInfo.Label = GLib.Markup.EscapeText (entry.Name);
			}
		}
コード例 #24
0
		public override void BuildNode (ITreeBuilder builder, object dataObject, NodeInfo nodeInfo)
		{
			TableNode node = dataObject as TableNode;

			nodeInfo.Label = node.Table.Name;
			nodeInfo.Icon = Context.GetIcon ("md-db-table");
		}
コード例 #25
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			SolutionFolderFileNode file = (SolutionFolderFileNode) dataObject;
			nodeInfo.Label = file.FileName.FileName;
			if (!System.IO.File.Exists (file.FileName))
				nodeInfo.Label = "<span foreground='" + Styles.ErrorForegroundColor.ToHexString (false) + "'>" + nodeInfo.Label + "</span>";
			nodeInfo.Icon = DesktopService.GetIconForFile (file.FileName, Gtk.IconSize.Menu);
		}
コード例 #26
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			var folder = (WebReferenceFolder) dataObject;
			nodeInfo.Label = folder.IsWCF ? GettextCatalog.GetString ("Web Services") : GettextCatalog.GetString ("Web References");
			nodeInfo.Icon = Context.GetIcon ("md-webreference-folder");
			nodeInfo.ClosedIcon = Context.GetIcon ("md-webreference-folder");
			
		}
        public override void BuildNode(ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
        {
			var filter = (ProtobuildPlatformFilter)dataObject;

			nodeInfo.Label = GLib.Markup.EscapeText(filter.Name);
			nodeInfo.Icon = Context.GetIcon(Stock.OpenFolder);
			nodeInfo.ClosedIcon = Context.GetIcon (Stock.ClosedFolder);
        }
コード例 #28
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			nodeInfo.Label = AddinCatalog.GetString ("Users");
			nodeInfo.Icon = Context.GetIcon ("md-db-users");
			
			BaseNode node = (BaseNode) dataObject;
			RefreshHandler += new EventHandler(OnRefreshEvent);
		}
コード例 #29
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			ParameterSchema parameter = dataObject as ParameterSchema;
			
			nodeInfo.Label = parameter.Name + " (" + parameter.ParameterType.ToString () + ")";
			nodeInfo.Icon = Context.GetIcon ("md-db-column");
			//TODO: icon based on column type
		}
コード例 #30
0
		public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
		{
			ColumnSchema column = dataObject as ColumnSchema;
			
			nodeInfo.Label = column.Name + " (" + column.DataType.Name + ")";
			nodeInfo.Icon = Context.GetIcon ("md-db-column");
			//TODO: icon based on column type
		}
コード例 #31
0
ファイル: NodeBuilder.cs プロジェクト: noah1510/dotdevelop
 public virtual void BuildNode(ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
 {
 }