本文整理汇总了C#中IExecutionContext.BeforeExecution方法的典型用法代码示例。如果您正苦于以下问题:C# IExecutionContext.BeforeExecution方法的具体用法?C# IExecutionContext.BeforeExecution怎么用?C# IExecutionContext.BeforeExecution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IExecutionContext
的用法示例。
在下文中一共展示了IExecutionContext.BeforeExecution方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StepthroughExecutor
public StepthroughExecutor(IExecutionContext execution, SpecExecutionRequest request, IUserInterfaceObserver observer)
{
_context = new SpecContext(request.Specification, new Timings(), request.Observer, new StopConditions(), execution);
_execution = execution;
_request = request;
_observer = observer;
var gatherer = new ExecutionStepGatherer(_context);
_request.Plan.AcceptVisitor(gatherer);
_steps = gatherer.Lines;
try
{
_execution.BeforeExecution(_context);
}
catch (Exception e)
{
_context.LogException(_request.Id, e, "BeforeExecution");
}
_observer.SendProgress(new SpecProgress(_request.Id, _context.Counts, 0, _steps.Count));
sendNextStepMessage();
}
示例2: execute
private void execute(EventWaitHandle reset)
{
try
{
using (_timings.Subject("Context", "Creation"))
{
_execution = _system.CreateContext();
}
}
catch (Exception e)
{
_catastrophicException = e;
reset.Set();
return;
}
if (_request.IsCancelled) return;
_context = new SpecContext(_request.Specification, _timings, _request.Observer, _stopConditions, _execution);
try
{
_execution.BeforeExecution(_context);
}
catch (Exception e)
{
_context.LogException(_request.Id, e, "BeforeExecution");
}
_context.Reporting.As<Reporting>().StartDebugListening();
var executor = _mode.BuildExecutor(_request.Plan, _context);
_request.Plan.AcceptVisitor(executor);
_execution.AfterExecution(_context);
reset.Set();
}
示例3: beforeExecution
private void beforeExecution(IExecutionContext execution, SpecContext context)
{
try
{
execution.BeforeExecution(context);
}
catch (Exception e)
{
context.LogException(Request.Id, e, "BeforeExecution");
}
}