public int GetMaxAllowedMailboxes(IRecipientSession recipientSession, SearchType searchType) { int result = (int)SearchUtils.GetDiscoveryMaxMailboxes(recipientSession); if (searchType == SearchType.Preview) { result = (int)SearchUtils.GetDiscoveryMaxMailboxesForPreviewSearch(recipientSession); } if (searchType == SearchType.Statistics) { result = (int)SearchUtils.GetDiscoveryMaxMailboxesForStatsSearch(recipientSession); } return(result); }