public FanControllerViewModel(IFanControlClient client, int fanIndex) { this.fanIndex = fanIndex; this.client = client; this.client.FanControlStatusChanged += Client_FanControlStatusChanged; Messenger.Default.Register <ReloadFanControlInfoMessage>(this, Refresh); Refresh(true); }
public MainViewModel(IFanControlClient client) { this.FanControllers = new ObservableCollection <FanControllerViewModel>(); this.renderer = new TrayIconRenderer(); this.renderer.Color = Settings.Default.TrayIconForegroundColor; this.client = client; this.client.FanControlStatusChanged += Client_FanControlStatusChanged; Messenger.Default.Register <ReloadFanControlInfoMessage>(this, Refresh); Refresh(true); }
public SelectConfigViewModel(IFanControlClient client) { this.client = client; string path = Assembly.GetExecutingAssembly()?.Location; if (path != null) { path = Path.GetDirectoryName(path); ConfigEditorPath = Path.Combine(path, ConfigEditorExecutableName); string configsDirPath = Path.Combine(path, ConfigsDirectoryName); if (Directory.Exists(configsDirPath)) { configWatcher = new FileSystemWatcher(configsDirPath); configWatcher.Created += ConfigWatcher_Changed; configWatcher.Deleted += ConfigWatcher_Changed; configWatcher.Renamed += ConfigWatcher_Changed; configWatcher.EnableRaisingEvents = true; } } SelectedConfig = this.client.FanControlInfo?.SelectedConfig; }