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); } }
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); }