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); } }
internal static MapiEntryId GetAddressBookEntryIdFromLegacyDN(string userLegacyDN) { byte[] binaryEntryId = null; try { binaryEntryId = MapiStore.GetAddressBookEntryIdFromLegacyDN(userLegacyDN); } catch (MapiRetryableException exception) { MapiSession.ThrowWrappedException(exception, Strings.ErrorGetAddressBookEntryIdFromLegacyDN(userLegacyDN), null, null); } catch (MapiPermanentException exception2) { MapiSession.ThrowWrappedException(exception2, Strings.ErrorGetAddressBookEntryIdFromLegacyDN(userLegacyDN), null, null); } catch (MapiInvalidOperationException exception3) { MapiSession.ThrowWrappedException(exception3, Strings.ErrorGetAddressBookEntryIdFromLegacyDN(userLegacyDN), null, null); } return(new MapiEntryId(binaryEntryId)); }
internal static string GetLegacyDNFromAddressBookEntryId(MapiEntryId abbEntryId) { string result = null; try { result = MapiStore.GetLegacyDNFromAddressBookEntryId((byte[])abbEntryId); } catch (MapiRetryableException exception) { MapiSession.ThrowWrappedException(exception, Strings.ErrorGetGetLegacyDNFromAddressBookEntryId(abbEntryId.ToString()), null, null); } catch (MapiPermanentException exception2) { MapiSession.ThrowWrappedException(exception2, Strings.ErrorGetGetLegacyDNFromAddressBookEntryId(abbEntryId.ToString()), null, null); } catch (MapiInvalidOperationException exception3) { MapiSession.ThrowWrappedException(exception3, Strings.ErrorGetGetLegacyDNFromAddressBookEntryId(abbEntryId.ToString()), null, null); } return(result); }