示例#1
0
 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;
 }
示例#2
0
 public override void CopyFrom(object obj)
 {
     if (obj is TZID)
     {
         TZID tzid = (TZID)obj;
         this.GloballyUnique = tzid.GloballyUnique;
         this.ID             = tzid.ID;
     }
 }
示例#3
0
        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;
        }
示例#4
0
 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;
 }
示例#5
0
 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);
 }
示例#6
0
        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);
        }
示例#7
0
 public void InitAll()
 {
     TotalTime = new TimeSpan(0);
     tzid = new TZID("US-Eastern");
 }
示例#8
0
 /// <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;
 }
示例#9
0
 public void InitAll()
 {            
     tzid = new TZID("US-Eastern");
 }
示例#10
0
 public iCalDateTime(int year, int month, int day, TZID tzid, iCalendar iCal)
     : this(year, month, day, 0, 0, 0, tzid, iCal)
 {
 }
示例#11
0
 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;
 }
示例#12
0
 public Date_Time(int year, int month, int day, TZID tzid, iCalendar iCal)
     : this(year, month, day, 0, 0, 0, tzid, iCal) { }
示例#13
0
 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;
 }
示例#14
0
 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;
 }
示例#15
0
        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;
        }