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));
        }
        protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag)
        {
            ExDateTime?wallClockTime = StartWallClockProperty.GetWallClockTime(propertyBag, InternalSchema.MapiStartTime, InternalSchema.MapiPRStartDate, new NativeStorePropertyDefinition[]
            {
                InternalSchema.TimeZoneDefinitionStart,
                InternalSchema.TimeZoneDefinitionRecurring,
                InternalSchema.TimeZoneDefinitionEnd
            });

            if (wallClockTime == null)
            {
                return(new PropertyError(this, PropertyErrorCode.NotFound));
            }
            return(wallClockTime.Value);
        }