Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EventCounter"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="eventSource">The event source.</param>
        public EventCounter(string name, EventSource eventSource)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (eventSource == null)
            {
                throw new ArgumentNullException(nameof(eventSource));
            }

            InitializeBuffer();
            _name = name;
            EventCounterGroup.AddEventCounter(eventSource, this);
        }