Exemplo n.º 1
0
        internal static LogSearchCursor GetCursor(string server, ServerVersion version, string logFile, string messageId, ProxyAddressCollection senderProxyAddresses, DateTime startTime, DateTime endTime)
        {
            LogQuery        logQuery        = new LogQuery();
            LogAndCondition logAndCondition = new LogAndCondition();

            if (!string.IsNullOrEmpty(messageId))
            {
                LogCondition fieldStringComparison = TrackingSearch.GetFieldStringComparison(MessageTrackingField.MessageId, CsvFieldCache.NormalizeMessageID(messageId));
                logAndCondition.Conditions.Add(fieldStringComparison);
            }
            if (senderProxyAddresses != null)
            {
                LogOrCondition logOrCondition = new LogOrCondition();
                foreach (ProxyAddress proxyAddress in senderProxyAddresses)
                {
                    LogCondition fieldStringComparison2 = TrackingSearch.GetFieldStringComparison(MessageTrackingField.SenderAddress, proxyAddress.AddressString);
                    logOrCondition.Conditions.Add(fieldStringComparison2);
                }
                logAndCondition.Conditions.Add(logOrCondition);
            }
            logQuery.Filter    = logAndCondition;
            logQuery.Beginning = startTime;
            logQuery.End       = endTime;
            return(new LogSearchCursor(MessageTrackingSchema.MessageTrackingEvent, server, version, logFile, logQuery, null));
        }
Exemplo n.º 2
0
        internal static LogCondition GetFieldStringComparison(MessageTrackingField field, string[] values)
        {
            LogOrCondition logOrCondition = new LogOrCondition();

            foreach (string value in values)
            {
                LogCondition fieldStringComparison = TrackingSearch.GetFieldStringComparison(field, value);
                logOrCondition.Conditions.Add(fieldStringComparison);
            }
            return(logOrCondition);
        }