Exemplo n.º 1
0
 internal static object[][] GetRecurringMasters(CalendarFolder calendarFolder, params PropertyDefinition[] properties)
 {
     object[][] array;
     using (QueryResult queryResult = calendarFolder.ItemQuery(ItemQueryType.None, CalendarQuery.RecurringItemFilter, null, properties))
     {
         queryResult.SeekToOffset(SeekReference.OriginBeginning, 0);
         int  num  = 10000;
         int  num2 = num;
         bool flag = true;
         List <object[][]> list = new List <object[][]>();
         while (num2 > 0 && flag)
         {
             object[][] rows = queryResult.GetRows(num2);
             num2 -= rows.Length;
             if (list.Count == 0 || rows.Length > 0)
             {
                 list.Add(rows);
             }
             if (rows.Length == 0)
             {
                 flag = false;
             }
         }
         if (list.Count == 1)
         {
             array = list[0];
         }
         else
         {
             array = new object[num - num2][];
             int num3 = 0;
             foreach (object[][] array2 in list)
             {
                 for (int i = 0; i < array2.Length; i++)
                 {
                     array[num3++] = array2[i];
                 }
             }
         }
     }
     return(array);
 }
Exemplo n.º 2
0
        private bool MasterMessageArrived(MailboxSession session, MeetingSeriesMessageOrderingAgent.SeriesHeadersData headersData, out StoreId instanceCalendarItemId)
        {
            OrFilter seekFilter = new OrFilter(new QueryFilter[]
            {
                new ComparisonFilter(ComparisonOperator.Equal, CalendarItemBaseSchema.GlobalObjectId, headersData.InstanceGoid),
                new ComparisonFilter(ComparisonOperator.Equal, CalendarItemBaseSchema.GlobalObjectId, headersData.MasterGoid)
            });

            instanceCalendarItemId = null;
            bool flag = false;

            using (CalendarFolder calendarFolder = CalendarFolder.Bind(session, DefaultFolderType.Calendar))
            {
                using (QueryResult queryResult = calendarFolder.ItemQuery(ItemQueryType.None, null, MeetingSeriesMessageOrderingAgent.SortByGoid, MeetingSeriesMessageOrderingAgent.AdditionalQueryProperties))
                {
                    bool flag2 = true;
                    while (queryResult.SeekToCondition(flag2 ? SeekReference.OriginBeginning : SeekReference.OriginCurrent, seekFilter, SeekToConditionFlags.AllowExtendedFilters))
                    {
                        flag2 = false;
                        IStorePropertyBag[] propertyBags = queryResult.GetPropertyBags(1);
                        if (propertyBags.Length == 1)
                        {
                            IStorePropertyBag storePropertyBag = propertyBags[0];
                            if (ObjectClass.IsCalendarItemSeries(storePropertyBag.GetValueOrDefault <string>(StoreObjectSchema.ItemClass, null)))
                            {
                                int valueOrDefault = storePropertyBag.GetValueOrDefault <int>(CalendarItemBaseSchema.AppointmentSequenceNumber, -1);
                                flag = (headersData.SeriesSequenceNumber <= valueOrDefault);
                                MeetingSeriesMessageOrderingAgent.tracer.TraceDebug <int, int, bool>((long)this.GetHashCode(), "Message SSN: {0}, Master SSN: {1} => Master message arrived: {2}.", headersData.SeriesSequenceNumber, valueOrDefault, flag);
                            }
                            else
                            {
                                instanceCalendarItemId = storePropertyBag.GetValueOrDefault <StoreId>(ItemSchema.Id, null);
                            }
                        }
                    }
                }
            }
            return(flag);
        }