public override void Delete(MailboxStoreTypeProvider session) { using (UserConfiguration mailboxConfiguration = UserConfigurationHelper.GetMailboxConfiguration(session.MailboxSession, MRSRequest.GetName(this.RequestGuid), UserConfigurationTypes.Dictionary, false)) { if (mailboxConfiguration == null) { return; } } UserConfigurationHelper.DeleteMailboxConfiguration(session.MailboxSession, MRSRequest.GetName(this.RequestGuid)); }
public override void Save(MailboxStoreTypeProvider session) { using (UserConfigurationDictionaryAdapter <MRSRequest> userConfigurationDictionaryAdapter = new UserConfigurationDictionaryAdapter <MRSRequest>(session.MailboxSession, MRSRequest.GetName(this.RequestGuid), SaveMode.NoConflictResolutionForceSave, new GetUserConfigurationDelegate(UserConfigurationHelper.GetMailboxConfiguration), MRSRequestSchema.PersistedProperties)) { userConfigurationDictionaryAdapter.Save(this); } base.ResetChangeTracking(); }
public static T Read <T>(MailboxStoreTypeProvider session, Guid requestGuid) where T : MRSRequest, new() { ExchangePrincipal principal = ExchangePrincipal.FromADUser(session.ADUser, null); T result; using (UserConfigurationDictionaryAdapter <T> userConfigurationDictionaryAdapter = new UserConfigurationDictionaryAdapter <T>(session.MailboxSession, MRSRequest.GetName(requestGuid), new GetUserConfigurationDelegate(UserConfigurationHelper.GetMailboxConfiguration), MRSRequestSchema.PersistedProperties)) { try { T t = userConfigurationDictionaryAdapter.Read(principal); if (t.RequestGuid != requestGuid) { throw new CannotFindRequestIndexEntryException(requestGuid); } result = t; } catch (FormatException innerException) { throw new CannotFindRequestIndexEntryException(requestGuid, innerException); } } return(result); }