예제 #1
0
        /// <summary>
        /// Gets the offset to UTC based on this group's transitions.
        /// </summary>
        internal CustomTimeZoneCreateParams GetCustomTimeZoneCreationParams()
        {
            CustomTimeZoneCreateParams result = new CustomTimeZoneCreateParams();

            if (this.TransitionToDaylight != null)
            {
                result.DaylightDisplayName = this.TransitionToDaylight.TargetPeriod.Name;
            }

            result.StandardDisplayName = this.TransitionToStandard.TargetPeriod.Name;

            // Assume that the standard period's offset is the base offset to UTC.
            // EWS returns a positive offset for time zones that are behind UTC, and
            // a negative one for time zones ahead of UTC. TimeZoneInfo does it the other
            // way around.
            result.BaseOffsetToUtc = -this.TransitionToStandard.TargetPeriod.Bias;

            return(result);
        }
        /// <summary>
        /// Gets the offset to UTC based on this group's transitions.
        /// </summary>
        internal CustomTimeZoneCreateParams GetCustomTimeZoneCreationParams()
        {
            CustomTimeZoneCreateParams result = new CustomTimeZoneCreateParams();

            if (this.TransitionToDaylight != null)
            {
                result.DaylightDisplayName = this.TransitionToDaylight.TargetPeriod.Name;
            }

            result.StandardDisplayName = this.TransitionToStandard.TargetPeriod.Name;

            // Assume that the standard period's offset is the base offset to UTC.
            // EWS returns a positive offset for time zones that are behind UTC, and
            // a negative one for time zones ahead of UTC. TimeZoneInfo does it the other
            // way around.
            result.BaseOffsetToUtc = -this.TransitionToStandard.TargetPeriod.Bias;

            return result;
        }