当前位置: 首页>>代码示例>>C#>>正文


C# Projects.ExecutionContext类代码示例

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


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


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