public void OnSearchModified(ILogSourceSearch sender, IEnumerable <LogMatch> matches)
 {
     foreach (var match in matches)
     {
         _results.Add(match);
     }
 }
Esempio n. 2
0
 public void OnSearchModified(ILogSourceSearch sender, IEnumerable <LogMatch> matches)
 {
     lock (_syncRoot)
     {
         _matches  = matches.ToList();
         _modified = true;
     }
 }
        public void OnSearchModified(ILogSourceSearch sender, IEnumerable <LogMatch> matches)
        {
            KeyValuePair <ILogSourceSearch, List <LogMatch> > unused;

            while (_pendingMatches.TryDequeue(out unused))
            {
            }

            _pendingMatches.Enqueue(new KeyValuePair <ILogSourceSearch, List <LogMatch> >(sender, matches.ToList()));
        }
        public LogFileSearchListenerCollection(ILogSourceSearch sender)
        {
            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender));
            }

            _sender    = sender;
            _listeners = new List <ILogFileSearchListener>();
            _matches   = new List <LogMatch>();
        }
        private void RunOnce()
        {
            KeyValuePair <ILogSourceSearch, List <LogMatch> > pair;

            while (_pendingMatches.TryDequeue(out pair))
            {
                ILogSourceSearch sender  = pair.Key;
                List <LogMatch>  matches = pair.Value;

                // We need to make sure that we don't forward search results from a previously
                // _innerSearch. We can do so by ensuring that the sender is most definately
                // our current _innerSearch (and also by ensuring a correct order when replacing
                // it).
                if (sender == _innerSearch)
                {
                    _matches = matches;
                    EmitSearchModified(_matches);
                }
            }
        }
Esempio n. 6
0
 private void OnSearchChanged(ILogSourceSearch search)
 {
     PartTextCanvas.Search = search;
 }