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


C# NativeActivityContext.ScheduleActivity方法代码示例

本文整理汇总了C#中NativeActivityContext.ScheduleActivity方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityContext.ScheduleActivity方法的具体用法?C# NativeActivityContext.ScheduleActivity怎么用?C# NativeActivityContext.ScheduleActivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NativeActivityContext的用法示例。


在下文中一共展示了NativeActivityContext.ScheduleActivity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

 protected override void Execute(NativeActivityContext context)
 {
     if (this.Condition.Get(context))
     {
         if (this.Then != null)
         {
             context.ScheduleActivity(this.Then);
         }
     }
     else if (this.Else != null)
     {
         context.ScheduleActivity(this.Else);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:If.cs

示例2: Execute

 protected override void Execute(NativeActivityContext context)
 {
     if (this.Body != null)
     {
         context.ScheduleActivity(this.Body, new CompletionCallback(OnBodyComplete));
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:CancellationScope.cs

示例3: Execute

 protected override void Execute(NativeActivityContext context)
 {
     if (this.Child != null)
     {
         context.ScheduleActivity(Child, this.onChildComplete);
     }
 }
开发者ID:horvatferi,项目名称:graywulf,代码行数:7,代码来源:Checkpoint.cs

示例4: OnExecuteBodyCompleted

        private void OnExecuteBodyCompleted(NativeActivityContext context, ActivityInstance instance)
        {
            var vars = ComputationContext.GetVariables(context, this);
            vars.Set(IterationNoVarName, vars.Get<int>(IterationNoVarName) + 1);

            context.ScheduleActivity(Condition, OnExecuteConditionCompleted);
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:7,代码来源:TrainingLoop.cs

示例5: 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

示例6: Execute

 protected override void Execute(NativeActivityContext context)
 {
     if (Body != null)
     {
         context.Properties.Add(VariableCollPropName, new GenericVariableCollection());
         context.ScheduleActivity(Body, OnBodyCompleted);
     }
 }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:8,代码来源:ComputationContext.cs

示例7: Execute

 protected override void Execute(NativeActivityContext context)
 {
     if (this.Body != null)
     {
         this.noPersistHandle.Get(context).Enter(context);
         context.ScheduleActivity(this.Body);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:NoPersistScope.cs

示例8: Execute

        protected override void Execute(NativeActivityContext context)
        {
            string name = this.BookmarkName.Get(context);

            this.outputText.Set(context, "Please enter a value: ");
            context.ScheduleActivity(output);
            context.CreateBookmark(name, new BookmarkCallback(OnReadComplete));
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:8,代码来源:EchoPrompt.cs

示例9: Execute

 protected override void Execute(NativeActivityContext context)
 {
     if ((this.activities != null) && (this.Activities.Count > 0))
     {
         Activity activity = this.Activities[0];
         context.ScheduleActivity(activity, this.onChildComplete);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:Sequence.cs

示例10: Execute

 protected override void Execute(NativeActivityContext context)
 {
     if (Body != null)
     {
         ReceiveRequestSendResponseScopeExecutionProperty executionProperty = receiveRequestSendResponseScopeExecutionPropertyFactory();
         context.Properties.Add(ExecutionPropertyName, executionProperty);
         context.ScheduleActivity(Body, BodyCompletionCallback, BodyFaultCallback);
     }
 }
开发者ID:helmsb,项目名称:Orleans.Activities,代码行数:9,代码来源:ReceiveRequestSendResponseScope.cs

示例11: Execute

        protected override void Execute(NativeActivityContext context)
        {
            context.Properties.Add(ConsoleColorProperty.Name, new ConsoleColorProperty(this.Color));

            if (this.Body != null)
            {
                context.ScheduleActivity(this.Body);
            }
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:9,代码来源:ConsoleColorScope.cs

示例12: Execute

        // Execute the activity (enter the NoPersistScope)
        protected override void Execute(NativeActivityContext context)
        {
            NoPersistHandle handle = this.noPersistHandle.Get(context);
            handle.Enter(context);

            if (Body != null)
            {
                context.ScheduleActivity(Body);
            }
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:11,代码来源:NoPersistScope.cs

示例13: Execute

        // Executes the logic of the activity
        protected override void Execute(NativeActivityContext context)
        {
            // Prepare the log message, and log it to a file
            string logPath = LogPath.Get(context);
            string comment = Comment.Get(context);

            string[] logMessage = new string[] {
                "[" + DateTime.Now + "]",
                "Please validate that activity '" + comment + "' has completed successfully.",
                "If it has, delete this file and resume the workflow.",
                ""
            };
            System.IO.File.AppendAllLines(logPath,  logMessage);

            // Schedule the user's desired activity, and then schedule the suspend activity.
            // When the suspend activity is complete, tell workflow to call our OnWorkflowResumed
            // method.
            context.ScheduleActivity(Action);
            context.ScheduleActivity(suspendActivity, OnWorkflowResumed);
        }
开发者ID:dhanzhang,项目名称:Windows-classic-samples,代码行数:21,代码来源:ContainerActivity.cs

示例14: Execute

 protected override void Execute(NativeActivityContext context)
 {
     if ((this.branches != null) && (this.Branches.Count != 0))
     {
         CompletionCallback onCompleted = new CompletionCallback(this.OnBranchComplete);
         for (int i = this.Branches.Count - 1; i >= 0; i--)
         {
             context.ScheduleActivity(this.Branches[i], onCompleted);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:Parallel.cs

示例15: Execute

 protected override void Execute(NativeActivityContext context)
 {
     if (this.Body != null)
     {
         if (this.DisallowPersistence(context))
         {
             NoPersistHandle handle = this.noPersistHandle.Get(context);
             handle.Enter(context);
         }
         context.ScheduleActivity(this.Body);
     }
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:12,代码来源:MessagingNoPersistScope.cs


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