public void AddListener(DeviceConfiguration configuration) { var listener = new ProcessEvents(_playbackDeviceProvider); listener.RegisterSwitchForProcess(configuration.Process, configuration.PlaybackDeviceId, _defaultPlaybackDevice); _processEvents.Add(configuration.Id, listener); }
private void AddItemToList(DeviceConfiguration configuration) { var playbackDeviceName = _playbackDeviceProvider.GetPlaybackDeviceName(configuration.PlaybackDeviceId); var listItem = lvConfigurations.Items.Add(configuration.Process); listItem.Tag = configuration; listItem.SubItems.Add(playbackDeviceName); }
private void AddConfiguration(DeviceConfiguration configuration) { _configuration.Add(configuration); SaveConfiguration(); }
private void RemoveConfiguration(DeviceConfiguration configuration) { _configuration.Remove(configuration); SaveConfiguration(); }
private void btnAdd_Click(object sender, EventArgs e) { using(var dlg = new AddConfigurationForm()) { if (dlg.ShowDialog() == DialogResult.OK) { var configuration = new DeviceConfiguration(); configuration.PlaybackDeviceId = dlg.SelectedPlaybackDevice.Id; configuration.Process = dlg.SelectedProcess; AddItemToList(configuration); AddConfiguration(configuration); } } }
public void Remove(DeviceConfiguration configuration) { var configurationToRemove = DeviceConfigurations.FirstOrDefault(x => x.Id == configuration.Id); if (configurationToRemove != null) { DeviceConfigurations.Remove(configurationToRemove); OnDeviceConfigurationsChanged(new EventArgs()); } }
public void Add(DeviceConfiguration configuration) { DeviceConfigurations.Add(configuration); OnDeviceConfigurationsChanged(new EventArgs()); }