public override bool Equals(object obj) { iCalTimeZoneInfo tzi = obj as iCalTimeZoneInfo; if (tzi != null) { return(object.Equals(TimeZoneName, tzi.TimeZoneName) && object.Equals(OffsetFrom, tzi.OffsetFrom) && object.Equals(OffsetTo, tzi.OffsetTo)); } return(base.Equals(obj)); }
// add VTIMEZONE to intermediate or final ics outputs public static void AddTimezoneToDDayICal(DDay.iCal.iCalendar ical, TimeZoneInfo tzinfo) { var timezone = DDay.iCal.iCalTimeZone.FromSystemTimeZone(tzinfo); //timezone.TZID = tzinfo.Id; // not being set in DDay.iCal 0.8 for some reason /* * Interesting situation if the source calendar says, e.g., America/Chicago, but * the OS says, e.g., Central. In that case, DDay's UTC property method will fail to match * the names and it will fall back to the OS conversion: * * value = DateTime.SpecifyKind(Value, DateTimeKind.Local).ToUniversalTime(); * * This happens when: * - A recurring event has a start and end * - DDay substracts DTEnd.UTC - DTStart.UTC * * Todo: Recheck all this when upgraded to DDay 1.0 */ if (timezone.TimeZoneInfos.Count == 0) { var dday_tzinfo_standard = new DDay.iCal.iCalTimeZoneInfo(); dday_tzinfo_standard.Name = "STANDARD"; dday_tzinfo_standard.TimeZoneName = tzinfo.StandardName; //dday_tzinfo_standard.Start.Date = new DateTime(1970, 1, 1); var utcOffset = tzinfo.BaseUtcOffset; dday_tzinfo_standard.TZOffsetFrom = new DDay.iCal.UTCOffset(utcOffset); dday_tzinfo_standard.TZOffsetTo = new DDay.iCal.UTCOffset(utcOffset); // Add the "standard" time rule to the time zone timezone.AddChild(dday_tzinfo_standard); } ical.AddChild(timezone); }
protected bool Equals(iCalTimeZoneInfo other) { return(base.Equals(other) && Equals(m_Evaluator, other.m_Evaluator)); }