コード例 #1
0
 public void ForceStoreToRefreshMailbox(MailboxId mailboxId)
 {
     this.CheckRequirementsOnMailboxIdToContinue(mailboxId);
     MapiSession.ErrorTranslatorDelegate translateError = delegate(ref LocalizedString message, Exception e)
     {
         return(new FailedToRefreshMailboxException(e.Message, mailboxId.ToString(), e));
     };
     base.InvokeWithWrappedException(delegate()
     {
         int num = 0;
         while (3 > num)
         {
             try
             {
                 this.Administration.ClearAbsentInDsFlagOnMailbox(mailboxId.MailboxDatabaseId.Guid, mailboxId.MailboxGuid);
                 this.Administration.PurgeCachedMailboxObject(mailboxId.MailboxGuid);
                 break;
             }
             catch (MapiExceptionNoAccess)
             {
                 if (2 <= num)
                 {
                     throw;
                 }
                 this.Administration.PurgeCachedMailboxObject(mailboxId.MailboxGuid);
             }
             catch (MapiExceptionNotFound)
             {
                 if (2 <= num)
                 {
                     throw;
                 }
                 this.Administration.PurgeCachedMailboxObject(mailboxId.MailboxGuid);
             }
             catch (MapiExceptionUnknownMailbox)
             {
                 this.Administration.PurgeCachedMailboxObject(mailboxId.MailboxGuid);
                 break;
             }
             num++;
         }
     }, LocalizedString.Empty, null, translateError);
 }
コード例 #2
0
 private void AnalyzeMailboxLogonFailedAndThrow(MailboxId mailboxId, Exception innerException)
 {
     if (null == mailboxId)
     {
         throw new ArgumentNullException("mailboxId");
     }
     if (null != mailboxId.MailboxDatabaseId)
     {
         throw new MailboxLogonFailedException(Strings.MailboxLogonFailedInDatabaseExceptionError(mailboxId.MailboxGuid.ToString(), this.GetDatabaseIdentityString(mailboxId.MailboxDatabaseId), this.ServerName), innerException);
     }
     if (string.IsNullOrEmpty(mailboxId.MailboxExchangeLegacyDn))
     {
         throw new MailboxLogonFailedException(Strings.MailboxLogonFailedExceptionError(mailboxId.ToString(), this.ServerName), innerException);
     }
     throw new MailboxLogonFailedException(Strings.MailboxLogonFailedExceptionError(mailboxId.MailboxExchangeLegacyDn, this.ServerName), innerException);
 }