Exemple #1
0
 private static string[] GetStatusMailRecipients(MailboxDiscoverySearch searchObject, IRecipientSession recipientSession)
 {
     return((from r in searchObject.StatusMailRecipients.Select(delegate(ADObjectId recipientId)
     {
         ADRecipient adrecipient = recipientSession.Read(recipientId);
         if (adrecipient == null)
         {
             Util.Tracer.TraceWarning <ADObjectId>((long)searchObject.GetHashCode(), "Unable to find status mail recipient '{0}'", recipientId);
             return null;
         }
         return adrecipient.PrimarySmtpAddress.ToString();
     })
             where r != null
             select r).ToArray <string>());
 }
Exemple #2
0
        private static void BuildResultNumbersEx(StringBuilder sbLogMailBody, MailboxDiscoverySearch searchObject)
        {
            DiscoverySearchStats discoverySearchStats = null;

            if (searchObject.SearchStatistics != null)
            {
                if (searchObject.SearchStatistics.Count == 0)
                {
                    searchObject.SearchStatistics.Add(new DiscoverySearchStats());
                }
                discoverySearchStats = searchObject.SearchStatistics[0];
            }
            if (discoverySearchStats == null)
            {
                Util.Tracer.TraceWarning((long)searchObject.GetHashCode(), "searchObject does not contain SearchStatistics");
                throw new CorruptDataException(ServerStrings.ErrorCorruptedData("searchObject"));
            }
            Util.ReplaceLogFieldTags(sbLogMailBody, Globals.LogFields.ResultNumber, string.Empty);
            sbLogMailBody = sbLogMailBody.Replace(", " + Globals.LogFields.ResultNumberEstimate.ToLabelTag(), string.Empty);
            Util.ReplaceLogFieldTags(sbLogMailBody, Globals.LogFields.ResultNumberEstimate, string.Empty);
            Util.ReplaceLogFieldTags(sbLogMailBody, Globals.LogFields.EstimateNotExcludeDuplicates, discoverySearchStats.ToHtmlString());
        }