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); }
internal void InvokeWithWrappedException(ParameterlessReturnlessDelegate invoke, LocalizedString message, MapiObjectId source, MapiSession.ErrorTranslatorDelegate translateError) { try { invoke(); } catch (MapiRetryableException ex) { LocalizedException ex2; if (translateError != null && (ex2 = translateError(ref message, ex)) != null) { throw ex2; } MapiSession.ThrowWrappedException(ex, message, source, this); } catch (MapiPermanentException ex3) { LocalizedException ex2; if (translateError != null && (ex2 = translateError(ref message, ex3)) != null) { throw ex2; } MapiSession.ThrowWrappedException(ex3, message, source, this); } catch (MapiInvalidOperationException ex4) { LocalizedException ex2; if (translateError != null && (ex2 = translateError(ref message, ex4)) != null) { throw ex2; } MapiSession.ThrowWrappedException(ex4, message, source, this); } }