static HardwareMonitor() { _computer = new Computer() { IsCpuEnabled = true, IsGpuEnabled = true, IsMemoryEnabled = true }; try { _computer.Open(); _hardware = _computer.Hardware; } catch (Exception e) { Global.logger.Error(e); } }
#pragma warning disable CA1810 // Initialize reference type static fields inline static HardwareMonitor() #pragma warning restore CA1810 // Initialize reference type static fields inline { _computer = new Computer() { IsCpuEnabled = true, IsGpuEnabled = true, IsMemoryEnabled = true, IsNetworkEnabled = true }; try { _computer.Open(); _hardware = _computer.Hardware; } catch (Exception e) { Global.logger.Error(e); } }