Esempio n. 1
0
        public IDateTime ToTimeZone(TimeZoneObservance tzo)
        {
            ITimeZoneInfo tzi = tzo.TimeZoneInfo;

            if (tzi != null)
            {
                return(new iCalDateTime(tzi.OffsetTo.ToLocal(UTC), tzo));
            }
            return(null);
        }
Esempio n. 2
0
        public IDateTime ToTimeZone(TimeZoneObservance tzo)
        {
            var tzi = tzo.TimeZoneInfo;

            if (tzi != null)
            {
                var tzId = tzo.TimeZoneInfo.TzId;
                return(new iCalDateTime(tzi.OffsetTo.ToLocal(AsUtc), tzo));
            }
            return(null);
        }
Esempio n. 3
0
        private void Initialize(DateTime value, TimeZoneObservance tzo)
        {
            if (value.Kind == DateTimeKind.Utc)
            {
                this.IsUniversalTime = true;
            }

            // Convert all incoming values to UTC.
            this.Value   = DateTime.SpecifyKind(value, DateTimeKind.Utc);
            this.HasDate = true;
            this.HasTime = (value.Second == 0 && value.Minute == 0 && value.Hour == 0) ? false : true;
            if (tzo.TimeZoneInfo != null)
            {
                this.TZID = tzo.TimeZoneInfo.TZID;
            }
            this.TimeZoneObservance = tzo;
            this.AssociatedObject   = tzo.TimeZoneInfo;
        }
Esempio n. 4
0
 public iCalDateTime(DateTime value, TimeZoneObservance tzo)
 {
     Initialize(value, tzo);
 }
Esempio n. 5
0
 public iCalDateTime(DateTime value, TimeZoneObservance tzo)
 {
     Initialize(value, tzo);
 }
Esempio n. 6
0
 public IDateTime ToTimeZone(TimeZoneObservance tzo)
 {
     ITimeZoneInfo tzi = tzo.TimeZoneInfo;
     if (tzi != null)
         return new iCalDateTime(tzi.OffsetTo.ToLocal(UTC), tzo);
     return null;
 }
Esempio n. 7
0
        private void Initialize(DateTime value, TimeZoneObservance tzo)
        {
            if (value.Kind == DateTimeKind.Utc)
                this.IsUniversalTime = true;

            // Convert all incoming values to UTC.
            this.Value = DateTime.SpecifyKind(value, DateTimeKind.Utc);
            this.HasDate = true;
            this.HasTime = (value.Second == 0 && value.Minute == 0 && value.Hour == 0) ? false : true;
            if (tzo.TimeZoneInfo != null)
                this.TZID = tzo.TimeZoneInfo.TZID;
            this.TimeZoneObservance = tzo;
            this.AssociatedObject = tzo.TimeZoneInfo;
        }