本文整理汇总了C#中IntervalUnit类的典型用法代码示例。如果您正苦于以下问题:C# IntervalUnit类的具体用法?C# IntervalUnit怎么用?C# IntervalUnit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IntervalUnit类属于命名空间,在下文中一共展示了IntervalUnit类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RecurringTimeFrequency
public RecurringTimeFrequency(int interval, IntervalUnit unit, TimeSpan startTime, TimeSpan endTime)
{
this.Interval = interval;
this.Unit = unit;
this.StartTime = startTime;
this.EndTime = endTime;
}
示例2: CalendarIntervalTriggerImpl
/// <summary>
/// Create a <see cref="CalendarIntervalTriggerImpl" /> that will occur immediately, and
/// repeat at the the given interval.
/// </summary>
/// <param name="name">Name for the trigger instance.</param>
/// <param name="intervalUnit">The repeat interval unit (minutes, days, months, etc).</param>
/// <param name="repeatInterval">The number of milliseconds to pause between the repeat firing.</param>
public CalendarIntervalTriggerImpl(string name, IntervalUnit intervalUnit, int repeatInterval)
: this(name, null, intervalUnit, repeatInterval)
{
}
示例3: TranslatedAdd
private static DateTimeOffset TranslatedAdd(DateTimeOffset date, IntervalUnit unit, int amountToAdd)
{
switch (unit)
{
case IntervalUnit.Day:
return date.AddDays(amountToAdd);
case IntervalUnit.Hour:
return date.AddHours(amountToAdd);
case IntervalUnit.Minute:
return date.AddMinutes(amountToAdd);
case IntervalUnit.Month:
return date.AddMonths(amountToAdd);
case IntervalUnit.Second:
return date.AddSeconds(amountToAdd);
case IntervalUnit.Millisecond:
return date.AddMilliseconds(amountToAdd);
case IntervalUnit.Week:
return date.AddDays(amountToAdd*7);
case IntervalUnit.Year:
return date.AddYears(amountToAdd);
default:
throw new ArgumentException("Unknown IntervalUnit");
}
}
示例4: FutureDate
public static DateTimeOffset FutureDate(int interval, IntervalUnit unit)
{
return TranslatedAdd(SystemTime.Now(), unit, interval);
}
示例5: DailyTimeIntervalTriggerImpl
/// <summary>
/// Create a <see cref="IDailyTimeIntervalTrigger" /> that will occur at the given time,
/// fire the identified job and repeat at the given
/// interval until the given end time.
/// </summary>
/// <param name="name"></param>
/// <param name="group"></param>
/// <param name="jobName"></param>
/// <param name="jobGroup"></param>
/// <param name="startTimeUtc">A <see cref="DateTimeOffset" /> set to the time for the <see cref="ITrigger" />to fire.</param>
/// <param name="endTimeUtc">A <see cref="DateTimeOffset" /> set to the time for the <see cref="ITrigger" />to quit repeat firing.</param>
/// <param name="startTimeOfDayUtc">The <see cref="TimeOfDay" /> that the repeating should begin occurring.</param>
/// <param name="endTimeOfDayUtc">The <see cref="TimeOfDay" /> that the repeating should stop occurring.</param>
/// <param name="intervalUnit">The repeat interval unit. The only intervals that are valid for this type of trigger are
/// <see cref="IntervalUnit.Second"/>, <see cref="IntervalUnit.Minute"/>, and <see cref="IntervalUnit.Hour"/>.</param>
/// <param name="repeatInterval">The number of milliseconds to pause between the repeat firing.</param>
public DailyTimeIntervalTriggerImpl(string name, string group, string jobName,
string jobGroup, DateTimeOffset startTimeUtc, DateTimeOffset? endTimeUtc,
TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc,
IntervalUnit intervalUnit, int repeatInterval)
: base(name, group, jobName, jobGroup)
{
StartTimeUtc = startTimeUtc;
EndTimeUtc = endTimeUtc;
RepeatIntervalUnit = intervalUnit;
RepeatInterval = repeatInterval;
StartTimeOfDay = startTimeOfDayUtc;
EndTimeOfDay = endTimeOfDayUtc;
}
示例6: DateAdd
public static DateTimeOffset DateAdd(DateTimeOffset timestamp, int interval, IntervalUnit intervalUnit)
{
throw Invalid();
}
示例7: CreateProduct
public IProduct CreateProduct(int ProductFamilyID, string Name, string Handle, int PriceInCents, int Interval, IntervalUnit IntervalUnit, string AccountingCode, string Description)
{
throw new NotImplementedException();
}
示例8: Interval
/// <summary>
/// Constructs a interval given an value in milliseconds
/// </summary>
public Interval(int value)
{
_value = value;
_mode = IntervalUnit.Millisecond;
AsTimeSpan = TimeSpan.FromMilliseconds(value);
}