public static object[] FindItemBySharePointId(MailboxSession session, Guid sharepointId)
 {
     Util.ThrowOnNullArgument(session, "session");
     if (sharepointId == Guid.Empty)
     {
         throw new ArgumentNullException("sharepointId");
     }
     object[] array = AllItemsFolderHelper.RunQueryOnAllItemsFolder <object[]>(session, AllItemsFolderHelper.SupportedSortBy.SharePointId, sharepointId, null, delegate(QueryResult queryResult)
     {
         object[][] rows = queryResult.GetRows(1);
         if (rows == null || rows.Length <= 0)
         {
             return(null);
         }
         object[] array2 = new object[AllItemsFolderHelper.findItemBySharePointIdProps.Count];
         array2[0]       = ((VersionedId)rows[0][0]).ObjectId;
         array2[1]       = (StoreObjectId)rows[0][1];
         string text     = (string)rows[0][2];
         if (!string.IsNullOrEmpty(text))
         {
             array2[2] = new Uri(text);
         }
         else
         {
             array2[2] = null;
         }
         return(array2);
     }, AllItemsFolderHelper.findItemBySharePointIdProps);
     return(array ?? null);
 }
 public static G RunQueryOnAllItemsFolder <G>(MailboxSession session, AllItemsFolderHelper.SupportedSortBy supportedSortBy, object seekToValue, G defaultValue, AllItemsFolderHelper.DoQueryProcessing <G> queryProcessor, ICollection <PropertyDefinition> properties, ItemQueryType itemQueryType)
 {
     return(AllItemsFolderHelper.RunQueryOnAllItemsFolder <G>(session, supportedSortBy, delegate(QueryResult queryResult)
     {
         if (queryResult.SeekToCondition(SeekReference.OriginBeginning, new ComparisonFilter(ComparisonOperator.Equal, AllItemsFolderHelper.sortOrderMap[supportedSortBy][0].ColumnDefinition, seekToValue)))
         {
             return queryProcessor(queryResult);
         }
         return defaultValue;
     }, properties, itemQueryType));
 }
        public static IStorePropertyBag[] FindItemsFromInternetId(MailboxSession session, string internetMessageId, ItemQueryType itemQueryType, params PropertyDefinition[] propertyDefinitions)
        {
            Util.ThrowOnNullArgument(session, "session");
            Util.ThrowOnNullOrEmptyArgument(internetMessageId, "internetMessageId");
            Util.ThrowOnNullOrEmptyArgument(propertyDefinitions, "propertyDefinitions");
            ICollection <PropertyDefinition> properties = InternalSchema.Combine <PropertyDefinition>(propertyDefinitions, new PropertyDefinition[]
            {
                ItemSchema.InternetMessageId,
                ItemSchema.InternetMessageIdHash
            });
            int internetMessageIdHash = (int)AllItemsFolderHelper.GetHashValue(internetMessageId);

            IStorePropertyBag[] array = AllItemsFolderHelper.RunQueryOnAllItemsFolder <IStorePropertyBag[]>(session, AllItemsFolderHelper.SupportedSortBy.InternetMessageIdHash, internetMessageIdHash, null, (QueryResult queryResult) => AllItemsFolderHelper.ProcessQueryResult(queryResult, internetMessageId, internetMessageIdHash), properties, itemQueryType);
            return(array ?? Array <IStorePropertyBag> .Empty);
        }
예제 #4
0
 public G RunQueryOnAllItemsFolder <G>(IMailboxSession session, AllItemsFolderHelper.SupportedSortBy supportedSortBy, AllItemsFolderHelper.DoQueryProcessing <G> queryProcessor, ICollection <PropertyDefinition> properties)
 {
     return(AllItemsFolderHelper.RunQueryOnAllItemsFolder <G>((MailboxSession)session, supportedSortBy, queryProcessor, properties));
 }
예제 #5
0
 public T RunQueryOnAllItemsFolder <T>(IMailboxSession session, AllItemsFolderHelper.SupportedSortBy supportedSortBy, object seekToValue, T defaultValue, AllItemsFolderHelper.DoQueryProcessing <T> queryProcessor, ICollection <PropertyDefinition> properties)
 {
     return(AllItemsFolderHelper.RunQueryOnAllItemsFolder <T>((MailboxSession)session, supportedSortBy, seekToValue, defaultValue, queryProcessor, properties));
 }
 public static G RunQueryOnAllItemsFolder <G>(MailboxSession session, AllItemsFolderHelper.SupportedSortBy supportedSortBy, object seekToValue, G defaultValue, AllItemsFolderHelper.DoQueryProcessing <G> queryProcessor, ICollection <PropertyDefinition> properties)
 {
     return(AllItemsFolderHelper.RunQueryOnAllItemsFolder <G>(session, supportedSortBy, seekToValue, defaultValue, queryProcessor, properties, ItemQueryType.None));
 }