public void SendCounterChanges(CounterChange change)
        {
            if (IsDisposed)
            {
                return;
            }

            if (_watchAllCounters > 0)
            {
                Send(change);
                return;
            }

            if (change.Name != null && _matchingCounters.Contains(change.Name))
            {
                Send(change);
                return;
            }

            if (change.DocumentId != null && _matchingDocumentCounters.Contains(change.DocumentId))
            {
                Send(change);
                return;
            }

            if (change.DocumentId != null && change.Name != null && _matchingDocumentCounter.Count > 0)
            {
                var parameters = new DocumentIdAndCounterNamePair(change.DocumentId, change.Name);
                if (_matchingDocumentCounter.Contains(parameters))
                {
                    Send(change);
                    return;
                }
            }
        }
 private bool Equals(DocumentIdAndCounterNamePair other)
 {
     return(string.Equals(DocumentId, other.DocumentId, StringComparison.OrdinalIgnoreCase) &&
            string.Equals(CounterName, other.CounterName, StringComparison.OrdinalIgnoreCase));
 }