Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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;
        }
Ejemplo n.º 4
0
 public iCalDateTime(DateTime value, TimeZoneObservance tzo)
 {
     Initialize(value, tzo);
 }
Ejemplo n.º 5
0
 public iCalDateTime(DateTime value, TimeZoneObservance tzo)
 {
     Initialize(value, tzo);
 }
Ejemplo 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;
 }
Ejemplo 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;
        }