當前位置: 首頁>>代碼示例>>C#>>正文


C# ActivityInstance類代碼示例

本文整理匯總了C#中ActivityInstance的典型用法代碼示例。如果您正苦於以下問題:C# ActivityInstance類的具體用法?C# ActivityInstance怎麽用?C# ActivityInstance使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ActivityInstance類屬於命名空間,在下文中一共展示了ActivityInstance類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: InternalExecute

        void InternalExecute(NativeActivityContext context, ActivityInstance completedInstance)
        {
            CompensationExtension compensationExtension = context.GetExtension<CompensationExtension>();
            if (compensationExtension == null)
            {
                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.ConfirmWithoutCompensableActivity(this.DisplayName)));
            }

            CompensationToken token = Target.Get(context);
            CompensationTokenData tokenData = token == null ? null : compensationExtension.Get(token.CompensationId);

            Fx.Assert(tokenData != null, "CompensationTokenData must be valid");

            if (tokenData.ExecutionTracker.Count > 0)
            {
                if (this.onChildConfirmed == null)
                {
                    this.onChildConfirmed = new CompletionCallback(InternalExecute);
                }

                this.toConfirmToken.Set(context, new CompensationToken(tokenData.ExecutionTracker.Get()));

                Fx.Assert(Body != null, "Body must be valid");
                context.ScheduleActivity(Body, this.onChildConfirmed);
            }
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:26,代碼來源:DefaultConfirmation.cs

