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


C# IScheduler.ScheduleForExecution方法代码示例

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


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

示例1: RequestVisualUpdateAsyncCore

            RequestVisualUpdateAsyncCore(IScheduler scheduler, EngineController engine, IRenderPackageFactory factory)
        {
            var initParams = new UpdateRenderPackageParams()
            {
                Node = this,
                RenderPackageFactory = factory,
                EngineController = engine,
                DrawableIds = GetDrawableIds(),
                PreviewIdentifierName = AstIdentifierForPreview.Name
            };

            var task = new UpdateRenderPackageAsyncTask(scheduler);
            if (task.Initialize(initParams))
            {
                task.Completed += OnRenderPackageUpdateCompleted;
                scheduler.ScheduleForExecution(task);
            }
        }
开发者ID:w-fish,项目名称:Dynamo,代码行数:18,代码来源:NodeModel.cs

示例2: ProcessPendingCustomNodeSyncData

        /// <summary>
        /// DynamoModel calls this method prior to scheduling a graph update for
        /// the home workspace. This method is called to schedule custom node 
        /// compilation since the home workspace update may depend on it. Any 
        /// updates to a CustomNodeDefinition will cause GraphSyncData to be added 
        /// to "pendingCustomNodeSyncData" queue.
        /// </summary>
        /// <param name="scheduler">The scheduler on which custom node compilation 
        /// task can be scheduled.</param>
        /// 
        internal void ProcessPendingCustomNodeSyncData(IScheduler scheduler)
        {
            while (pendingCustomNodeSyncData.Count > 0)
            {
                var initParams = new CompileCustomNodeParams
                {
                    SyncData = pendingCustomNodeSyncData.Dequeue(),
                    EngineController = this
                };

                var compileTask = new CompileCustomNodeAsyncTask(scheduler);
                if (compileTask.Initialize(initParams))
                    scheduler.ScheduleForExecution(compileTask);
            }
        }
开发者ID:YanmengLi,项目名称:Dynamo,代码行数:25,代码来源:EngineController.cs

示例3: RequestValueUpdateAsync

        /// <summary>
        /// Call this method to asynchronously update the cached MirrorData for 
        /// this NodeModel through DynamoScheduler. AstIdentifierForPreview is 
        /// being accessed within this method, therefore the method is typically
        /// called from the main/UI thread.
        /// </summary>
        /// 
        internal void RequestValueUpdateAsync(IScheduler scheduler, EngineController engine)
        {
            // A NodeModel should have its cachedMirrorData reset when it is 
            // requested to update its value. When the QueryMirrorDataAsyncTask 
            // returns, it will update cachedMirrorData with the latest value.
            // 
            lock (cachedMirrorDataMutex)
            {
                cachedMirrorData = null;
            }

            // Do not have an identifier for preview right now. For an example,
            // this can be happening at the beginning of a code block node creation.
            var variableName = AstIdentifierForPreview.Value;
            if (string.IsNullOrEmpty(variableName))
                return;

            var task = new QueryMirrorDataAsyncTask(new QueryMirrorDataParams
            {
                Scheduler = scheduler,
                EngineController = engine,
                VariableName = variableName
            });

            task.Completed += OnNodeValueQueried;
            scheduler.ScheduleForExecution(task);
        }
开发者ID:w-fish,项目名称:Dynamo,代码行数:34,代码来源:NodeModel.cs


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