本文整理汇总了C#中Dynamo.Core.Threading.DynamoScheduler.Shutdown方法的典型用法代码示例。如果您正苦于以下问题:C# DynamoScheduler.Shutdown方法的具体用法?C# DynamoScheduler.Shutdown怎么用?C# DynamoScheduler.Shutdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamo.Core.Threading.DynamoScheduler
的用法示例。
在下文中一共展示了DynamoScheduler.Shutdown方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestUpdateGraphyAsyncTaskMerge
public void TestUpdateGraphyAsyncTaskMerge()
{
// Verify a UpdateGraphAysncTask can't be merged with the other one
// if they modifiy different nodes.
OpenModel(TestDirectory + @"\core\scheduler\simple.dyn");
var cbn = CurrentDynamoModel.CurrentWorkspace.Nodes.OfType<CodeBlockNodeModel>().FirstOrDefault();
var funcNode = CurrentDynamoModel.CurrentWorkspace.Nodes.OfType<DSFunction>().FirstOrDefault();
// Keep code block node be silent so that the graph won't be
// executed automatically
cbn.RaisesModificationEvents = false;
var elementResolver = CurrentDynamoModel.CurrentWorkspace.ElementResolver;
cbn.SetCodeContent("-22", elementResolver); // Invalid numeric value.
cbn.MarkNodeAsModified();
// Get a UpdateGrapyAsyncTask for the modification of cbn
var scheduler = new DynamoScheduler(new SampleSchedulerThread(), true);
UpdateGraphAsyncTask task1 = new UpdateGraphAsyncTask(scheduler, false);
task1.Initialize(CurrentDynamoModel.EngineController, CurrentDynamoModel.CurrentWorkspace);
// Get a UpdateGraphAsyncTask for the modification of Math.Sin()
funcNode.MarkNodeAsModified();
UpdateGraphAsyncTask task2 = new UpdateGraphAsyncTask(scheduler, false);
task2.Initialize(CurrentDynamoModel.EngineController, CurrentDynamoModel.CurrentWorkspace);
// And both async tasks should be kept.
var mergeResult = task1.CanMergeWith(task2);
Assert.AreEqual(AsyncTask.TaskMergeInstruction.KeepBoth, mergeResult);
mergeResult = task2.CanMergeWith(task1);
Assert.AreEqual(AsyncTask.TaskMergeInstruction.KeepBoth, mergeResult);
scheduler.Shutdown();
}
示例2: TestSchedulerCreationDestruction
public void TestSchedulerCreationDestruction()
{
var schedulerThread = new SampleSchedulerThread();
Assert.IsFalse(schedulerThread.Initialized);
Assert.IsFalse(schedulerThread.Destroyed);
var scheduler = new DynamoScheduler(schedulerThread, false);
Assert.IsTrue(schedulerThread.Initialized);
Assert.IsFalse(schedulerThread.Destroyed);
scheduler.Shutdown();
Assert.IsTrue(schedulerThread.Initialized);
Assert.IsTrue(schedulerThread.Destroyed);
}
示例3: TestSchedulerCreationDestruction
public void TestSchedulerCreationDestruction()
{
var schedulerThread = new SampleSchedulerThread();
Assert.IsFalse(schedulerThread.Initialized);
Assert.IsFalse(schedulerThread.Destroyed);
var scheduler = new DynamoScheduler(schedulerThread, TaskProcessMode.Asynchronous);
Assert.IsTrue(schedulerThread.Initialized);
Assert.IsFalse(schedulerThread.Destroyed);
scheduler.Shutdown();
Assert.IsTrue(schedulerThread.Initialized);
Assert.IsTrue(schedulerThread.Destroyed);
}