示例2: GatherOutputs

        protected override void GatherOutputs(ActivityInstance completedInstance)
        {
            if (completedInstance.Activity.HandlerOf != null)
            {
                IList<RuntimeDelegateArgument> runtimeArguments = completedInstance.Activity.HandlerOf.RuntimeDelegateArguments;
                LocationEnvironment environment = completedInstance.Environment;

                for (int i = 0; i < runtimeArguments.Count; i++)
                {
                    RuntimeDelegateArgument runtimeArgument = runtimeArguments[i];

                    if (runtimeArgument.BoundArgument != null)
                    {
                        if (ArgumentDirectionHelper.IsOut(runtimeArgument.Direction))
                        {
                            Location parameterLocation = environment.GetSpecificLocation(runtimeArgument.BoundArgument.Id);

                            if (parameterLocation != null)
                            {
                                if (this.results == null)
                                {
                                    this.results = new Dictionary<string, object>();
                                }

                                this.results.Add(runtimeArgument.Name, parameterLocation.Value);
                            }
                        }
                    }
                }
            }
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:31,代碼來源:DelegateCompletionCallbackWrapper.cs

示例3: CreateWorkItem

        internal WorkItem CreateWorkItem(ActivityInstance completedInstance, ActivityExecutor executor)
        {
            // We use the property to guard against the virtual method call
            // since we don't need it in the common case
            if (this.NeedsToGatherOutputs)
            {
                this.GatherOutputs(completedInstance);
            }

            CompletionWorkItem workItem;

            if (this.checkForCancelation)
            {
                workItem = new CompletionWithCancelationCheckWorkItem(this, completedInstance);
            }
            else
            {
                workItem = executor.CompletionWorkItemPool.Acquire();
                workItem.Initialize(this, completedInstance);
            }

            if (completedInstance.InstanceMap != null)
            {
                completedInstance.InstanceMap.AddEntry(workItem);
            }

            return workItem;
        }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:28,代碼來源:CompletionCallbackWrapper.cs

示例4: BookmarkCallbackWrapper

        public BookmarkCallbackWrapper(BookmarkCallback callback, ActivityInstance owningInstance, BookmarkOptions bookmarkOptions)
            : base(callback, owningInstance)
        {
            Fx.Assert(callback != null || bookmarkOptions == BookmarkOptions.None, "Either we have a callback or we only allow SingleFire, Blocking bookmarks.");

            this.Options = bookmarkOptions;
        }
開發者ID:krytht,項目名稱:DotNetReferenceSource,代碼行數:7,代碼來源:BookmarkCallbackWrapper.cs

示例5: ActivityCompleted

 public void ActivityCompleted(ActivityInstance activityInstance)
 {
     if (!(activityInstance.Activity.RootActivity is Constraint)) // Don't debug an activity in a Constraint
     {
         EnsureActivityInstrumented(activityInstance, true);
         this.debugManager.OnLeaveState(activityInstance);
     }
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:8,代碼來源:DebugController.cs

示例6: FaultWorkItem

 public FaultWorkItem(FaultCallbackWrapper callbackWrapper, Exception propagatedException, ActivityInstance propagatedFrom, ActivityInstanceReference originalExceptionSource)
     : base(callbackWrapper.ActivityInstance)
 {
     this.callbackWrapper = callbackWrapper;
     this.propagatedException = propagatedException;
     this.propagatedFrom = propagatedFrom;
     this.originalExceptionSource = originalExceptionSource;
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:8,代碼來源:FaultCallbackWrapper.cs

示例7: Initialize

 public void Initialize(ActivityInstance activityInstance, int nextArgumentIndex, IDictionary<string, object> argumentValueOverrides, Location resultLocation)
 {
     Fx.Assert(nextArgumentIndex > 0, "The nextArgumentIndex must be greater than 0 otherwise we will incorrectly set the sub-state when ResolveArguments completes");
     base.Reinitialize(activityInstance);
     this.nextArgumentIndex = nextArgumentIndex;
     this.argumentValueOverrides = argumentValueOverrides;
     this.resultLocation = resultLocation;
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:8,代碼來源:ResolveNextArgumentWorkItem.cs

示例8: ActivityStarted

 public void ActivityStarted(ActivityInstance activityInstance)
 {
     if (!(activityInstance.Activity.RootActivity is Constraint))  // Don't debug an activity in a Constraint
     {
         EnsureActivityInstrumented(activityInstance, false);
         this.debugManager.OnEnterState(activityInstance);
     }
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:8,代碼來源:DebugController.cs

示例9: CancelRequestedRecord

 internal CancelRequestedRecord(Guid instanceId, ActivityInstance instance, ActivityInstance child)
     : base(instanceId)
 {
     Fx.Assert(child != null, "Child activity instance cannot be null.");
     if (instance != null)
     {
         this.Activity = new ActivityInfo(instance);
     }
     this.Child = new ActivityInfo(child);            
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:10,代碼來源:CancelRequestedRecord.cs

示例10: ActivityScheduledRecord

 internal ActivityScheduledRecord(Guid instanceId, ActivityInstance instance, ActivityInfo child)
     : base(instanceId)
 {
     Fx.Assert(child != null, "Child activity cannot be null.");
     if (instance != null)
     {
         this.Activity = new ActivityInfo(instance);
     }
     this.Child = child;
 }
開發者ID:krytht,項目名稱:DotNetReferenceSource,代碼行數:10,代碼來源:ActivityScheduledRecord.cs

示例11: OnHasCompleted

        protected override void OnHasCompleted(NativeActivityContext context, ActivityInstance completedInstance)
        {
            base.OnHasCompleted(context, completedInstance);

            //HACK:重寫並行節點滿足條件退出邏輯
            var e = context.GetExtension<ParallelExtension>();
            e.Cancelled(context.GetChildren()
                .Where(o => o.ID != completedInstance.ID)
                .Select(o => o.ID)
                .ToArray());
        }
開發者ID:jatinbhole,項目名稱:NTFE-BPM,代碼行數:11,代碼來源:CustomParallel.cs

示例12: Register

        public void Register(Location location, Activity activity, LocationReference locationOwner, ActivityInstance activityInstance)
        {
            Fx.Assert(location.CanBeMapped, "should only register mappable locations");

            if (this.mappableLocations == null)
            {
                this.mappableLocations = new List<MappableLocation>();
            }

            this.mappableLocations.Add(new MappableLocation(locationOwner, activity, activityInstance, location));
        }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:11,代碼來源:MappableObjectManager.cs

示例13: Initialize

        /// <summary>
        /// Called each time a work item is acquired from the pool
        /// </summary>
        /// <param name="parentInstance">The ActivityInstance containin the variable or argument that contains this expression</param>
        /// <param name="expressionActivity">The expression to evaluate</param>
        /// <param name="instanceId">The ActivityInstanceID to use for expressionActivity</param>
        /// <param name="resultLocation">Location where the result of expressionActivity should be placed</param>
        /// <param name="nextArgumentWorkItem">WorkItem to execute after this one</param>
        public void Initialize(ActivityInstance parentInstance, ActivityWithResult expressionActivity, long instanceId, Location resultLocation, ResolveNextArgumentWorkItem nextArgumentWorkItem)
        {
            this.Reinitialize(parentInstance);

            Fx.Assert(resultLocation != null, "We should only use this work item when we are resolving arguments/variables and therefore have a result location.");
            Fx.Assert(expressionActivity.IsFastPath, "Should only use this work item for fast path expressions");

            this.expressionActivity = expressionActivity;
            this.instanceId = instanceId;
            this.resultLocation = resultLocation;
            this.nextArgumentWorkItem = nextArgumentWorkItem;
        }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:20,代碼來源:ExecuteSynchronousExpressionWorkItem.cs

示例14: Invoke

        protected internal override void Invoke(NativeActivityContext context, ActivityInstance completedInstance)
        {
            EnsureCallback(callbackType, callbackParameterTypes);
            DelegateCompletionCallback completionCallback = (DelegateCompletionCallback)this.Callback;

            IDictionary<string, object> returnValue = this.results;

            if (returnValue == null)
            {
                returnValue = ActivityUtilities.EmptyParameters;
            }

            completionCallback(context, completedInstance, returnValue);
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:14,代碼來源:DelegateCompletionCallbackWrapper.cs

示例15: FaultPropagationRecord

        internal FaultPropagationRecord(Guid instanceId, ActivityInstance source, ActivityInstance faultHandler, bool isFaultSource, Exception fault)
            : base(instanceId)
        {
            Fx.Assert(source != null, "Fault source cannot be null");
            this.FaultSource = new ActivityInfo(source);

            if (faultHandler != null)
            {
                this.FaultHandler = new ActivityInfo(faultHandler);
            }
            this.IsFaultSource = isFaultSource;
            this.Fault = fault;
            this.Level = TraceLevel.Warning;
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:14,代碼來源:FaultPropagationRecord.cs


注:本文中的ActivityInstance類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。