private SchedulingRule(SerializationInfo info, StreamingContext context) { _scope = (SchedulingScope)info.GetValue("_scope", typeof(SchedulingScope)); _specificDateTime = info.GetDateTime("_specificDateTime"); _maxDeviationAfter = (TimeSpan)info.GetValue("_maxDeviationAfter", typeof(TimeSpan)); _maxDeviationBefore = (TimeSpan)info.GetValue("_maxDeviationBefore", typeof(TimeSpan)); _days = (int[])info.GetValue("_days", typeof(int[])); _times = (TimeSpan[])info.GetValue("_times", typeof(TimeSpan[])); if (info.GetBoolean("IsLocked")) { ((ILockable)this).Lock(); } }
private SchedulingInfo(SerializationInfo info, StreamingContext context) { _requestedTime = info.GetDateTime("_requestedTime"); _expectedStartTime = info.GetDateTime("_expectedStartTime"); _expectedEndTime = info.GetDateTime("_expectedEndTime"); _maxDeviationAfter = (TimeSpan)info.GetValue("_maxDeviationAfter", typeof(TimeSpan)); _maxDeviationBefore = (TimeSpan)info.GetValue("_maxDeviationBefore", typeof(TimeSpan)); _schedulingStatus = (SchedulingStatus)info.GetValue("_schedulingStatus", typeof(SchedulingStatus)); _schedulingScope = (SchedulingScope)info.GetValue("_schedulingScope", typeof(SchedulingScope)); if (info.GetBoolean("IsLocked")) { ((ILockable)this).Lock(); } }
public SchedulingRule( SchedulingScope scope, DateTime specificDateTime = default(DateTime), TimeSpan maxDeviationAfter = default(TimeSpan), TimeSpan maxDeviationBefore = default(TimeSpan), int[] days = null, TimeSpan[] times = null ) { _scope = scope; _specificDateTime = specificDateTime; if (maxDeviationAfter != default(TimeSpan)) { _maxDeviationAfter = maxDeviationAfter; } if (maxDeviationBefore != default(TimeSpan)) { _maxDeviationBefore = maxDeviationBefore; } _days = days; _times = times; }
/// <summary> /// Constructor /// </summary> public Scheduling() { SchedulingLimits = new SchedulingLimits(); SchedulingScope = new SchedulingScope(); }