예제 #1
0
        protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag)
        {
            string valueOrDefault = propertyBag.GetValueOrDefault <string>(InternalSchema.ItemClass);

            if (valueOrDefault == null)
            {
                return(RecurrenceType.None);
            }
            if (ObjectClass.IsTask(valueOrDefault) || ObjectClass.IsTaskRequest(valueOrDefault))
            {
                if (propertyBag.GetValueOrDefault <bool>(InternalSchema.IsOneOff))
                {
                    return(RecurrenceType.None);
                }
                byte[] valueOrDefault2 = propertyBag.GetValueOrDefault <byte[]>(InternalSchema.TaskRecurrence);
                return(RecurrenceTypeProperty.GetTaskRecurrenceTypeFromBlob(valueOrDefault2));
            }
            else
            {
                if (ObjectClass.IsCalendarItemCalendarItemOccurrenceOrRecurrenceException(valueOrDefault) || ObjectClass.IsMeetingMessage(valueOrDefault))
                {
                    return(propertyBag.GetValueOrDefault <RecurrenceType>(InternalSchema.MapiRecurrenceType));
                }
                return(RecurrenceType.None);
            }
        }
예제 #2
0
        private static RecurrenceType GetTaskRecurrenceTypeFromBlob(byte[] blob)
        {
            if (blob == null)
            {
                return(RecurrenceType.None);
            }
            RecurrenceType result;

            try
            {
                TaskRecurrence taskRecurrence = InternalRecurrence.InternalParseTask(blob, null, null, null);
                result = RecurrenceTypeProperty.TaskRecurrencePatternToRecurrenceType(taskRecurrence);
            }
            catch (RecurrenceFormatException)
            {
                result = RecurrenceType.None;
            }
            return(result);
        }