Esempio n. 1
0
        private static void GetCalendarMethodAndType(IList <Item> items, out CalendarMethod calendarMethod, out CalendarType calendarType)
        {
            CalendarMethod?calendarMethod2 = null;
            CalendarType?  calendarType2   = null;

            if (items.Count > 0)
            {
                foreach (Item item in items)
                {
                    CalendarMethod icalMethod = CalendarUtil.GetICalMethod(item);
                    if (icalMethod == CalendarMethod.None)
                    {
                        throw new ConversionFailedException(ConversionFailureReason.ConverterInternalFailure);
                    }
                    if (calendarMethod2 != null && icalMethod != calendarMethod2.Value)
                    {
                        throw new InvalidOperationException(ServerStrings.InconsistentCalendarMethod(calendarMethod2.Value.ToString(), item.Id.ToString()));
                    }
                    calendarMethod2 = new CalendarMethod?(icalMethod);
                    CalendarType alternateCalendarType = VEvent.GetAlternateCalendarType(item);
                    if (calendarType2 != null && alternateCalendarType != calendarType2)
                    {
                        throw new InvalidOperationException(ServerStrings.InconsistentCalendarMethod(calendarType2.Value.ToString(), item.Id.ToString()));
                    }
                    calendarType2 = new CalendarType?(alternateCalendarType);
                }
            }
            calendarMethod = ((calendarMethod2 != null) ? calendarMethod2.Value : CalendarMethod.Publish);
            calendarType   = ((calendarType2 != null) ? calendarType2.Value : CalendarType.Default);
        }
Esempio n. 2
0
 internal static bool CanConvertToMeetingMessage(Item item)
 {
     return(CalendarUtil.GetICalMethod(item) != CalendarMethod.None || ObjectClass.IsFailedInboundICal(item.ClassName));
 }