當前位置: 首頁>>代碼示例>>C#>>正文


C# CalendarIntervalTriggerImpl.GetScheduleBuilder方法代碼示例

本文整理匯總了C#中Quartz.Impl.Triggers.CalendarIntervalTriggerImpl.GetScheduleBuilder方法的典型用法代碼示例。如果您正苦於以下問題:C# CalendarIntervalTriggerImpl.GetScheduleBuilder方法的具體用法?C# CalendarIntervalTriggerImpl.GetScheduleBuilder怎麽用?C# CalendarIntervalTriggerImpl.GetScheduleBuilder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Quartz.Impl.Triggers.CalendarIntervalTriggerImpl的用法示例。


在下文中一共展示了CalendarIntervalTriggerImpl.GetScheduleBuilder方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ShouldGetScheduleBuilderWithSameSettingsAsTrigger

        public void ShouldGetScheduleBuilderWithSameSettingsAsTrigger()
        {
            var startTime = DateTimeOffset.UtcNow;
            var endTime = DateTimeOffset.UtcNow.AddDays(1);
            var trigger = new CalendarIntervalTriggerImpl("name", "group", startTime, endTime, IntervalUnit.Hour, 10);
            trigger.PreserveHourOfDayAcrossDaylightSavings = true;
            trigger.SkipDayIfHourDoesNotExist = true;
            trigger.TimeZone = TimeZoneInfo.Utc;
            trigger.MisfireInstruction = MisfireInstruction.CalendarIntervalTrigger.FireOnceNow;
            var scheduleBuilder = trigger.GetScheduleBuilder();

            var cloned = (CalendarIntervalTriggerImpl) scheduleBuilder.Build();
            Assert.That(cloned.PreserveHourOfDayAcrossDaylightSavings, Is.EqualTo(trigger.PreserveHourOfDayAcrossDaylightSavings));
            Assert.That(cloned.SkipDayIfHourDoesNotExist, Is.EqualTo(trigger.SkipDayIfHourDoesNotExist));
            Assert.That(cloned.RepeatInterval, Is.EqualTo(trigger.RepeatInterval));
            Assert.That(cloned.RepeatIntervalUnit, Is.EqualTo(trigger.RepeatIntervalUnit));
            Assert.That(cloned.MisfireInstruction, Is.EqualTo(trigger.MisfireInstruction));
            Assert.That(cloned.TimeZone, Is.EqualTo(trigger.TimeZone));
        }
開發者ID:jvilalta,項目名稱:quartznet,代碼行數:19,代碼來源:CalendarIntervalTriggerTest.cs


注:本文中的Quartz.Impl.Triggers.CalendarIntervalTriggerImpl.GetScheduleBuilder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。