/// <summary> /// CTOR /// </summary> public HomeViewModel() { this.openHardwareManagementService = DependencyFactory.Resolve<IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); this.MainboardInfo = DependencyFactory.Resolve<IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetMainboardInformation(); this.ProcessorInformation = DependencyFactory.Resolve<IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetProcessorInformation(); this.GPUInformation = DependencyFactory.Resolve<IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetGPUInformation(); }
/// <summary> /// CTOR /// </summary> public CPUCoreWorkloadsViewModel() { this.openHardwareManagementService = DependencyFactory.Resolve<IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); // Register for events DependencyFactory.Resolve<IEventAggregator>(GeneralConstants.EventAggregator).GetEvent<OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); }
/// <summary> /// CTOR /// </summary> public MainboardInformationViewModel() { this.MainboardInformation = DependencyFactory.Resolve<IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetMainboardInformation(); this.openHardwareMonitorManagementService = DependencyFactory.Resolve<IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); if (this.openHardwareMonitorManagementService != null) { if (this.openHardwareMonitorManagementService.MainboardVoltageSensorsWithName != null) { foreach (var vs in this.openHardwareMonitorManagementService.MainboardVoltageSensorsWithName) { SensorTile st = new SensorTile(); st.HardwareSensor = vs; this.MainboardVoltageSensors.Add(st); } } if (this.openHardwareMonitorManagementService.MainboardTemperatureSensors != null) { foreach (var ts in this.openHardwareMonitorManagementService.MainboardTemperatureSensors) { SensorTile st = new SensorTile(); st.HardwareSensor = ts; this.MainboardTemperatureSensors.Add(st); } } } // Register for events DependencyFactory.Resolve<IEventAggregator>(GeneralConstants.EventAggregator).GetEvent<OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); }
/// <summary> /// CTOR /// </summary> public MainboardInformationViewModel() { this.MainboardInformation = DependencyFactory.Resolve <IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetMainboardInformation(); this.openHardwareMonitorManagementService = DependencyFactory.Resolve <IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); if (this.openHardwareMonitorManagementService != null) { if (this.openHardwareMonitorManagementService.MainboardVoltageSensorsWithName != null) { foreach (var vs in this.openHardwareMonitorManagementService.MainboardVoltageSensorsWithName) { SensorTile st = new SensorTile(); st.HardwareSensor = vs; this.MainboardVoltageSensors.Add(st); } } if (this.openHardwareMonitorManagementService.MainboardTemperatureSensors != null) { foreach (var ts in this.openHardwareMonitorManagementService.MainboardTemperatureSensors) { SensorTile st = new SensorTile(); st.HardwareSensor = ts; this.MainboardTemperatureSensors.Add(st); } } } // Register for events DependencyFactory.Resolve <IEventAggregator>(GeneralConstants.EventAggregator).GetEvent <OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); }
/// <summary> /// CTOR /// </summary> public CPUCoreWorkloadsViewModel() { this.openHardwareManagementService = DependencyFactory.Resolve <IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); // Register for events DependencyFactory.Resolve <IEventAggregator>(GeneralConstants.EventAggregator).GetEvent <OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); }
/// <summary> /// CTOR /// </summary> public HomeViewModel() { this.openHardwareManagementService = DependencyFactory.Resolve <IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); this.MainboardInfo = DependencyFactory.Resolve <IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetMainboardInformation(); this.ProcessorInformation = DependencyFactory.Resolve <IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetProcessorInformation(); this.GPUInformation = DependencyFactory.Resolve <IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetGPUInformation(); }
/// <summary> /// CTOR /// </summary> public AddTilePopupViewModel() { // Initilize commands this.InitializeCommands(); // Get services this.openHardwareMonitorManagementService = DependencyFactory.Resolve <IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); }
/// <summary> /// CTOR /// </summary> public TileSettingsViewModel() { this.configFile = DependencyFactory.Resolve <IConfigurationFile>(ConfigFileNames.ApplicationConfig); this.openHardwareMonitorManagementDebugService = DependencyFactory.Resolve <IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementDebugService); if (this.configFile != null) { this.SelectedColorForCpuTiles = ColorHelper.GetColorFromString(configFile.Sections["TileSettings"].Settings["CpuTilesColor"].Value); this.SelectedColorForGpuTiles = ColorHelper.GetColorFromString(configFile.Sections["TileSettings"].Settings["GpuTilesColor"].Value); this.SelectedColorForMainboardTiles = ColorHelper.GetColorFromString(configFile.Sections["TileSettings"].Settings["MainboardTilesColor"].Value); } }
/// <summary> /// CTOR /// </summary> public CPUInformationViewModel() { // Setup CPU-Plot this.SetupCpuPlot(); // Get services this.openHardwareManagementService = DependencyFactory.Resolve <IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); this.CPUInformation = DependencyFactory.Resolve <IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetProcessorInformation(); // Register for events DependencyFactory.Resolve <IEventAggregator>(GeneralConstants.EventAggregator).GetEvent <OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); }
/// <summary> /// CTOR /// </summary> public GPUInformationViewModel() { // Setup the GPU-Plot this.SetupGPUCoreWorkloadPlot(); this.SetupGPUCoreTemperaturePlot(); // Get GPU-Information this.openHardwareManagementService = DependencyFactory.Resolve <IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); this.GPUInformations = DependencyFactory.Resolve <IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetGPUInformation(); // Register for events DependencyFactory.Resolve <IEventAggregator>(GeneralConstants.EventAggregator).GetEvent <OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); }
/// <summary> /// Standard CTOR /// </summary> /// <param name="sensor"></param> public MainboardFanController(string sensorName) { // Set sensor this.FanSensorName = sensorName; // Get Fan-Controller-Service this.fanControllerService = DependencyFactory.Resolve <IFanControllerService>(ServiceNames.MainboardFanControllerService); // Get OpenHardwareMonitorManagementService this.ohmManagementService = DependencyFactory.Resolve <IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); if (!String.IsNullOrEmpty(this.FanSensorName)) { this.ReadFanControllerSettings(); } // Create user control this.FanControllerUserControl = new MainboardFanControllerUserControl(this); }
/// <summary> /// Standard CTOR /// </summary> public MainboardFanControllerService() { // Get OHW-Management-Service this.openHardwareMonitorManagementService = DependencyFactory.Resolve <IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); // Read the fan controller templates (Standard, Silent, ...) this.ReadFanControllerTemplates(); // Check if file exists -> if not create one if (!System.IO.File.Exists(DirectoryConstants.FanControllerSettingsConfig)) { // Create the settings file this.CreateSettingsFile(); } // Register for events //DependencyFactory.Resolve<IEventAggregator>(GeneralConstants.EventAggregator).GetEvent<OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); }
/// <summary> /// CTOR /// </summary> public TilePageViewModel() { this.configurationFile = new TileViewConfigurationFile(); // Intialize commands this.InitializeCommands(); // Create the main grid this.CreateMainGrid(this.numberOfColumns, 150, this.numberOfRows, 110); this.openHardwareManagementService = DependencyFactory.Resolve <IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); this.applicationConfigFile = DependencyFactory.Resolve <IConfigurationFile>(ConfigFileNames.ApplicationConfig); for (int r = 0; r < this.numberOfRows; r++) { for (int c = 0; c < this.numberOfColumns; c++) { var tile = this.configurationFile.Tiles.Where(t => t.GridRow == r && t.GridColumn == c).FirstOrDefault(); if (tile != null) { var sensor = this.openHardwareManagementService.GetSensor(tile.SensorCategory, tile.SensorName, tile.SensorType); if (sensor != null) { this.AddSensorTile(sensor, tile.GridRow, tile.GridColumn, tile.SensorCategory); } } else { TileViewDropTarget dropTarget = new TileViewDropTarget(); dropTarget.SetValue(Grid.RowProperty, r); dropTarget.SetValue(Grid.ColumnProperty, c); this.MainGrid.Children.Add(dropTarget); } } } // Register for events DependencyFactory.Resolve <IEventAggregator>(GeneralConstants.EventAggregator).GetEvent <OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); DependencyFactory.Resolve <IEventAggregator>(GeneralConstants.EventAggregator).GetEvent <SensorTilePositionChangedEvent>().Subscribe(this.SensorTilePositionChangedEventHandler, ThreadOption.UIThread); DependencyFactory.Resolve <IEventAggregator>(GeneralConstants.EventAggregator).GetEvent <SensorTileAddedEvent>().Subscribe(this.SensorTileAddedEventHandler, ThreadOption.UIThread); DependencyFactory.Resolve <IEventAggregator>(GeneralConstants.EventAggregator).GetEvent <SensorTileDeletedEvent>().Subscribe(this.SensorTileDeletedEventHandler, ThreadOption.UIThread); }
/// <summary> /// CTOR /// </summary> public CPUInformationViewModel() { // Setup CPU-Plot this.SetupCpuPlot(); // Get services this.openHardwareManagementService = DependencyFactory.Resolve<IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); this.CPUInformation = DependencyFactory.Resolve<IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetProcessorInformation(); // Register for events DependencyFactory.Resolve<IEventAggregator>(GeneralConstants.EventAggregator).GetEvent<OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); }
/// <summary> /// Standard CTOR /// </summary> public MainboardFanControllerService() { // Get OHW-Management-Service this.openHardwareMonitorManagementService = DependencyFactory.Resolve<IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); // Read the fan controller templates (Standard, Silent, ...) this.ReadFanControllerTemplates(); // Check if file exists -> if not create one if (!System.IO.File.Exists(DirectoryConstants.FanControllerSettingsConfig)) { // Create the settings file this.CreateSettingsFile(); } // Register for events //DependencyFactory.Resolve<IEventAggregator>(GeneralConstants.EventAggregator).GetEvent<OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); }
/// <summary> /// CTOR /// </summary> public GPUInformationViewModel() { // Setup the GPU-Plot this.SetupGPUCoreWorkloadPlot(); this.SetupGPUCoreTemperaturePlot(); // Get GPU-Information this.openHardwareManagementService = DependencyFactory.Resolve<IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); this.GPUInformations = DependencyFactory.Resolve<IHardwareInformationService>(ServiceNames.WmiHardwareInformationService).GetGPUInformation(); // Register for events DependencyFactory.Resolve<IEventAggregator>(GeneralConstants.EventAggregator).GetEvent<OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); }
/// <summary> /// CTOR /// </summary> public TilePageViewModel() { this.configurationFile = new TileViewConfigurationFile(); // Intialize commands this.InitializeCommands(); // Create the main grid this.CreateMainGrid(this.numberOfColumns, 150, this.numberOfRows, 110); this.openHardwareManagementService = DependencyFactory.Resolve<IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); this.applicationConfigFile = DependencyFactory.Resolve<IConfigurationFile>(ConfigFileNames.ApplicationConfig); for (int r = 0; r < this.numberOfRows; r++) { for (int c = 0; c < this.numberOfColumns; c++) { var tile = this.configurationFile.Tiles.Where(t => t.GridRow == r && t.GridColumn == c).FirstOrDefault(); if (tile != null) { var sensor = this.openHardwareManagementService.GetSensor(tile.SensorCategory, tile.SensorName, tile.SensorType); if (sensor != null) this.AddSensorTile(sensor, tile.GridRow, tile.GridColumn, tile.SensorCategory); } else { TileViewDropTarget dropTarget = new TileViewDropTarget(); dropTarget.SetValue(Grid.RowProperty, r); dropTarget.SetValue(Grid.ColumnProperty, c); this.MainGrid.Children.Add(dropTarget); } } } // Register for events DependencyFactory.Resolve<IEventAggregator>(GeneralConstants.EventAggregator).GetEvent<OpenHardwareMonitorManagementServiceTimerTickEvent>().Subscribe(this.OpenHardwareMonitorManagementServiceTimerTickEventHandler, ThreadOption.UIThread); DependencyFactory.Resolve<IEventAggregator>(GeneralConstants.EventAggregator).GetEvent<SensorTilePositionChangedEvent>().Subscribe(this.SensorTilePositionChangedEventHandler, ThreadOption.UIThread); DependencyFactory.Resolve<IEventAggregator>(GeneralConstants.EventAggregator).GetEvent<SensorTileAddedEvent>().Subscribe(this.SensorTileAddedEventHandler, ThreadOption.UIThread); DependencyFactory.Resolve<IEventAggregator>(GeneralConstants.EventAggregator).GetEvent<SensorTileDeletedEvent>().Subscribe(this.SensorTileDeletedEventHandler, ThreadOption.UIThread); }
/// <summary> /// CTOR /// </summary> public AddTilePopupViewModel() { // Initilize commands this.InitializeCommands(); // Get services this.openHardwareMonitorManagementService = DependencyFactory.Resolve<IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); }
/// <summary> /// Standard CTOR /// </summary> /// <param name="sensor"></param> public MainboardFanController(string sensorName) { // Set sensor this.FanSensorName = sensorName; // Get Fan-Controller-Service this.fanControllerService = DependencyFactory.Resolve<IFanControllerService>(ServiceNames.MainboardFanControllerService); // Get OpenHardwareMonitorManagementService this.ohmManagementService = DependencyFactory.Resolve<IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementService); if (!String.IsNullOrEmpty(this.FanSensorName)) { this.ReadFanControllerSettings(); } // Create user control this.FanControllerUserControl = new MainboardFanControllerUserControl(this); }
/// <summary> /// CTOR /// </summary> public TileSettingsViewModel() { this.configFile = DependencyFactory.Resolve<IConfigurationFile>(ConfigFileNames.ApplicationConfig); this.openHardwareMonitorManagementDebugService = DependencyFactory.Resolve<IOpenHardwareMonitorManagementService>(ServiceNames.OpenHardwareMonitorManagementDebugService); if (this.configFile != null) { this.SelectedColorForCpuTiles = ColorHelper.GetColorFromString(configFile.Sections["TileSettings"].Settings["CpuTilesColor"].Value); this.SelectedColorForGpuTiles = ColorHelper.GetColorFromString(configFile.Sections["TileSettings"].Settings["GpuTilesColor"].Value); this.SelectedColorForMainboardTiles = ColorHelper.GetColorFromString(configFile.Sections["TileSettings"].Settings["MainboardTilesColor"].Value); } }