protected override void OnSequenceComplete(NativeActivityContext executionContext) { TestTraceListenerExtension listenerExtension = executionContext.GetExtension <TestTraceListenerExtension>(); UserTrace.Trace(listenerExtension, executionContext.WorkflowInstanceId, this.OnSequenceCompleteMessage); base.OnSequenceComplete(executionContext); }
private void CompleteAsyncBlock(object state) { AsyncWorkState asyncWorkState = (AsyncWorkState)state; RunTimer(asyncWorkState.Duration); UserTrace.Trace(asyncWorkState.ListenerExtension, asyncWorkState.InstanceID, AsyncOperationBlockExited); Complete(false); }
protected override void Execute(NativeActivityContext context) { TestTraceListenerExtension listenerExtension = context.GetExtension <TestTraceListenerExtension>(); NoPersistHandle handle = _noPersistHandle.Get(context); handle.Enter(context); UserTrace.Trace(listenerExtension, context.WorkflowInstanceId, NoPersistenceBlockEntered); // Schedule all of the Sequence's Activities base.Execute(context); UserTrace.Trace(listenerExtension, context.WorkflowInstanceId, NoPersistenceBlockExited); }
protected void OnResumeBookmark(NativeActivityContext context, Bookmark bookmark, object obj) { TestTraceListenerExtension listenerExtension = context.GetExtension <TestTraceListenerExtension>(); Guid instanceId = context.WorkflowInstanceId; UserTrace.Trace(listenerExtension, instanceId, BeforeWait); Thread.CurrentThread.Join((int)WaitTime.TotalMilliseconds); if (!(obj is T)) { throw new Exception("Resume Bookmark with object of type " + typeof(T).FullName); } BookmarkValue.Set(context, (T)obj); UserTrace.Trace(listenerExtension, instanceId, AfterWait); }
protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) { TestTraceListenerExtension listenerExtension = context.GetExtension <TestTraceListenerExtension>(); UserTrace.Trace(listenerExtension, context.WorkflowInstanceId, AsyncOperationBlockEntered); AsyncWorkState asyncWorkState = new AsyncWorkState() { InstanceID = context.WorkflowInstanceId, Duration = this.Duration.Get(context), ListenerExtension = listenerExtension }; return(new AsyncOperationBlockActivityAsyncResult(asyncWorkState, callback, state)); }