• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Ide.AlertButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MonoDevelop.Ide.AlertButton的典型用法代码示例。如果您正苦于以下问题:C# AlertButton类的具体用法?C# AlertButton怎么用?C# AlertButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AlertButton类属于MonoDevelop.Ide命名空间,在下文中一共展示了AlertButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: NewWebReference

		public void NewWebReference()
		{
			// Get the project and project folder
			DotNetProject project = CurrentNode.GetParentDataItem (typeof(DotNetProject), true) as DotNetProject;
			
			// Check and switch the runtime environment for the current project
			if (project.TargetFramework.Id == TargetFrameworkMoniker.NET_1_1)
			{
				string question = "The current runtime environment for your project is set to version 1.0.";
				question += "Web Service is not supported in this version.";
				question += "Do you want switch the runtime environment for this project version 2.0 ?";
				
				AlertButton switchButton = new AlertButton ("_Switch to .NET2"); 
				if (MessageService.AskQuestion(question, AlertButton.Cancel, switchButton) == switchButton)
					project.TargetFramework = Runtime.SystemAssemblyService.GetTargetFramework (TargetFrameworkMoniker.NET_2_0);					
				else
					return;
			}
			
			WebReferenceDialog dialog = new WebReferenceDialog (project);
			dialog.NamespacePrefix = project.DefaultNamespace;
			
			try {
				if (MessageService.RunCustomDialog (dialog) == (int)Gtk.ResponseType.Ok) {
					dialog.SelectedService.GenerateFiles (project, dialog.Namespace, dialog.ReferenceName);
					IdeApp.ProjectOperations.Save(project);
				}
			}
			catch(Exception exception) {
				MessageService.ShowException (exception);
			} finally {
				dialog.Destroy ();
			}
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:34,代码来源:WebReferenceCommandHandler.cs


示例2: MapResultToFileConflictResolution

		FileConflictResolution MapResultToFileConflictResolution(AlertButton result)
		{
			if (result == AlertButton.Yes) {
				return FileConflictResolution.Overwrite;
			} else if (result == YesToAllButton) {
				return FileConflictResolution.OverwriteAll;
			} else if (result == NoToAllButton) {
				return FileConflictResolution.IgnoreAll;
			} else {
				return FileConflictResolution.Ignore;
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:12,代码来源:FileConflictResolver.cs


示例3: TakeSnapshot

		public override void TakeSnapshot ()
		{
			AlertButton button = new AlertButton (GettextCatalog.GetString ("Terminate"));
			bool terminate = MessageService.Confirm (
				GettextCatalog.GetString ("Heap-Buddy requires the application to terminate cleanly.\nAre you sure you want to terminate the application (this might result in the loss of some profiling data)?")
				, button
			);

			if (terminate) {
				lock (sync) {
					State = ProfilerState.TakingSnapshot;
					
					System.Diagnostics.Process.Start ("kill", "-PROF " + Context.AsyncOperation.ProcessId);
					ThreadPool.QueueUserWorkItem (new WaitCallback (AsyncTakeSnapshot));
				}
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:17,代码来源:HeapBuddyProfiler.cs


示例4: Migrate

		public bool Migrate (MSBuildProject project, string fileName, string language)
		{
			var buttonBackupAndMigrate = new AlertButton (GettextCatalog.GetString ("Back up and migrate"));
			var buttonMigrate = new AlertButton (GettextCatalog.GetString ("Migrate"));
			var buttonIgnore = new AlertButton (GettextCatalog.GetString ("Ignore"));
			var response = MessageService.AskQuestion (
				GettextCatalog.GetString ("Migrate MonoMac Project?"),
				GettextCatalog.GetString (
					"The MonoMac project '{0}' must be migrated to a new format. " +
					"After migration, it will not be able to be opened in " +
					"older versions of MonoDevelop.\n\n" +
					"If you choose to back up the project before migration, a copy of the project " +
					"file will be saved in a 'backup' directory in the project directory.", Path.GetFileNameWithoutExtension (fileName)),
				buttonIgnore, buttonMigrate, buttonBackupAndMigrate);
			if (response == buttonIgnore)
				return false;
			
			FilePath baseDir = Path.GetDirectoryName (fileName);
			
			bool backup = response == buttonBackupAndMigrate;
			if (backup) {
				var backupDirFirst = baseDir.Combine ("backup");
				string backupDir = backupDirFirst;
				int i = 0;
				while (Directory.Exists (backupDir)) {
					backupDir = backupDirFirst + "-" + i.ToString ();
					if (i > 20) {
						throw new Exception ("Too many backup directories");
					}
				}
				Directory.CreateDirectory (backupDir);
				File.Copy (fileName, Path.Combine (backupDir, Path.GetFileName (fileName)));
			}
			
			// Migrate 'Page' build action to 'InterfaceDefinition' (see Bug 147 - XIB files need Build Action other than Page)
			// NOTE: Work around mono bug by calling ToList() before iterating: http://bugzilla.xamarin.com/show_bug.cgi?id=520
			foreach (var item in project.GetAllItems ().Where (item => item.Name == "Page").ToList ()) {
				var newElement = project.doc.CreateElement (BuildAction.InterfaceDefinition);
				newElement.InnerXml = item.Element.InnerXml;
				foreach (System.Xml.XmlAttribute attribute in item.Element.Attributes)
					newElement.SetAttribute (attribute.Name, attribute.Value);
				item.Element.ParentNode.ReplaceChild (newElement, item.Element);
			}
			
			return true;
		}
开发者ID:kirill85,项目名称:monodevelop,代码行数:46,代码来源:MonoMacProjectMigrationHandler.cs


示例5: Publish

		public static bool Publish (IWorkspaceObject entry, FilePath localPath, bool test)
		{
			if (test)
				return true;

			if (!VersionControlService.CheckVersionControlInstalled ())
				return false;

			List<FilePath> files = new List<FilePath> ();

			// Build the list of files to be checked in			
			string moduleName = entry.Name;
			if (localPath == entry.BaseDirectory) {
				GetFiles (files, entry);
			} else if (entry is Project) {
				foreach (ProjectFile file in ((Project)entry).Files.GetFilesInPath (localPath))
					if (file.Subtype != Subtype.Directory)
						files.Add (file.FilePath);
			} else
				return false;

			if (files.Count == 0)
				return false;
	
			SelectRepositoryDialog dlg = new SelectRepositoryDialog (SelectRepositoryMode.Publish);
			try {
				dlg.ModuleName = moduleName;
				dlg.Message = GettextCatalog.GetString ("Initial check-in of module {0}", moduleName);
				do {
					if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok && dlg.Repository != null) {
						AlertButton publishButton = new AlertButton ("_Publish");					
						if (MessageService.AskQuestion (GettextCatalog.GetString ("Are you sure you want to publish the project?"), GettextCatalog.GetString ("The project will be published to the repository '{0}', module '{1}'.", dlg.Repository.Name, dlg.ModuleName), AlertButton.Cancel, publishButton) == publishButton) {
							PublishWorker w = new PublishWorker (dlg.Repository, dlg.ModuleName, localPath, files.ToArray (), dlg.Message);
							w.Start ();
							break;
						}
					} else
						break;
				} while (true);
			} finally {
				dlg.Destroy ();
			}
			return true;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:44,代码来源:PublishCommand.cs


示例6: Run

		protected override void Run ()
		{
			System.Threading.ThreadPool.QueueUserWorkItem (delegate {
				// Process cached crash reports if there are any and uploading is enabled
				LogReportingService.ProcessCache ();
			});
			
			// Attach a handler for when exceptions need to be processed
			LogReportingService.UnhandledErrorOccured = (enabled, ex, willShutdown) => {
				var doNotSend = new AlertButton (GettextCatalog.GetString ("Do _Not Send"));
				var sendOnce = new AlertButton (GettextCatalog.GetString ("_Send This Time"));
				var alwaysSend = new AlertButton (GettextCatalog.GetString ("_Always Send"));
				
				AlertButton[] buttons = null;
				string message = null;
				string title = willShutdown
					? GettextCatalog.GetString ("A fatal error has occurred")
					: GettextCatalog.GetString ("An error has occurred");

				if (!ShouldPromptToOptIn && enabled.GetValueOrDefault ()) {
					message = GettextCatalog.GetString (
						"Details of this error have been automatically sent to Xamarin for analysis.");
					if (willShutdown) {
						message += GettextCatalog.GetString (" {0} will now close.", BrandingService.ApplicationName);
					}
					MessageService.ShowException (ex, message, title, AlertButton.Ok);
					return enabled;
				}

				message = GettextCatalog.GetString (
					"Details of errors, along with anonymous installation information, can be sent to Xamarin to " +
					"help improve {0}. Do you wish to send this information?", BrandingService.ApplicationName);
				var result = MessageService.ShowException (ex, message, title, doNotSend, sendOnce, alwaysSend);

				if (result == sendOnce) {
					return null;
				} else if (result == alwaysSend) {
					return true;
				} else {
					return false;
				}
			};
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:43,代码来源:LogReportingStartup.cs


示例7: GenerateMakefiles

		internal static void GenerateMakefiles (SolutionItem entry, Solution solution)
		{
			if (solution == null) {
				AlertButton generateMakefilesButton = new AlertButton (GettextCatalog.GetString ("_Generate Makefiles"));
				if (MessageService.AskQuestion (GettextCatalog.GetString ("Generating Makefiles is not supported for single projects. Do you want to generate them for the full solution - '{0}' ?", entry.ParentSolution.Name),
				                                AlertButton.Cancel,
				                                generateMakefilesButton) == generateMakefilesButton) 
					solution = ((SolutionItem)entry).ParentSolution;
				else
					return;
			}

			DeployContext ctx = null;
			IProgressMonitor monitor = null;

			GenerateMakefilesDialog dialog = new GenerateMakefilesDialog (solution);
			try {
				if (MessageService.RunCustomDialog (dialog) != (int) Gtk.ResponseType.Ok)
					return;

				SolutionDeployer deployer = new SolutionDeployer (dialog.GenerateAutotools);
				if ( deployer.HasGeneratedFiles ( solution ) )
				{
					string msg = GettextCatalog.GetString ( "{0} already exist for this solution.  Would you like to overwrite them?", dialog.GenerateAutotools ? "Autotools files" : "Makefiles" );
					if (MonoDevelop.Ide.MessageService.AskQuestion (msg, AlertButton.Cancel, AlertButton.OverwriteFile) != AlertButton.OverwriteFile)
						return;
				}

				ctx = new DeployContext (new TarballDeployTarget (dialog.GenerateAutotools), "Linux", null);
				monitor = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (true);
				deployer.GenerateFiles (ctx, solution, dialog.DefaultConfiguration, monitor);
			} finally {
				dialog.Destroy ();
				dialog.Dispose ();
				if (ctx != null)
					ctx.Dispose ();
				if (monitor != null)
					monitor.Dispose ();
			}
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:40,代码来源:Commands.cs


示例8: CheckGtkVersion

		//Mac GTK+ is unstable, even between micro releases
		static void CheckGtkVersion (uint major, uint minor, uint micro)
		{
			string url = "http://www.go-mono.com/mono-downloads/download.html";
			
			// to require exact version, also check : || Gtk.Global.CheckVersion (major, minor, micro + 1) == null
			if (Gtk.Global.CheckVersion (major, minor, micro) != null) {
				
				MonoDevelop.Core.LoggingService.LogFatalError ("GTK+ version is incompatible with required version {0}.{1}.{2}.", major, minor, micro);
				
				AlertButton downloadButton = new AlertButton ("Download...", null);
				if (downloadButton == MessageService.GenericAlert (
					Stock.Error,
					"Incompatible Mono Framework Version",
					"MonoDevelop requires a newer version of the Mono Framework.",
					new AlertButton ("Cancel", null), downloadButton))
				{
					OpenUrl (url);
				}
				
				Environment.Exit (1);
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:23,代码来源:MacPlatform.cs


示例9: Run

		protected override void Run ()
		{
			// Attach a handler for when exceptions need to be processed
			LoggingService.UnhandledErrorOccured = (enabled, ex, willShutdown) => {
				var doNotSend = new AlertButton (GettextCatalog.GetString ("Do _Not Send"));
				var sendOnce = new AlertButton (GettextCatalog.GetString ("_Send This Time"));
				var alwaysSend = new AlertButton (GettextCatalog.GetString ("_Always Send"));
				
				string message = null;
				string title = willShutdown
					? GettextCatalog.GetString ("A fatal error has occurred")
					: GettextCatalog.GetString ("An error has occurred");

				if (!ShouldPromptToOptIn && enabled.GetValueOrDefault ()) {
					if (willShutdown) {
						message = GettextCatalog.GetString (
							"Details of this error have been automatically sent to Xamarin for analysis.");
						message += GettextCatalog.GetString (" {0} will now close.", BrandingService.ApplicationName);
						MessageService.ShowError (null, title, message, ex, false, AlertButton.Ok);
					}
					return enabled;
				}

				message = GettextCatalog.GetString (
					"Details of errors, along with anonymous installation information, can be sent to Xamarin to " +
					"help improve {0}. Do you wish to send this information?", BrandingService.ApplicationName);
				var result = MessageService.ShowError (null, title, message, ex, false, doNotSend, sendOnce, alwaysSend);

				if (result == sendOnce) {
					return null;
				} else if (result == alwaysSend) {
					return true;
				} else {
					return false;
				}
			};
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:37,代码来源:LogReportingStartup.cs


示例10: Confirm

		public static bool Confirm (string primaryText, AlertButton button, bool confirmIsDefault)
		{
			return Confirm (primaryText, null, button, confirmIsDefault);
		}
开发者ID:wickedshimmy,项目名称:monodevelop,代码行数:4,代码来源:MessageService.cs


示例11: CheckBeforeDebugging

		internal static CheckResult CheckBeforeDebugging (IBuildTarget target)
		{
			if (IdeApp.Preferences.BuildBeforeExecuting)
				return CheckResult.BuildBeforeRun;
			
			if (!target.NeedsBuilding (IdeApp.Workspace.ActiveConfiguration))
				return CheckResult.Run;
			
			AlertButton bBuild = new AlertButton (GettextCatalog.GetString ("Build"));
			AlertButton bRun = new AlertButton (Gtk.Stock.Execute, true);
			AlertButton res = MessageService.AskQuestion (
			                                 GettextCatalog.GetString ("Outdated Debug Information"), 
			                                 GettextCatalog.GetString ("The project you are executing has changes done after the last time it was compiled. The debug information may be outdated. Do you want to continue?"),
			                                 2,
			                                 AlertButton.Cancel,
			                                 bBuild,
			                                 bRun);

			// This call is a workaround for bug #6907. Without it, the main monodevelop window is left it a weird
			// drawing state after the message dialog is shown. This may be a gtk/mac issue. Still under research.
			DispatchService.RunPendingEvents ();

			if (res == AlertButton.Cancel)
				return CheckResult.Cancel;

			if (res == bRun)
				return CheckResult.Run;

			return CheckResult.BuildBeforeRun;
		}
开发者ID:vitorelli,项目名称:monodevelop,代码行数:30,代码来源:DebugCommands.cs


示例12: OnDropView

		protected void OnDropView ()
		{
			ViewNode node = (ViewNode)CurrentNode.DataItem;
			AlertButton dropButton = new AlertButton (AddinCatalog.GetString ("Drop"), Gtk.Stock.Delete);
			if (MessageService.Confirm (
				AddinCatalog.GetString ("Are you sure you want to drop view '{0}'", node.View.Name),
				dropButton
			)) {
				ThreadPool.QueueUserWorkItem (new WaitCallback (OnDropViewThreaded), CurrentNode.DataItem);
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:11,代码来源:ViewNodeBuilder.cs


示例13: AddFilesToSolutionFolder

		public bool AddFilesToSolutionFolder (SolutionFolder folder, string[] files)
		{
			QuestionMessage msg = new QuestionMessage ();
			AlertButton keepButton = new AlertButton (GettextCatalog.GetString ("Keep file path"));
			msg.Buttons.Add (keepButton);
			msg.Buttons.Add (AlertButton.Copy);
			msg.Buttons.Add (AlertButton.Move);
			msg.Buttons.Add (AlertButton.Cancel);
			msg.AllowApplyToAll = true;
			
			bool someAdded = false;
			
			foreach (string file in files) {
				FilePath fp = file;
				FilePath dest = folder.BaseDirectory.Combine (fp.FileName);
				
				if (folder.IsRoot) {
					// Don't allow adding files to the root folder. VS doesn't allow it
					// If there is no existing folder, create one
					var itemsFolder = (SolutionFolder) folder.Items.Where (item => item.Name == "Solution Items").FirstOrDefault ();
					if (itemsFolder == null) {
						itemsFolder = new SolutionFolder ();
						itemsFolder.Name = "Solution Items";
						folder.AddItem (itemsFolder);
					}
					folder = itemsFolder;
				}
				
				if (!fp.IsChildPathOf (folder.BaseDirectory)) {
					msg.Text = GettextCatalog.GetString ("The file {0} is outside the folder directory. What do you want to do?", fp.FileName);
					AlertButton res = MessageService.AskQuestion (msg);
					if (res == AlertButton.Cancel)
						return someAdded;
					if (res == AlertButton.Copy) {
						FileService.CopyFile (file, dest);
						fp = dest;
					} else if (res == AlertButton.Move) {
						FileService.MoveFile (file, dest);
						fp = dest;
					}
				}
				folder.Files.Add (fp);
				someAdded = true;
			}
			return someAdded;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:46,代码来源:ProjectOperations.cs


示例14: ConfirmationMessage

		public ConfirmationMessage (string primaryText, AlertButton button): this (button)
		{
			Text = primaryText;
		}
开发者ID:wickedshimmy,项目名称:monodevelop,代码行数:4,代码来源:MessageService.cs


示例15: ImportFile

		internal static string ImportFile (Project prj, string file)
		{
			ProjectFile pfile = prj.Files.GetFile (file);
			if (pfile == null) {
				var files = IdeApp.ProjectOperations.AddFilesToProject (prj, new string[] { file }, prj.BaseDirectory);
				if (files.Count == 0 || files[0] == null)
					return null;
				pfile = files [0];
			}
			if (pfile.BuildAction == BuildAction.EmbeddedResource) {
				AlertButton embedButton = new AlertButton (GettextCatalog.GetString ("_Use as Source"));
				if (MessageService.AskQuestion (GettextCatalog.GetString ("You are requesting the file '{0}' to be used as source for an image. However, this file is already added to the project as a resource. Are you sure you want to continue (the file will have to be removed from the resource list)?"), AlertButton.Cancel, embedButton) == embedButton)
					return null;
			}
			pfile.BuildAction = BuildAction.Content;
			DeployProperties props = DeployService.GetDeployProperties (pfile);
			props.UseProjectRelativePath = true;
			return pfile.FilePath;
		}
开发者ID:Poiros,项目名称:monodevelop,代码行数:19,代码来源:GuiBuilderService.cs


示例16: OnDropDatabase

		protected void OnDropDatabase ()
		{
			DatabaseConnectionContext context = (DatabaseConnectionContext) CurrentNode.DataItem;
			AlertButton dropButton = new AlertButton (AddinCatalog.GetString ("Drop"), Gtk.Stock.Delete);
			if (MessageService.Confirm (
				AddinCatalog.GetString ("Are you sure you want to drop database '{0}'", context.ConnectionSettings.Database),
				dropButton
			)) {
				ThreadPool.QueueUserWorkItem (new WaitCallback (OnDropDatabaseThreaded), CurrentNode.DataItem);
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:11,代码来源:ConnectionContextNodeBuilder.cs


示例17: RequestFileWritePermission

		public override bool RequestFileWritePermission (FilePath path)
		{
			if (!File.Exists (path))
				return true;
			if ((File.GetAttributes (path) & FileAttributes.ReadOnly) == 0)
				return true;
			AlertButton but = new AlertButton ("Lock File");
			if (!MessageService.Confirm (GettextCatalog.GetString ("File locking required"), GettextCatalog.GetString ("The file '{0}' must be locked before editing.", path), but))
				return false;
			try {
				Svn.Lock (null, "", false, path);
			} catch (SubversionException ex) {
				MessageService.ShowError (GettextCatalog.GetString ("The file '{0}' could not be unlocked", path), ex.Message);
				return false;
			}
			VersionControlService.NotifyFileStatusChanged (this, path, false);
			return true;
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:18,代码来源:SubversionRepository.cs


示例18: OnOpen

		void OnOpen ()
		{
			string[] files = GetCurrentFiles ();
			if (files.Length == 0)
				return;
			else if (files.Length == 1) {
				TreePath[] rows = filelist.Selection.GetSelectedRows ();
				int line = 1;
				if (rows.Length == 1 && rows [0].Depth == 2) {
					line = diffRenderer.GetSelectedLine (rows [0]);
					if (line == -1)
						line = 1;
				}
				IdeApp.Workbench.OpenDocument (files [0], line, 0);
			}
			else {
				AlertButton openAll = new AlertButton (GettextCatalog.GetString ("_Open All")); 
				if (MessageService.AskQuestion (GettextCatalog.GetString ("Do you want to open all {0} files?", files.Length), AlertButton.Cancel, openAll) == openAll) {
					for (int n=0; n<files.Length; n++)
						IdeApp.Workbench.OpenDocument (files[n], n==0);
				}
			}
		}
开发者ID:LogosBible,项目名称:monodevelop,代码行数:23,代码来源:ChangeSetView.cs


示例19: CheckSCPlugin

		bool CheckSCPlugin ()
		{
			if (Platform.IsMac && Directory.Exists ("/Library/Contextual Menu Items/SCFinderPlugin.plugin")) {
				string message = "SCPlugin not supported";
				string detail = "MonoDevelop has detected that SCPlugin (scplugin.tigris.org) is installed. " +
				                "SCPlugin is a Subversion extension for Finder that is known to cause crashes in MonoDevelop and" +
				                "other applications running on Mac OSX 10.9 (Mavericks) or upper. Please uninstall SCPlugin " +
				                "before proceeding.";
				var close = new AlertButton (BrandingService.BrandApplicationName (GettextCatalog.GetString ("Close MonoDevelop")));
				var info = new AlertButton (GettextCatalog.GetString ("More Information"));
				var cont = new AlertButton (GettextCatalog.GetString ("Continue Anyway"));
				while (true) {
					var res = MessageService.GenericAlert (Gtk.Stock.DialogWarning, message, BrandingService.BrandApplicationName (detail), info, cont, close);
					if (res == close) {
						LoggingService.LogInternalError ("SCPlugin detected", new Exception ("SCPlugin detected. Closing."));
						return false;
					}
					if (res == info)
						DesktopService.ShowUrl ("https://bugzilla.xamarin.com/show_bug.cgi?id=21755");
					if (res == cont) {
						bool exists = Directory.Exists ("/Library/Contextual Menu Items/SCFinderPlugin.plugin");
						LoggingService.LogInternalError ("SCPlugin detected", new Exception ("SCPlugin detected. Continuing " + (exists ? "Installed." : "Uninstalled.")));
						return true;
					}
				}
			}
			return true;
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:28,代码来源:IdeStartup.cs


示例20: CheckAndBuildForExecute

		public IAsyncOperation CheckAndBuildForExecute (IBuildTarget executionTarget)
		{
			if (currentBuildOperation != null && !currentBuildOperation.IsCompleted) {
				return new FinishBuildAndCheckAgainOperation (currentBuildOperation, () => CheckAndBuildForExecute (executionTarget));
			}

			//saves open documents since it may dirty the "needs building" check
			var r = DoBeforeCompileAction ();
			if (r.Failed)
				return NullAsyncOperation.Failure;

			var configuration = IdeApp.Workspace.ActiveConfiguration;

			var buildTarget = executionTarget;
			var ewo = buildTarget as IExecutableWorkspaceObject;
			if (ewo != null) {
				var buildDeps = ewo.GetExecutionDependencies ().ToList ();
				if (buildDeps.Count > 1)
					throw new NotImplementedException ("Multiple execution dependencies not yet supported");
				buildTarget = buildDeps [0];
			}

			bool needsBuild = FastCheckNeedsBuild (buildTarget, configuration);
			if (!needsBuild) {
				return NullAsyncOperation.Success;
			}

			if (IdeApp.Preferences.BuildBeforeExecuting) {
				return new CheckAndBuildForExecuteOperation (Build (buildTarget, true));
			}

			var bBuild = new AlertButton (GettextCatalog.GetString ("Build"));
			var bRun = new AlertButton (Gtk.Stock.Execute, true);
			var res = MessageService.AskQuestion (
				GettextCatalog.GetString ("Outdated Build"),
				GettextCatalog.GetString ("The project you are executing has changes done after the last time it was compiled. Do you want to continue?"),
				2,
				AlertButton.Cancel,
				bBuild,
				bRun);

			// This call is a workaround for bug #6907. Without it, the main monodevelop window is left it a weird
			// drawing state after the message dialog is shown. This may be a gtk/mac issue. Still under research.
			DispatchService.RunPendingEvents ();

			if (res == bRun) {
				return NullAsyncOperation.Success;
			}

			if (res == bBuild) {
				return new CheckAndBuildForExecuteOperation (Build (buildTarget, true));
			}

			return NullAsyncOperation.Failure;
		}
开发者ID:lkalif,项目名称:monodevelop,代码行数:55,代码来源:ProjectOperations.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CodeCompletion.CodeCompletionContext类代码示例发布时间:2022-05-26
下一篇:
C# IPhone.IPhoneProjectConfiguration类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap