public Date_Time(DateTime value, TZID tzid, iCalendar iCal) : this() { this.Value = value; this.HasDate = true; this.HasTime = (value.Second == 0 && value.Minute == 0 && value.Hour == 0) ? false : true; this.TZID = tzid; this.iCalendar = iCal; }
public override void CopyFrom(object obj) { if (obj is TZID) { TZID tzid = (TZID)obj; this.GloballyUnique = tzid.GloballyUnique; this.ID = tzid.ID; } }
public iCalDateTime(DateTime value, TZID tzid, iCalendar iCal) : this() { if (value.Kind == DateTimeKind.Utc) { this.IsUniversalTime = true; } this.Value = DateTime.SpecifyKind(value, DateTimeKind.Utc); this.HasDate = true; this.HasTime = (value.Second == 0 && value.Minute == 0 && value.Hour == 0) ? false : true; this.TZID = tzid; this.iCalendar = iCal; }
public override bool Equals(object obj) { if (obj is TZID) { TZID tzid = (TZID)obj; return (this.GloballyUnique == tzid.GloballyUnique && this.ID == tzid.ID); } else if (obj is string) { object tzid = new TZID(); if (((TZID)tzid).TryParse(obj.ToString(), ref tzid)) return tzid.Equals(this); } return false; }
public override bool Equals(object obj) { if (obj is TZID) { TZID tzid = (TZID)obj; return(this.GloballyUnique.Equals(tzid.GloballyUnique) && this.ID.Equals(tzid.ID)); } else if (obj is string) { object tzid = new TZID(); if (((TZID)tzid).TryParse(obj.ToString(), ref tzid)) { return(tzid.Equals(this)); } } return(false); }
public override bool TryParse(string value, ref object obj) { TZID tzid = (TZID)obj; Match match = Regex.Match(value, @"(/)?([^\r]+)"); if (match.Success) { if (match.Groups[1].Success) { tzid.GloballyUnique = true; } tzid.ID = match.Groups[2].Value; return(true); } return(false); }
public void InitAll() { TotalTime = new TimeSpan(0); tzid = new TZID("US-Eastern"); }
/// <summary> /// Retrieves the <see cref="DDay.iCal.Components.TimeZone" /> object for the specified /// <see cref="TZID"/> (Time Zone Identifier). /// </summary> /// <param name="tzid">A valid <see cref="TZID"/> object, or a valid <see cref="TZID"/> string.</param> /// <returns>A <see cref="TimeZone"/> object for the <see cref="TZID"/>.</returns> public DDay.iCal.Components.TimeZone GetTimeZone(TZID tzid) { foreach (DDay.iCal.Components.TimeZone tz in TimeZones) { if (tz.TZID.Equals(tzid)) { return tz; } } return null; }
public void InitAll() { tzid = new TZID("US-Eastern"); }
public iCalDateTime(int year, int month, int day, TZID tzid, iCalendar iCal) : this(year, month, day, 0, 0, 0, tzid, iCal) { }
public iCalDateTime(int year, int month, int day, int hour, int minute, int second, TZID tzid, iCalendar iCal) : this(new DateTime(year, month, day, hour, minute, second, DateTimeKind.Local), tzid, iCal) { HasTime = true; }
public Date_Time(int year, int month, int day, TZID tzid, iCalendar iCal) : this(year, month, day, 0, 0, 0, tzid, iCal) { }
public Date_Time(int year, int month, int day, int hour, int minute, int second, TZID tzid, iCalendar iCal) : this(new DateTime(year, month, day, hour, minute, second, DateTimeKind.Local), tzid, iCal) { HasTime = true; }
public iCalDateTime(DateTime value, TZID tzid, iCalendar iCal) : this() { if (value.Kind == DateTimeKind.Utc) this.IsUniversalTime = true; this.Value = DateTime.SpecifyKind(value, DateTimeKind.Utc); this.HasDate = true; this.HasTime = (value.Second == 0 && value.Minute == 0 && value.Hour == 0) ? false : true; this.TZID = tzid; this.iCalendar = iCal; }