-
Notifications
You must be signed in to change notification settings - Fork 8
/
SwitchDisplaySettingsView.xaml.cs
42 lines (38 loc) · 1.39 KB
/
SwitchDisplaySettingsView.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Windows.Controls;
using System;
using System.Windows;
using NAudio.CoreAudioApi;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace SwitchDisplay
{
public partial class SwitchDisplaySettingsView : UserControl
{
private SwitchDisplaySettings settings { get; set; }
public SwitchDisplaySettingsView(SwitchDisplaySettings settings)
{
this.settings = settings;
InitializeComponent();
}
private void AddFullscreenAudioDevice_Click(object sender, RoutedEventArgs e)
{
var device =((ComboBox)FullscreenAudioDeviceList).SelectedItem;
if(device != null)
{
settings.AddFullscreenDeviceById(((KeyValuePair<string, string>)device).Key, ((KeyValuePair<string, string>)device).Value);
}
}
private void MoveAudioDeviceUp_Click(object sender, RoutedEventArgs e)
{
settings.MoveFullscreenDeviceUp(DevicesOrderList.SelectedIndex);
}
private void MoveAudioDeviceDown_Click(object sender, RoutedEventArgs e)
{
settings.MoveFullscreenDeviceDown(DevicesOrderList.SelectedIndex);
}
private void RemoveAudioDevice_Click(object sender, RoutedEventArgs e)
{
settings.RemoveFullscreenDeviceByIndex(DevicesOrderList.SelectedIndex);
}
}
}