public static MailboxFolder ResolveMailboxFolder(MailboxFolderIdParameter folderId, DataAccessHelper.GetDataObjectDelegate getUserHandler, DataAccessHelper.GetDataObjectDelegate getFolderHandler, IRecipientSession resolveUserSession, ADSessionSettings sessionSettings, ADUser adUser, ManageInboxRule.ThrowTerminatingErrorDelegate errorHandler) { if (!ManageInboxRule.TryValidateFolderId(folderId, getUserHandler, getFolderHandler, resolveUserSession, adUser, errorHandler)) { return(null); } MailboxFolder result; using (MailboxFolderDataProvider mailboxFolderDataProvider = new MailboxFolderDataProvider(sessionSettings, adUser, "ResolveMailboxFolder")) { result = (MailboxFolder)getFolderHandler(folderId, mailboxFolderDataProvider, null, null, new LocalizedString?(Strings.ErrorMailboxFolderNotFound(folderId.ToString())), new LocalizedString?(Strings.ErrorMailboxFolderNotUnique(folderId.ToString()))); } return(result); }
internal void ValidateInterdependentParameters(ManageInboxRule.ThrowTerminatingErrorDelegate writeError) { if (base.IsModified(InboxRuleSchema.ReceivedAfterDate) || base.IsModified(InboxRuleSchema.ReceivedBeforeDate)) { ManageInboxRule.VerifyRange <ExDateTime?>(this.ReceivedAfterDate, this.ReceivedBeforeDate, false, writeError, Strings.ErrorInvalidDateRangeCondition); } if (base.IsModified(InboxRuleSchema.ExceptIfReceivedAfterDate) || base.IsModified(InboxRuleSchema.ExceptIfReceivedBeforeDate)) { ManageInboxRule.VerifyRange <ExDateTime?>(this.ExceptIfReceivedAfterDate, this.ExceptIfReceivedBeforeDate, false, writeError, Strings.ErrorInvalidDateRangeException); } if (base.IsModified(InboxRuleSchema.WithinSizeRangeMinimum) || base.IsModified(InboxRuleSchema.WithinSizeRangeMaximum)) { ManageInboxRule.VerifyRange <ByteQuantifiedSize?>(this.WithinSizeRangeMinimum, this.WithinSizeRangeMaximum, true, writeError, Strings.ErrorInvalidSizeRangeCondition); } if (base.IsModified(InboxRuleSchema.ExceptIfWithinSizeRangeMinimum) || base.IsModified(InboxRuleSchema.ExceptIfWithinSizeRangeMaximum)) { ManageInboxRule.VerifyRange <ByteQuantifiedSize?>(this.ExceptIfWithinSizeRangeMinimum, this.ExceptIfWithinSizeRangeMaximum, true, writeError, Strings.ErrorInvalidSizeRangeException); } }