예제 #1
0
        private RequestJobNamedPropertySet(MapiStore systemMailbox)
        {
            NamedProp[] array = new NamedProp[26];
            int         num   = 0;

            foreach (NamedPropertyData namedPropertyData in RequestJobNamedPropertySet.npData)
            {
                array[num] = new NamedProp(namedPropertyData.NPGuid, namedPropertyData.NPName);
                num++;
            }
            PropTag[] idsFromNames = systemMailbox.GetIDsFromNames(true, array);
            this.PropTags = new PropTag[28];
            num           = 0;
            foreach (NamedPropertyData namedPropertyData2 in RequestJobNamedPropertySet.npData)
            {
                this.PropTags[num] = PropTagHelper.PropTagFromIdAndType(idsFromNames[num].Id(), namedPropertyData2.NPType);
                num++;
            }
            this.PropTags[26] = PropTag.ReplyTemplateID;
            this.PropTags[27] = PropTag.EntryId;
        }
예제 #2
0
 public PropTag[] GetIDsFromNames(bool shouldCreate, ICollection <NamedProp> namedProps)
 {
     PropTag[] idsFromNames;
     using (PublicFolderConnectionLimitsTracker.Instance.GetToken(this.PrimaryHierarchyMailboxPrincipal.MailboxInfo.Location.ServerFqdn))
     {
         StoreSession storeSession = null;
         object       thisObject   = null;
         bool         flag         = false;
         try
         {
             if (storeSession != null)
             {
                 storeSession.BeginMapiCall();
                 storeSession.BeginServerHealthCall();
                 flag = true;
             }
             if (StorageGlobals.MapiTestHookBeforeCall != null)
             {
                 StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
             }
             using (MapiStore hierarchyStore = this.GetHierarchyStore())
             {
                 idsFromNames = hierarchyStore.GetIDsFromNames(shouldCreate, namedProps);
             }
         }
         catch (MapiPermanentException ex)
         {
             throw StorageGlobals.TranslateMapiException(ServerStrings.MapiCannotGetIDFromNames, ex, storeSession, thisObject, "{0}. MapiException = {1}.", new object[]
             {
                 string.Format("RPCPrimaryHierarchyProvider.GetIDFromNames", new object[0]),
                 ex
             });
         }
         catch (MapiRetryableException ex2)
         {
             throw StorageGlobals.TranslateMapiException(ServerStrings.MapiCannotGetIDFromNames, ex2, storeSession, thisObject, "{0}. MapiException = {1}.", new object[]
             {
                 string.Format("RPCPrimaryHierarchyProvider.GetIDFromNames", new object[0]),
                 ex2
             });
         }
         finally
         {
             try
             {
                 if (storeSession != null)
                 {
                     storeSession.EndMapiCall();
                     if (flag)
                     {
                         storeSession.EndServerHealthCall();
                     }
                 }
             }
             finally
             {
                 if (StorageGlobals.MapiTestHookAfterCall != null)
                 {
                     StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                 }
             }
         }
     }
     return(idsFromNames);
 }