本文整理汇总了C#中IExecutionHandler类的典型用法代码示例。如果您正苦于以下问题:C# IExecutionHandler类的具体用法?C# IExecutionHandler怎么用?C# IExecutionHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IExecutionHandler类属于命名空间,在下文中一共展示了IExecutionHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetExecutionHandler
public override IExecutionHandler GetExecutionHandler ()
{
if (handler == null)
handler = new IronPythonExecutionHandler ();
return handler;
}
示例2: Connect
public Task Connect (NUnitVersion version, IExecutionHandler executionHandler = null, OperationConsole console = null)
{
var exePath = Path.Combine (Path.GetDirectoryName (GetType ().Assembly.Location), version.ToString (), "NUnitRunner.exe");
connection = new RemoteProcessConnection (exePath, executionHandler, console, Runtime.MainSynchronizationContext);
connection.AddListener (this);
return connection.Connect ();
}
示例3: CanExecute
public bool CanExecute (IExecutionHandler handler)
{
if (runCheckDelegate != null)
return runCheckDelegate (handler);
else if (cmd != null)
return handler.CanExecute (cmd);
else
return false;
}
示例4: TestContext
public TestContext (ITestProgressMonitor monitor, IExecutionHandler executionContext, DateTime testDate)
{
this.monitor = monitor;
if (executionContext == null)
executionContext = Runtime.ProcessService.DefaultExecutionHandler;
this.executionContext = executionContext;
// Round to seconds
this.testDate = new DateTime ((testDate.Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond);
}
示例5: ExecutionContext
public ExecutionContext (IExecutionHandler executionHandler, IConsoleFactory consoleFactory, ExecutionTarget target)
{
var targetedHandler = executionHandler as ITargetedExecutionHandler;
if (targetedHandler != null)
target = targetedHandler.Target ?? target;
this.executionHandler = executionHandler;
this.consoleFactory = consoleFactory;
this.executionTarget = target;
}
示例6: ProcessHostController
public ProcessHostController (string id, uint stopDelay, IExecutionHandler executionHandlerFactory)
{
if (string.IsNullOrEmpty (id))
id = "?";
this.id = id;
this.stopDelay = stopDelay;
this.executionHandlerFactory = executionHandlerFactory;
timer = new Timer ();
timer.AutoReset = false;
timer.Elapsed += new System.Timers.ElapsedEventHandler (WaitTimeout);
}
示例7: BackTest
public BackTest(
IEventBus eventBus,
IDataHandler bars,
IStrategy strategy,
IPortfolio portfolio,
IExecutionHandler executionHandler)
{
this.eventBus = eventBus;
this.bars = bars;
this.strategy = strategy;
this.portfolio = portfolio;
this.executionHandler = executionHandler;
this.stopWatch = new Stopwatch();
}
示例8: Execute
public IAsyncOperation Execute (IBuildTarget entry, IExecutionHandler handler)
{
ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors);
return Execute (entry, context);
}
示例9: RunSelectedTest
void RunSelectedTest (IExecutionHandler mode)
{
RunTest (TreeView.GetSelectedNode (), mode);
}
示例10: RunTest
public IAsyncOperation RunTest (UnitTest test, IExecutionHandler mode)
{
return RunTest (FindTestNode (test), mode, false);
}
示例11: RunTest
internal IAsyncOperation RunTest (UnitTest test, IExecutionHandler context, bool buildOwnerObject, bool checkCurrentRunOperation)
{
string testName = test.FullName;
if (buildOwnerObject) {
IBuildTarget bt = test.OwnerObject as IBuildTarget;
if (bt != null && bt.NeedsBuilding (IdeApp.Workspace.ActiveConfiguration)) {
if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) {
MonoDevelop.Ide.Commands.StopHandler.StopBuildOperations ();
IdeApp.ProjectOperations.CurrentRunOperation.WaitForCompleted ();
}
AsyncOperation retOper = new AsyncOperation ();
IAsyncOperation op = IdeApp.ProjectOperations.Build (bt);
retOper.TrackOperation (op, false);
op.Completed += delegate {
// The completed event of the build operation is run in the gui thread,
// so we need a new thread, because refreshing must be async
System.Threading.ThreadPool.QueueUserWorkItem (delegate {
if (op.Success) {
RefreshTests ();
test = SearchTest (testName);
if (test != null) {
Gtk.Application.Invoke (delegate {
// RunTest must run in the gui thread
retOper.TrackOperation (RunTest (test, context, false), true);
});
}
else
retOper.SetCompleted (false);
}
});
};
return retOper;
}
}
if (checkCurrentRunOperation && !IdeApp.ProjectOperations.ConfirmExecutionOperation ())
return NullProcessAsyncOperation.Failure;
Pad resultsPad = IdeApp.Workbench.GetPad <TestResultsPad>();
if (resultsPad == null) {
resultsPad = IdeApp.Workbench.ShowPad (new TestResultsPad (), "MonoDevelop.NUnit.TestResultsPad", GettextCatalog.GetString ("Test results"), "Bottom", "md-solution");
}
// Make the pad sticky while the tests are runnig, so the results pad is always visible (even if minimized)
// That's required since when running in debug mode, the layout is automatically switched to debug.
resultsPad.Sticky = true;
resultsPad.BringToFront ();
TestSession session = new TestSession (test, context, (TestResultsPad) resultsPad.Content);
session.Completed += delegate {
Gtk.Application.Invoke (delegate {
resultsPad.Sticky = false;
});
};
OnTestSessionStarting (new TestSessionEventArgs { Session = session, Test = test });
session.Start ();
if (checkCurrentRunOperation)
IdeApp.ProjectOperations.CurrentRunOperation = session;
return session;
}
示例12: TargetedExecutionHandler
public TargetedExecutionHandler (IExecutionHandler handler, ExecutionTarget target)
{
Target = target;
Handler = handler;
}
示例13: CreateExternalProcessObject
public IDisposable CreateExternalProcessObject (Type type, IExecutionHandler executionHandler, IList<string> userAssemblyPaths = null)
{
CheckRemoteType (type);
return (IDisposable)GetHost (type.ToString (), false, executionHandler).CreateInstance (type.Assembly.Location, type.FullName, GetRequiredAddins (type), userAssemblyPaths);
}
示例14: GetHost
ProcessHostController GetHost (string id, bool shared, IExecutionHandler executionHandler)
{
if (!shared)
return new ProcessHostController (id, 0, executionHandler);
lock (this) {
if (externalProcess == null)
externalProcess = new ProcessHostController ("SharedHostProcess", 10000, null);
return externalProcess;
}
}
示例15: CanExecuteFile
public bool CanExecuteFile (string file, IExecutionHandler handler)
{
ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);
return CanExecuteFile (file, context);
}