public bool Equals(CounterAggregator other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.CounterCategory, CounterCategory) && Equals(other.CounterName, CounterName));
 }
 public void AddAggregator(CounterAggregator aggregator)
 {
     lock (Aggregators)
     {
         if (!Aggregators.Contains(aggregator))
         {
             aggregator.BeginAggregation(ObservableEvents);
             Aggregators.Add(aggregator);
         }
     }
     
 }
 private void DiscoverBasedOnGenericCounters(LogEventArgs eventArgs)
 {
     int cnt = _settings.Aggregators.Count;
     for (int i = 0; i < cnt; i++)
     {
         CounterAggregator counterAggregator = _settings.Aggregators[i];
         if ((eventArgs.LogEvent.Category == counterAggregator.CounterCategory) &&
             (eventArgs.LogEvent.Counter.StartsWith(counterAggregator.CounterName)) &&
             (eventArgs.LogEvent.Counter.Length > counterAggregator.CounterName.Length))
         {
             CounterAggregator aggregator = new CounterAggregator(counterAggregator.CounterCategory,
                                                                  eventArgs.LogEvent.Counter,
                                                                  counterAggregator.AggregationType,
                                                                  counterAggregator.InputType,"");
             _settings.AddAggregator(aggregator);
             File.AppendAllText(@"settings\counters.list",
                                "\r\n" + aggregator.CounterCategory + "\t" + aggregator.CounterName + "\t" +
                                aggregator.AggregationType.ToString() + "\t" + aggregator.InputType.FullName);
         }
     }
 }
 public bool Equals(CounterAggregator other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.CounterCategory, CounterCategory) && Equals(other.CounterName, CounterName);
 }