コード例 #1
0
        internal static ExDateTime?GetWallClockTime(PropertyBag.BasicPropertyStore propertyBag, GuidIdPropertyDefinition utcTimeProperty, PropertyTagPropertyDefinition legacyUtcTimeProperty, NativeStorePropertyDefinition[] timeZoneBlobPropertyDefinitions)
        {
            ExDateTime?normalizedTime = StartTimeProperty.GetNormalizedTime(propertyBag, utcTimeProperty, legacyUtcTimeProperty);

            if (normalizedTime == null)
            {
                return(null);
            }
            byte[] array = null;
            foreach (NativeStorePropertyDefinition propertyDefinition in timeZoneBlobPropertyDefinitions)
            {
                array = propertyBag.GetValueOrDefault <byte[]>(propertyDefinition);
                if (array != null)
                {
                    break;
                }
            }
            if (array == null)
            {
                ExTraceGlobals.StorageTracer.TraceWarning(0L, "Could not determine suitable time zone");
            }
            ExTimeZone exTimeZone = StartWallClockProperty.FindBestMatchingTimeZone(array);

            if (exTimeZone != null)
            {
                return(new ExDateTime?(exTimeZone.ConvertDateTime(normalizedTime.Value)));
            }
            return(new ExDateTime?(normalizedTime.Value));
        }
コード例 #2
0
        internal static object InternalTryGetDateTimeValue(PropertyBag.BasicPropertyStore propertyBag, StorePropertyDefinition property, GuidIdPropertyDefinition mapiUtcTimeProperty, PropertyTagPropertyDefinition mapiLegacyUtcTimeProperty)
        {
            ExDateTime?normalizedTime = StartTimeProperty.GetNormalizedTime(propertyBag, mapiUtcTimeProperty, mapiLegacyUtcTimeProperty);

            if (normalizedTime != null)
            {
                return(normalizedTime.Value);
            }
            return(new PropertyError(property, PropertyErrorCode.NotFound));
        }
コード例 #3
0
        internal static void RecalculateNormalizedTimeProperty(PropertyBag.BasicPropertyStore propertyBag, GuidIdPropertyDefinition utcTimeProperty, PropertyTagPropertyDefinition legacyUtcTimeProperty, ExTimeZone newTimeZone)
        {
            if (newTimeZone == null || newTimeZone == ExTimeZone.UtcTimeZone || newTimeZone == ExTimeZone.UnspecifiedTimeZone)
            {
                return;
            }
            ExDateTime?normalizedTime = StartTimeProperty.GetNormalizedTime(propertyBag, utcTimeProperty, legacyUtcTimeProperty);

            if (normalizedTime != null)
            {
                ExDateTime exDateTime = newTimeZone.ConvertDateTime(normalizedTime.Value);
                propertyBag.SetValueWithFixup(utcTimeProperty, exDateTime.ToUtc());
                if (legacyUtcTimeProperty != null)
                {
                    propertyBag.SetValueWithFixup(legacyUtcTimeProperty, exDateTime.ToUtc());
                }
            }
        }
コード例 #4
0
 internal static ExDateTime?GetNormalizedTime(PropertyBag propertyBag, GuidIdPropertyDefinition utcTimeProperty, PropertyTagPropertyDefinition legacyUtcTimeProperty)
 {
     return(StartTimeProperty.GetNormalizedTime((PropertyBag.BasicPropertyStore)propertyBag, utcTimeProperty, legacyUtcTimeProperty));
 }