void Set(TDayEvent de) { nType = de.nType; nData = de.nData; Time.Set(de.Time); nDst = de.nDst; }
public bool AddEvent(GregorianDateTime time, int inType, int inData, int inDst) { TDayEvent de = new TDayEvent(); de.Time = new GregorianDateTime(time); switch (inDst) { case 0: de.nDst = 0; break; case 1: if (de.Time.shour >= 2 / 24.0) { de.Time.shour += 1 / 24.0; de.Time.NormalizeValues(); de.nDst = 1; } else { de.nDst = 0; } break; case 2: de.Time.shour += 1 / 24.0; de.Time.NormalizeValues(); de.nDst = 1; break; case 3: if (de.Time.shour <= 2 / 24.0) { de.Time.shour += 1 / 24.0; de.Time.NormalizeValues(); de.nDst = 1; } else { de.nDst = 0; } break; default: de.nDst = 0; break; } de.nData = inData; de.nType = inType; p_events.Add(de); return(true); }
public bool AddEvent(GregorianDateTime inTime, int inType, int inData, DstTypeChange inDst) { TDayEvent de = new TDayEvent(); de.Time = new GregorianDateTime(); de.Time.Set(inTime); switch (inDst) { case DstTypeChange.DstOff: de.nDst = 0; break; case DstTypeChange.DstStart: if (de.Time.shour >= 2 / 24.0) { de.Time.shour += 1 / 24.0; de.Time.NormalizeValues(); de.nDst = 1; } else { de.nDst = 0; } break; case DstTypeChange.DstOn: de.Time.shour += 1 / 24.0; de.Time.NormalizeValues(); de.nDst = 1; break; case DstTypeChange.DstEnd: if (de.Time.shour <= 2 / 24.0) { de.Time.shour += 1 / 24.0; de.Time.NormalizeValues(); de.nDst = 1; } else { de.nDst = 0; } break; default: de.nDst = 0; break; } de.nData = inData; de.nType = inType; p_events.Add(de); return(true); }