本文整理汇总了C#中Scheduler.RemoveJob方法的典型用法代码示例。如果您正苦于以下问题:C# Scheduler.RemoveJob方法的具体用法?C# Scheduler.RemoveJob怎么用?C# Scheduler.RemoveJob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scheduler
的用法示例。
在下文中一共展示了Scheduler.RemoveJob方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
var scheduler = new Scheduler();
Console.WriteLine("Adding WriteDot job");
var jobId = scheduler.AddJob<WriteDot>(new JobSetup() {WaitSource = new IntervalWaitSource(TimeSpan.FromSeconds(1))});
Console.ReadLine();
Console.WriteLine("Removing WriteDot job");
scheduler.RemoveJob(jobId);
Console.ReadLine();
}
示例2: ContainsTest
public void ContainsTest()
{
Scheduler target = new Scheduler();
// Add jobs and assert
uint max = 10;
Job[] jobs = new Job[max];
for (uint i = 1; i <= max; i++) {
Job job = new Job("Contains test "+i, owner, 1, i/2);
jobs[i - 1] = job;
target.AddJob(job);
Assert.IsTrue(target.Contains(job));
}
// Remove jobs and assert
for (uint i = max - 1; i > 0; i--) {
target.RemoveJob(jobs[i]);
Assert.IsFalse(target.Contains(jobs[i]));
}
}
示例3: TotalNumberOfJobsTest
public void TotalNumberOfJobsTest()
{
Scheduler target = new Scheduler();
// Add jobs and assert
uint max = 10;
Job[] jobs = new Job[max];
Assert.AreEqual((uint)0, target.TotalNumberOfJobs());
for (uint i = 1; i <= max; i++) {
Job job = new Job("TotalNumberOfJobs test"+i, owner, 1, i/2);
jobs[i - 1] = job;
target.AddJob(job);
Assert.AreEqual(i, target.TotalNumberOfJobs());
}
// Remove jobs and assert
for (uint i = max - 1; i > 0; i--) {
target.RemoveJob(jobs[i]);
Assert.AreEqual(i, target.TotalNumberOfJobs());
}
}
示例4: RemoveJobTest
public void RemoveJobTest()
{
Scheduler target = new Scheduler();
Job job = new Job("RemoveJob test", owner, 4, (float)1.4);
target.AddJob(job);
target.RemoveJob(job);
Assert.IsNull(target.PopJob());
}