public static uint[] GetTimeLine(DateTime startingDate, int durationInDays, IContainTimingAttributes timing) { uint [] Result = new uint[durationInDays]; int startingIndex = ((DateTime) timing.TimeA - startingDate).Days; if (startingIndex < 0) startingIndex = 0; int endingIndex = ((DateTime)timing.TimeB - startingDate).Days; while ((startingIndex <= endingIndex) && (startingIndex < Result.Length)) Result[startingIndex++] = ActivSetterAllHours; return Result; }
public void RefreshTimings(IContainTimingAttributes sourceTiming, IContainTimingAttributes targetTiming, int? beitragDuration, int? beitragEndeDistanzZuInfoStop, int? beitragEndeDistanzZuInfoStart, int? beitragStartDistanzZuInfoStop, int? beitragStartDistanzZuInfoStart) { if (beitragEndeDistanzZuInfoStop != null) { targetTiming.TimeB = ((DateTime) sourceTiming.TimeB).Date .AddDays((double) beitragEndeDistanzZuInfoStop).AddMinutes(1439); } if (beitragEndeDistanzZuInfoStart != null) { targetTiming.TimeB = ((DateTime) sourceTiming.TimeA).Date .AddDays((double) beitragEndeDistanzZuInfoStart).Date.AddMinutes(1439); } if (beitragStartDistanzZuInfoStop != null) { targetTiming.TimeA = ((DateTime) sourceTiming.TimeB).Date .AddDays((double) beitragStartDistanzZuInfoStop); } if (beitragStartDistanzZuInfoStart != null) { targetTiming.TimeA = ((DateTime) sourceTiming.TimeA).Date .AddDays((double) beitragStartDistanzZuInfoStart).Date; } if (beitragDuration != null) { if ((beitragEndeDistanzZuInfoStop != null) || (beitragEndeDistanzZuInfoStart != null)) targetTiming.TimeA = ((DateTime) targetTiming.TimeB).AddDays(-(double) beitragDuration); else targetTiming.TimeB = ((DateTime) targetTiming.TimeA).AddDays((double) beitragDuration); } targetTiming.TimeB = ((DateTime) targetTiming.TimeB).Date.AddMinutes(1439); }
public TimingsModell(IContainTimingAttributes timing) { TimingToProcess = timing; ParentInformationAddOn = null; }