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

C# Projects.ExecutionContext类代码示例

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

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



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

示例1: CanExecute

		/// <summary>
		/// Flags Unity projects for debugging with this addin
		/// </summary>
		protected override bool CanExecute (SolutionEntityItem item, ExecutionContext context, ConfigurationSelector configuration)
		{
			if (CanExecuteProject (item as Project, context)) {
				return context.ExecutionHandler.CanExecute (new UnityExecutionCommand (item.BaseDirectory.FullPath));
			}
			return base.CanExecute (item, context, configuration);
		}
开发者ID:Tak,项目名称:MonoDevelop.Debugger.Soft.Unity,代码行数:10,代码来源:UnityProjectServiceExtension.cs


示例2: DoExecute

        protected override void DoExecute(IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
        {
            IodineConfiguration config = (IodineConfiguration)GetConfiguration (configuration);
            IConsole console = config.ExternalConsole ?
                context.ExternalConsoleFactory.CreateConsole (!config.PauseConsoleOutput) :
                context.ConsoleFactory.CreateConsole (!config.PauseConsoleOutput);

            AggregatedOperationMonitor aggregatedMonitor = new AggregatedOperationMonitor (monitor);
            try {
                string param = string.Format ("\"{0}\" {1}", config.MainFile, config.CommandLineParameters);

                IProcessAsyncOperation op = Runtime.ProcessService.StartConsoleProcess ("iodine",
                        param, BaseDirectory,
                        config.EnvironmentVariables, console, null);

                monitor.CancelRequested += delegate {
                    op.Cancel ();
                };

                aggregatedMonitor.AddOperation (op);
                op.WaitForCompleted ();
                monitor.Log.WriteLine ("Iodine exited with code: " + op.ExitCode);

            } catch (Exception e) {
                monitor.ReportError (GettextCatalog.GetString ("Cannot execute \"{0}\"", config.MainFile), e);
            } finally {
                console.Dispose ();
                aggregatedMonitor.Dispose ();
            }
        }
开发者ID:IodineLang,项目名称:IodineBindings,代码行数:30,代码来源:IodineProject.cs


示例3: OnExecute

    protected override Task OnExecute(ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
    {
      if (base.OnGetCanExecute(context, configuration))
      {
        return base.OnExecute(monitor, context, configuration);
      }

      try
      {
        var project = Project as DotNetProject;
        if (project != null && IsSupportedProject)
        {
          const string SoftDebuggerName = RhinoSoftDebuggerEngine.DebuggerName;
          var config = project.GetConfiguration(configuration) as DotNetProjectConfiguration;
          var cmd = new RhinoCommonExecutionCommand(project.GetOutputFileName(configuration), project);
          cmd.Arguments = config.CommandLineParameters;
          cmd.WorkingDirectory = Path.GetDirectoryName(config.CompiledOutputName);
          cmd.EnvironmentVariables = config.GetParsedEnvironmentVariables();
          cmd.TargetRuntime = project.TargetRuntime;
          cmd.UserAssemblyPaths = project.GetUserAssemblyPaths(configuration);

          var executionModes = Runtime.ProcessService.GetExecutionModes();
          var executionMode = executionModes.SelectMany(r => r.ExecutionModes).FirstOrDefault(r => r.Id == SoftDebuggerName);
          var console = context.ConsoleFactory.CreateConsole(new OperationConsoleFactory.CreateConsoleOptions(true));
          var operation = executionMode.ExecutionHandler.Execute(cmd, console);
          monitor.CancellationToken.Register(() => operation.Cancel());
          return operation.Task;
        }
      }
      catch (Exception ex)
      {
        monitor.ReportError($"An error occurred starting Rhino.\n{ex}", ex);
      }
      return null;
    }
开发者ID:mcneel,项目名称:RhinoCommonXamarinStudioAddin,代码行数:35,代码来源:RhinoProjectServiceExtension.cs


示例4: Execute

		internal protected virtual Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration, SolutionRunConfiguration runConfiguration)
		{
			context.RunConfiguration = runConfiguration;
#pragma warning disable 618 // Type or member is obsolete
			return Execute (monitor, context, configuration);
#pragma warning restore 618 // Type or member is obsolete
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:7,代码来源:SolutionExtension.cs


示例5: TestContext

		internal TestContext (ITestProgressMonitor monitor, TestResultsPad resultsPad, MonoDevelop.Projects.ExecutionContext executionContext, DateTime testDate)
		{
			this.monitor = monitor;
			if (executionContext == null)
				executionContext = new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, null);
			this.executionContext = executionContext;
			// Round to seconds
			this.testDate = new DateTime ((testDate.Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:9,代码来源:TestContext.cs


示例6: CanRun

 public static bool CanRun(OpenFLProject project, OpenFLProjectConfiguration configuration, ExecutionContext context)
 {
     ExecutionCommand cmd = (NativeExecutionCommand)CreateExecutionCommand (project, configuration);
     if (cmd == null)
     {
         return false;
     }
     return context.ExecutionHandler.CanExecute (cmd);
 }
开发者ID:profelis,项目名称:md-haxebinding,代码行数:9,代码来源:OpenFLCommandLineToolsManager.cs


示例7: CanExecute

		public override bool CanExecute (IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
		{
			var retval = false;
			if(item is DotNetProject)
			{
				var p = item as DotNetProject;
				retval = p.References.Any(y=>y.Reference.Contains("manos"));
			}
			return retval || base.CanExecute(item,context, configuration);
		}
开发者ID:atheken,项目名称:Manos.Addin,代码行数:10,代码来源:ManosProjectExtensions.cs


示例8: Debug

		public static IAsyncOperation Debug (this ProjectOperations opers, IBuildTarget entry)
		{
			if (opers.CurrentRunOperation != null && !opers.CurrentRunOperation.IsCompleted)
				return opers.CurrentRunOperation;

			ExecutionContext context = new ExecutionContext (DebuggingService.GetExecutionHandler (), IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);

			IAsyncOperation op = opers.Execute (entry, context);
			return op;
		}
开发者ID:nerzhulart,项目名称:monodevelop,代码行数:10,代码来源:Extensions.cs


示例9: OnGetCanExecute

		protected override bool OnGetCanExecute(ExecutionContext context, ConfigurationSelector configuration)
		{
			if(IdeApp.Workspace.GetAllSolutions().Any((s) => s.StartupItem == this))
			{
				return context.ExecutionTarget is MicroFrameworkExecutionTarget && base.OnGetCanExecute(context, configuration);
			}
			else
			{
				return base.OnGetCanExecute(context, configuration);
			}
		}
开发者ID:martincalsyn,项目名称:MonoDevelop.MicroFramework,代码行数:11,代码来源:MicroFrameworkProject.cs


示例10: Execute

		/// <summary>
		/// Launch Unity project
		/// </summary>
		public override void Execute (MonoDevelop.Core.IProgressMonitor monitor, IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
		{
			if (CanExecuteProject (item as Project, context)) {
				DispatchService.GuiDispatch (delegate {
					IdeApp.Workbench.CurrentLayout = "Debug";
					IdeApp.ProjectOperations.CurrentRunOperation = context.ExecutionHandler.Execute (new UnityExecutionCommand (item.BaseDirectory.FullPath), context.ConsoleFactory.CreateConsole (true));
				});
			} else {
				base.Execute (monitor, item, context, configuration);
			}
		}
开发者ID:Tak,项目名称:MonoDevelop.Debugger.Soft.Unity,代码行数:14,代码来源:UnityProjectServiceExtension.cs


示例11: ProfileFile

		public static IAsyncOperation ProfileFile (IProfiler profiler, string fileName)
		{
			if (IdeApp.ProjectOperations.CurrentRunOperation != null
			       && !IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted)
			       return IdeApp.ProjectOperations.CurrentRunOperation;
			
			SwitchWorkbenchContext (ProfileWorkbenchContext);
			ExecutionContext context = new ExecutionContext (profiler.GetDefaultExecutionHandlerFactory (), IdeApp.Workbench.ProgressMonitors);

			return IdeApp.ProjectOperations.ExecuteFile (fileName, context);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:11,代码来源:ProfilingOperations.cs


示例12: CanExecute

		public override bool CanExecute (IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
		{
			// We check for DefaultExecutionHandlerFactory because the tests can't run using any other execution mode
			
			bool res = base.CanExecute (item, context, configuration);
			if (!res && (item is IWorkspaceObject)) {
				UnitTest test = NUnitService.Instance.FindRootTest ((IWorkspaceObject)item);
				return (test != null) && test.CanRun (context.ExecutionHandler);
			} else
				return res;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:11,代码来源:NUnitProjectServiceExtension.cs


示例13: ProfileApplication

		public static IAsyncOperation ProfileApplication (IProfiler profiler, string executable, string workingDirectory, string args)
		{
			if (IdeApp.ProjectOperations.CurrentRunOperation != null
			       && !IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted)
			       return IdeApp.ProjectOperations.CurrentRunOperation;
			
			SwitchWorkbenchContext (ProfileWorkbenchContext);
			ExecutionContext context = new ExecutionContext (profiler.GetDefaultExecutionHandlerFactory (), IdeApp.Workbench.ProgressMonitors);

			//TODO: 
			return NullAsyncOperation.Failure;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:12,代码来源:ProfilingOperations.cs


示例14: ExecuteProject

		public static void ExecuteProject(DubProject prj,IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration, string dubVerb = "run")
		{
			bool isDebug = context.ExecutionHandler.GetType ().Name.StartsWith ("Debug");

			var conf = prj.GetConfiguration(configuration) as DubProjectConfiguration;
			IConsole console;
			if (conf.ExternalConsole)
				console = context.ExternalConsoleFactory.CreateConsole(!conf.PauseConsoleOutput);
			else
				console = context.ConsoleFactory.CreateConsole(true);
			
			var operationMonitor = new AggregatedOperationMonitor(monitor);

			var sr = new StringBuilder();
			if (!isDebug) {
				sr.Append (dubVerb);
				BuildCommonArgAppendix (sr, prj, configuration);
			}

			try
			{
				var cmd = isDebug ? prj.CreateExecutionCommand(configuration) : new NativeExecutionCommand(DubSettings.Instance.DubCommand, sr.ToString(), prj.BaseDirectory.ToString());
				if (!context.ExecutionHandler.CanExecute(cmd))
				{
					monitor.ReportError("Cannot execute \"" + cmd.Command + " " + cmd.Arguments + "\". The selected execution mode is not supported for Dub projects.", null);
					return;
				}

				var op = context.ExecutionHandler.Execute(cmd, console);

				operationMonitor.AddOperation(op);
				op.WaitForCompleted();

				if(op.ExitCode != 0)
					monitor.ReportError(cmd.Command+" exited with code: "+op.ExitCode.ToString(), null);
				else
					monitor.Log.WriteLine(cmd.Command+" exited with code: {0}", op.ExitCode);
			}
			catch (Exception ex)
			{
				monitor.ReportError("Cannot execute \"" + sr.ToString() + "\"", ex);
			}
			finally
			{
				operationMonitor.Dispose();
				console.Dispose();
			}
		}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:48,代码来源:DubBuilder.cs


示例15: Execute

		protected override void Execute (IProgressMonitor monitor, SolutionEntityItem entry, ExecutionContext context, ConfigurationSelector configuration)
		{
			SolutionItemConfiguration conf = entry.GetConfiguration (configuration) as SolutionItemConfiguration;
			if (conf != null) {
				ExecutionContext localContext = new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, context.ConsoleFactory);
				conf.CustomCommands.ExecuteCommand (monitor, entry, CustomCommandType.BeforeExecute, localContext, configuration);
				if (monitor.IsCancelRequested)
					return;
			}
			
			base.Execute (monitor, entry, context, configuration);
			
			if (conf != null && !monitor.IsCancelRequested) {
				ExecutionContext localContext = new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, context.ConsoleFactory);
				conf.CustomCommands.ExecuteCommand (monitor, entry, CustomCommandType.AfterExecute, localContext, configuration);
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:17,代码来源:CustomCommandExtension.cs


示例16: Debug

		public static IAsyncOperation Debug (this ProjectOperations opers, IBuildTarget entry)
		{
			if (opers.CurrentRunOperation != null && !opers.CurrentRunOperation.IsCompleted)
				return opers.CurrentRunOperation;

			string oldLayout = IdeApp.Workbench.CurrentLayout;
			IdeApp.Workbench.CurrentLayout = "Debug";

			ExecutionContext context = new ExecutionContext (DebuggingService.GetExecutionHandler (), IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);

			IAsyncOperation op = opers.Execute (entry, context);
			op.Completed += delegate {
				Gtk.Application.Invoke (delegate {
					IdeApp.Workbench.CurrentLayout = oldLayout;
				});
			};
			return op;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:18,代码来源:Extensions.cs


示例17: CanRun

        public static bool CanRun(HaxeProject project, HaxeProjectConfiguration configuration, ExecutionContext context)
        {
            // need to optimize so this caches the result

            ExecutionCommand cmd = CreateExecutionCommand (project, configuration);
            if (cmd == null)
            {
                return false;
            }
            else if (cmd is NativeExecutionCommand)
            {
                return context.ExecutionHandler.CanExecute (cmd);
            }
            else
            {
                return true;
            }
        }
开发者ID:aaulia,项目名称:md-haxebinding,代码行数:18,代码来源:HaxeCompilerManager.cs


示例18: ExecuteProject

        internal static void ExecuteProject(DubProject prj,IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
        {
            var conf = prj.GetConfiguration(configuration) as DubProjectConfiguration;
            IConsole console;
            if (conf.ExternalConsole)
                console = context.ExternalConsoleFactory.CreateConsole(!conf.PauseConsoleOutput);
            else
                console = context.ConsoleFactory.CreateConsole(true);

            var operationMonitor = new AggregatedOperationMonitor(monitor);

            var sr = new StringBuilder("run");
            Instance.BuildCommonArgAppendix(sr, prj, configuration);

            try
            {
                var cmd = new NativeExecutionCommand(Instance.DubExecutable, sr.ToString(), prj.BaseDirectory.ToString());
                if (!context.ExecutionHandler.CanExecute(cmd))
                {
                    monitor.ReportError("Cannot execute \""  + "\". The selected execution mode is not supported for Dub projects.", null);
                    return;
                }

                var op = context.ExecutionHandler.Execute(cmd, console);

                operationMonitor.AddOperation(op);
                op.WaitForCompleted();

                monitor.Log.WriteLine(Instance.DubExecutable+" exited with code: {0}", op.ExitCode);

            }
            catch (Exception ex)
            {
                monitor.ReportError("Cannot execute \"" + sr.ToString() + "\"", ex);
            }
            finally
            {
                operationMonitor.Dispose();
                console.Dispose();
            }
        }
开发者ID:simendsjo,项目名称:Mono-D,代码行数:41,代码来源:DubBuilder.cs


示例19: Execute

		/// <summary>
		/// Launch project
		/// </summary>
		public override void Execute (MonoDevelop.Core.IProgressMonitor monitor, IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
		{
			if (CanExecuteProject (item as Project, context)) {
				DispatchService.GuiDispatch (delegate {

					foreach(var file in ((Project)item).Files)
					{
						string filePath = file.FilePath.ToString();
						if(filePath.Contains(@"Game\Scripts"))
						{
							WorkingDir = Path.Combine(filePath.Remove(filePath.LastIndexOf(@"Game\Scripts")), "Bin32");
							break;
						}
					}
					IdeApp.Workbench.CurrentLayout = "Debug";
					IdeApp.ProjectOperations.CurrentRunOperation = context.ExecutionHandler.Execute (new CryEngineExecutionCommand (item.BaseDirectory.FullPath), context.ConsoleFactory.CreateConsole (true));
				});
			} else {
				base.Execute (monitor, item, context, configuration);
			}
		}
开发者ID:PoppermostProductions,项目名称:MonoDevelop.Debugger.Soft.CryEngine,代码行数:24,代码来源:ProjectServiceExtension.cs


示例20: Execute

		public override void Execute (MonoDevelop.Core.IProgressMonitor monitor, IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
		{
			if (base.CanExecute (item, context, configuration)) {
				// It is executable by default
				base.Execute(monitor, item, context, configuration);
				return;
			} else if (item is IWorkspaceObject) {
				UnitTest test = NUnitService.Instance.FindRootTest ((IWorkspaceObject)item);
				if (test != null) {
					IAsyncOperation oper = null;
					DispatchService.GuiSyncDispatch (delegate {
						oper = NUnitService.Instance.RunTest (test, context.ExecutionHandler, false);
					});
//					if (oper != null) {
//						monitor.CancelRequested += delegate {
//							oper.Cancel ();
//						};
//						oper.WaitForCompleted ();
//					}
				}
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:22,代码来源:NUnitProjectServiceExtension.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Projects.FileFormat类代码示例发布时间:2022-05-26
下一篇:
C# Projects.DotNetProject类代码示例发布时间: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