/// <summary>
 /// Initializes network performance counters.
 /// </summary>
 private void InitializeNetworkMonitor()
 {
     try
     {
         // initialize NetworkMonitor and start measurement
         m_networkMonitor             = new NetworkMonitor();
         m_networkTimeLastCollectedAt = DateTime.UtcNow;
         m_networkMonitor.StartMeasurement();
     }
     catch
     {
         // NetworkMonitor is not working so set to null
         m_networkMonitor = null;
     }
 }
Beispiel #2
0
        /// <summary>
        /// Initializes network performance counters.
        /// </summary>
        private void InitializeNetworkMonitor()
        {
            try
            {
                // initialize NetworkMonitor and start measurement
                m_networkMonitor             = new NetworkMonitor();
                m_networkTimeLastCollectedAt = DateTime.UtcNow;
                m_networkMonitor.StartMeasurement();
            }
#pragma warning disable ERP022
            catch
            {
                // NetworkMonitor is not working so set to null
                m_networkMonitor = null;
            }
#pragma warning restore ERP022
        }