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


C# NativeActivityContext.ScheduleFunc方法代码示例

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


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

示例1: Execute

 protected override void Execute(NativeActivityContext context)
 {
     StateMachineEventManager argument = this.eventManager.Get(context);
     argument.OnTransition = true;
     int childStateIndex = StateMachineIdHelper.GetChildStateIndex("0", this.InitialState.StateId);
     context.ScheduleFunc<StateMachineEventManager, string>(this.internalStateFuncs[childStateIndex], argument, this.onStateComplete, null);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:StateMachine.cs

示例2: OnStateComplete

 private void OnStateComplete(NativeActivityContext context, System.Activities.ActivityInstance completedInstance, string result)
 {
     if (StateMachineIdHelper.IsAncestor("0", result))
     {
         int childStateIndex = StateMachineIdHelper.GetChildStateIndex("0", result);
         context.ScheduleFunc<StateMachineEventManager, string>(this.internalStateFuncs[childStateIndex], this.eventManager.Get(context), this.onStateComplete, null);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:StateMachine.cs

示例3: ScheduleGetNextVectors

        private void ScheduleGetNextVectors(NativeActivityContext context)
        {
            var vars = ComputationContext.GetVariables(context, this);

            var strategy = vars.Get<BatchingStrategy>(StrategyVarName);

            if (LastResult != null && !strategyHasJustInited.Get(context))
            {
                var obs = strategy as OptimizationBatchingStrategy;
                if (obs != null)
                {
                    var last = LastResult.Get(context);
                    if (!last.IsEmpty)
                    {
                        obs.SetLastResult(last);
                    }
                }
            }

            var indexSet = new IndexSet(strategy.GetNextIndexes());

            if (IsCached(context))
            {
                // Get From Cache:
                var cache = vars.Get<SerializableCache>(CacheVarName).Cache;
                // Create variable:
                var vectorsFromCache = new LinkedList<NeuralVectors>();
                cachedVectors.Set(context, vectorsFromCache);

                var newIndexSet = new IndexSet(indexSet);

                foreach (var index in indexSet)
                {
                    string key = index.ToString();
                    var cached = cache[key] as NeuralVectors;
                    if (cached != null)
                    {
                        // Cached, add to variable, and remove from indexes:
                        vectorsFromCache.AddLast(cached);
                        newIndexSet.Remove(index);
                    }
                }

                indexSet = newIndexSet;
            }

            if (indexSet.Count > 0)
            {
                // Are there any non-cached item requests? Get it!
                context.ScheduleFunc(GetNextVectors, indexSet, OnGetNextVectorsCompleted);
            }
            else
            {
                // All items was in cache, proccess'em!
                ProcessNextVectors(context, null);
            }
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:57,代码来源:UnorderedBatcher.cs

示例4: Begin

        private void Begin(NativeActivityContext context)
        {
            var vars = ComputationContext.GetVariables(context, this);

            if (!vars.Exists(IterationsVarName))
            {
                vars.Set(IterationsVarName, 0);
            }

            if (!vars.Exists(ItemCountVarName))
            {
                // ItemCount is not yet determined.
                ScheduleGetItemCount(context);
                return;
            }

            EnsureCache(context);

            if (!vars.Exists(StrategyVarName))
            {
                context.ScheduleFunc(GetBatchingStrategyFactory, OnGetBatchingStrategyFactoryCompleted);
            }
            else
            {
                strategyHasJustInited.Set(context, false);
                ScheduleGetNextVectors(context);
            }
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:28,代码来源:UnorderedBatcher.cs

示例5: OnDelayCompleted

 /// <summary>
 /// Respond to the completion callback for the Delay activity.
 /// </summary>
 /// <param name="context">The activity context.</param>
 /// <param name="instance">The current instance of the activity.</param>
 private void OnDelayCompleted(NativeActivityContext context, ActivityInstance instance)
 {
     // Poll again
     context.ScheduleFunc(
         this.PollingBody,
         this.OperationId.Get(context),
         this.SubscriptionId.Get(context),
         this.CertificateThumbprintId.Get(context),
         this.OnGetStatusCompleted,
         this.OnOperationFault);
 }
开发者ID:modulexcite,项目名称:CustomActivities,代码行数:16,代码来源:AzureAsyncOperation.cs

示例6: ScheduleGetNextVectors

 private void ScheduleGetNextVectors(NativeActivityContext context)
 {
     context.ScheduleFunc(GetNextVectors, OnGetNextVectorsCompleted);
 }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:4,代码来源:StreamBatcher.cs

示例7: OnOperationCompleted

        /// <summary>
        /// Respond to the completion callback for the Operation activity.
        /// </summary>
        /// <param name="context">The activity context.</param>
        /// <param name="instance">The current instance of the activity.</param>
        /// <param name="result">The result returned by the activity at completion.</param>
        private void OnOperationCompleted(NativeActivityContext context, ActivityInstance instance, string result)
        {
            // Check to see if the operation faulted
            if (this.AzureActivityExceptionCaught.Get(context))
            {
                context.ScheduleActivity(this.Failure);
                return;
            }

            // Store the results of the activity for later
            context.SetValue(this.PollingEndTime, DateTime.UtcNow.AddSeconds(this.TimeoutSeconds));
            context.SetValue(this.OperationId, result);

            // Start the process of polling for status - kind of like a do/while
            context.ScheduleFunc(
                this.PollingBody,
                this.OperationId.Get(context),
                this.SubscriptionId.Get(context),
                this.CertificateThumbprintId.Get(context),
                this.OnGetStatusCompleted,
                this.OnOperationFault);
        }
开发者ID:modulexcite,项目名称:CustomActivities,代码行数:28,代码来源:AzureAsyncOperation.cs

示例8: ReceiveCallback

        /// <summary>
        /// The receive callback.
        /// </summary>
        /// <param name="context">
        /// The context.
        /// </param>
        /// <param name="bookmark">
        /// The bookmark.
        /// </param>
        /// <param name="value">
        /// The value.
        /// </param>
        private void ReceiveCallback(NativeActivityContext context, Bookmark bookmark, object value)
        {
            context.RemoveAllBookmarks();
            this.receiveContext = (IHttpWorkflowReceiveContext)value;
            this.hostContext = context.GetExtension<IHttpWorkflowHostContext>();

            // bind the parameters using the UriTemplate
            var match = this.hostContext.MatchSingle(this.receiveContext.Request);

            this.noPersistHandle.Get(context).Enter(context);

            // TODO: Consider fault handling - do we need to do anything special?
            context.ScheduleFunc(
                this.Body,
                this.receiveContext.Request,
                match.BoundVariables.AllKeys.ToDictionary(s => s, key => match.BoundVariables[key]),
                this.OnBodyCompleted);
        }
开发者ID:IcodeNet,项目名称:cleansolution,代码行数:30,代码来源:HttpReceive.cs

示例9: ScheduleGetNextVectors

        private void ScheduleGetNextVectors(NativeActivityContext context)
        {
            var vars = ComputationContext.GetVariables(context, this);

            var strategy = vars.Get<BatchingStrategy>(StrategyVarName);

            if (LastResult != null)
            {
                var obs = strategy as OptimizationBatchingStrategy;
                if (obs != null)
                {
                    var last = LastResult.Get(context);
                    if (!last.IsEmpty)
                    {
                        obs.SetLastResult(last);
                    }
                }
            }

            var indexSet = new IndexSet(strategy.GetNextIndexes());



            context.ScheduleFunc(GetNextVectors, indexSet, OnGetNextVectorsCompleted);
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:25,代码来源:UnorderedBatcher.cs

示例10: OnStateComplete

 void OnStateComplete(NativeActivityContext context, ActivityInstance completedInstance, string result)
 {
     if (StateMachineHelper.IsAncestor(rootId, result))
     {
         int index = StateMachineHelper.GetChildStateIndex(rootId, result);
         context.ScheduleFunc<string, StateMachineEventManager, string>(this.internalStateFuncs[index], result,
         this.eventManager.Get(context), onStateComplete);
     }
 }
开发者ID:xiluo,项目名称:document-management,代码行数:9,代码来源:StateMachine.cs

示例11: Execute

 protected override void Execute(NativeActivityContext context)
 {
     //We view the duration before moving to initial state is on transition.
     StateMachineEventManager localEventManager = this.eventManager.Get(context);
     localEventManager.OnTransition = true;
     int index = StateMachineHelper.GetChildStateIndex(rootId, this.InitialState.StateId);
     context.ScheduleFunc<string, StateMachineEventManager, string>(this.internalStateFuncs[index], this.InitialState.StateId,
         localEventManager, onStateComplete);
 }
开发者ID:xiluo,项目名称:document-management,代码行数:9,代码来源:StateMachine.cs


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