Exemplo n.º 1
0
        internal static void DenormalizeTimeProperty(PropertyBag propertyBag, ExDateTime newTime, GuidIdPropertyDefinition utcTimeProperty, PropertyTagPropertyDefinition legacyUtcTimeProperty)
        {
            byte[]     valueOrDefault = propertyBag.GetValueOrDefault <byte[]>(InternalSchema.TimeZoneDefinitionStart);
            ExTimeZone legacyTimeZone;

            if (O12TimeZoneFormatter.TryParseTimeZoneBlob(valueOrDefault, string.Empty, out legacyTimeZone))
            {
                ExDateTime exDateTime = TimeZoneHelper.DeNormalizeToUtcTime(newTime, legacyTimeZone);
                propertyBag.SetProperty(utcTimeProperty, exDateTime);
                if (legacyUtcTimeProperty != null)
                {
                    propertyBag.SetProperty(legacyUtcTimeProperty, exDateTime);
                }
            }
        }