예제 #1
0
        protected List <IStorePropertyBag> RetrieveItems(ComparisonFilter conversationFilter, ICollection <PropertyDefinition> headerPropertyDefinition, out Dictionary <StoreObjectId, List <StoreObjectId> > itemsRetrievalFailed)
        {
            List <IStorePropertyBag> list = new List <IStorePropertyBag>(1000);
            ICollection <NativeStorePropertyDefinition> nativePropertyDefinitions = StorePropertyDefinition.GetNativePropertyDefinitions <PropertyDefinition>(PropertyDependencyType.NeedForRead, headerPropertyDefinition);

            itemsRetrievalFailed = new Dictionary <StoreObjectId, List <StoreObjectId> >();
            using (IFolder searchFolder = this.GetSearchFolder(headerPropertyDefinition))
            {
                try
                {
                    using (IQueryResult queryResult = this.GetQueryResult(searchFolder, conversationFilter, headerPropertyDefinition))
                    {
                        IStorePropertyBag[] propertyBags = queryResult.GetPropertyBags(1000);
                        while (propertyBags.Length != 0)
                        {
                            IStorePropertyBag[] array = propertyBags;
                            int i = 0;
                            while (i < array.Length)
                            {
                                IStorePropertyBag storePropertyBag = array[i];
                                Dictionary <StoreObjectId, List <StoreObjectId> > itemsFailedToRetrieve = this.GetItemsFailedToRetrieve(storePropertyBag, nativePropertyDefinitions);
                                if (itemsFailedToRetrieve != null)
                                {
                                    using (Dictionary <StoreObjectId, List <StoreObjectId> > .Enumerator enumerator = itemsFailedToRetrieve.GetEnumerator())
                                    {
                                        while (enumerator.MoveNext())
                                        {
                                            KeyValuePair <StoreObjectId, List <StoreObjectId> > keyValuePair = enumerator.Current;
                                            itemsRetrievalFailed.Add(keyValuePair.Key, keyValuePair.Value);
                                        }
                                        goto IL_A7;
                                    }
                                    goto IL_9F;
                                }
                                goto IL_9F;
IL_A7:
                                i++;
                                continue;
IL_9F:
                                list.Add(storePropertyBag);
                                goto IL_A7;
                            }
                            propertyBags = queryResult.GetPropertyBags(1000);
                        }
                    }
                }
                catch (StoragePermanentException ex)
                {
                    if (!(ex.InnerException is MapiExceptionConversationNotFound))
                    {
                        throw;
                    }
                    return(null);
                }
            }
            return(list);
        }
예제 #2
0
        private static Dictionary <PropertyDefinition, int> MapProperties()
        {
            NavigationNodeCollection.nativeStorePropertyDefinitions = StorePropertyDefinition.GetNativePropertyDefinitions <PropertyDefinition>(PropertyDependencyType.AllRead, NavigationNodeCollection.AllProperties);
            Dictionary <PropertyDefinition, int> dictionary = new Dictionary <PropertyDefinition, int>(NavigationNodeCollection.nativeStorePropertyDefinitions.Count);
            int num = 0;

            foreach (NativeStorePropertyDefinition key in NavigationNodeCollection.nativeStorePropertyDefinitions)
            {
                dictionary[key] = num++;
            }
            return(dictionary);
        }
예제 #3
0
        protected NavigationNode(PropertyDefinition[] additionalProperties, object[] values, Dictionary <PropertyDefinition, int> propertyMap)
        {
            HashSet <PropertyDefinition> hashSet = new HashSet <PropertyDefinition>(NavigationNode.coreProperties);

            hashSet.UnionWith(additionalProperties);
            ICollection <NativeStorePropertyDefinition> nativePropertyDefinitions = StorePropertyDefinition.GetNativePropertyDefinitions <PropertyDefinition>(PropertyDependencyType.AllRead, hashSet);

            object[] array = new object[nativePropertyDefinitions.Count];
            int      num   = 0;

            foreach (NativeStorePropertyDefinition key in nativePropertyDefinitions)
            {
                array[num++] = values[propertyMap[key]];
            }
            this.propertyBag = new MemoryPropertyBag();
            this.propertyBag.PreLoadStoreProperty <NativeStorePropertyDefinition>(nativePropertyDefinitions, array);
            this.propertyBag.SetAllPropertiesLoaded();
            this.ClearDirty();
            this.isNew = false;
        }
예제 #4
0
 private IStorePropertyBag CalculatePropertyBag(IStorePropertyBag queriedPropertyBag, IItem item, PropertyDefinition[] additionalPropertyDefinitions)
 {
     if (additionalPropertyDefinitions != null && additionalPropertyDefinitions.Length > 0)
     {
         ICollection <NativeStorePropertyDefinition> nativePropertyDefinitions = StorePropertyDefinition.GetNativePropertyDefinitions <PropertyDefinition>(PropertyDependencyType.NeedForRead, additionalPropertyDefinitions);
         PropertyDefinition[]   array = nativePropertyDefinitions.ToArray <NativeStorePropertyDefinition>();
         QueryResultPropertyBag queryResultPropertyBag;
         if (queriedPropertyBag != null)
         {
             queryResultPropertyBag = new QueryResultPropertyBag(queriedPropertyBag, array, item.GetProperties(array));
         }
         else
         {
             queryResultPropertyBag = new QueryResultPropertyBag((StoreSession)item.Session, array);
             queryResultPropertyBag.SetQueryResultRow(item.GetProperties(array));
         }
         return(queryResultPropertyBag.AsIStorePropertyBag());
     }
     if (queriedPropertyBag != null)
     {
         return(queriedPropertyBag);
     }
     return(null);
 }