Browse Source

项目初始化

Yumin 6 years ago
commit
b6037b63fc

+ 22 - 0
Theatre.sln

@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.24720.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Theatre", "Theatre\Theatre.csproj", "{FD89B510-3218-4F63-B311-2D387CF09859}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{FD89B510-3218-4F63-B311-2D387CF09859}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{FD89B510-3218-4F63-B311-2D387CF09859}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{FD89B510-3218-4F63-B311-2D387CF09859}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{FD89B510-3218-4F63-B311-2D387CF09859}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 33 - 0
Theatre/App.config

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+            <section name="Theatre.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+    <userSettings>
+        <Theatre.Properties.Settings>
+            <setting name="Audio1" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="Audio2" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="Audio3" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="Audio4" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="Audio5" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="Audio6" serializeAs="String">
+                <value />
+            </setting>
+        </Theatre.Properties.Settings>
+    </userSettings>
+</configuration>

+ 9 - 0
Theatre/App.xaml

@@ -0,0 +1,9 @@
+<Application x:Class="Theatre.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:Theatre"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+         
+    </Application.Resources>
+</Application>

+ 17 - 0
Theatre/App.xaml.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Theatre
+{
+    /// <summary>
+    /// App.xaml 的交互逻辑
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}

+ 134 - 0
Theatre/AppContext.cs

@@ -0,0 +1,134 @@
+using System;
+using System.IO.Ports;
+using System.Media;
+using System.Text;
+using System.Threading;
+using System.Windows.Media;
+
+namespace Theatre
+{
+    class AppContext
+    {
+        private SynchronizationContext _synchronizationContext;
+        // 串口类
+        private SerialPort _serialPort;
+
+        private static AppContext _appContext;
+
+        private AppContext() { }
+
+        public static AppContext GetAppContext()
+        {
+            if (_appContext == null)
+            {
+                _appContext = new AppContext();
+                // 获取UI线程同步上下文
+                _appContext._synchronizationContext = SynchronizationContext.Current;
+            }
+            return _appContext;
+        }
+
+        public SerialPort SerialPort
+        {
+            set
+            {
+                if (value == null)
+                {
+                    PortOpen = false;
+                    MainWindow.Status.Content = "未连接";
+                    MainWindow.Status.ToolTip = "设备未连接";
+                    MainWindow.Status.Foreground = new SolidColorBrush(Colors.Red);
+                }
+                else
+                {
+                    PortOpen = true;
+                    MainWindow.Status.Content = "已连接";
+                    MainWindow.Status.ToolTip = "设备已连接";
+                    MainWindow.Status.Foreground = new SolidColorBrush(Colors.Green);
+                }
+                _serialPort = value;
+            }
+            get
+            {
+                return _serialPort;
+            }
+        }
+
+        // 打开串口标志位
+        public bool PortOpen { set; get; }
+
+        public void DataReceived(object sender, SerialDataReceivedEventArgs e)
+        {
+            try
+            {
+                // Comm.BytesToRead 中为要读入的字节长度
+                var len = _serialPort.BytesToRead;
+                var readBuffer = new byte[len];
+                // 将数据读入缓存
+                _serialPort.Read(readBuffer, 0, len);
+                // 处理 readBuffer 中的数据,自定义处理过程
+                var msg = Encoding.Default.GetString(readBuffer, 0, len);
+                Console.Write(msg);
+                var fileName = "";
+                switch (msg)
+                {
+                    case "1":
+                        var soundPlayer1 = new SoundPlayer(Properties.Settings.Default.Audio1);
+                        soundPlayer1.Load();
+                        soundPlayer1.Play();
+                        fileName = soundPlayer1.SoundLocation;
+                        break;
+                    case "2":
+                        var soundPlayer2 = new SoundPlayer(Properties.Settings.Default.Audio2);
+                        soundPlayer2.Load();
+                        soundPlayer2.Play();
+                        fileName = soundPlayer2.SoundLocation;
+                        break;
+                    case "3":
+                        var soundPlayer3 = new SoundPlayer(Properties.Settings.Default.Audio3);
+                        soundPlayer3.Load();
+                        soundPlayer3.Play();
+                        fileName = soundPlayer3.SoundLocation;
+                        break;
+                    case "4":
+                        var soundPlayer4 = new SoundPlayer(Properties.Settings.Default.Audio4);
+                        soundPlayer4.Load();
+                        soundPlayer4.Play();
+                        fileName = soundPlayer4.SoundLocation;
+                        break;
+                    case "5":
+                        var soundPlayer5 = new SoundPlayer(Properties.Settings.Default.Audio5);
+                        soundPlayer5.Load();
+                        soundPlayer5.Play();
+                        fileName = soundPlayer5.SoundLocation;
+                        break;
+                    case "6":
+                        var soundPlayer6 = new SoundPlayer(Properties.Settings.Default.Audio6);
+                        soundPlayer6.Load();
+                        soundPlayer6.Play();
+                        fileName = soundPlayer6.SoundLocation;
+                        break;
+                }
+                // 委托执行
+                ThreadProcSafePost(fileName);
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine("接收数据异常!具体原因:" + ex.Message);
+            }
+        }
+
+        private void ThreadProcSafePost(string text)
+        {
+            _synchronizationContext.Post(SetTextSafePost, text);
+        }
+
+        private void SetTextSafePost(object text)
+        {
+            var fileName = (string)text;
+            fileName = fileName.Substring(fileName.LastIndexOf("\\", StringComparison.Ordinal) + 1);
+            MainWindow.FileLabel.Content = fileName;
+            MainWindow.FileLabel.ToolTip = fileName;
+        }
+    }
+}

+ 17 - 0
Theatre/MainWindow.xaml

@@ -0,0 +1,17 @@
+<Window x:Class="Theatre.MainWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        mc:Ignorable="d"
+        Title="戏" Height="72" Width="300" ResizeMode="CanMinimize" Loaded="Window_Loaded" Closing="Window_Closing">
+    <Grid>
+        <ToolBar x:Name="ToolBar" VerticalAlignment="Top" Padding="0,0" Margin="0,0" Height="32">
+            <Button x:Name="Settings" Content="设置" ToolTip="设置" Click="Settings_Click" VerticalAlignment="Stretch"/>
+            <Separator/>
+            <Label x:Name="PortStatus" Content="未连接" ToolTip="设备连接" Foreground="Red"/>
+            <Separator/>
+            <Label x:Name="FileName" Content="" Foreground="Gray"/>
+        </ToolBar>
+    </Grid>
+</Window>

+ 109 - 0
Theatre/MainWindow.xaml.cs

@@ -0,0 +1,109 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Interop;
+
+namespace Theatre
+{
+    /// <summary>
+    /// MainWindow.xaml 的交互逻辑
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        private readonly AppContext _appContext = AppContext.GetAppContext();
+        private readonly SerialTool _serialTool = SerialTool.GetSerialTool();
+
+        private bool _noDevice;
+        public static Label Status;
+        public static Label FileLabel;
+
+        public MainWindow()
+        {
+            InitializeComponent();
+            Status = PortStatus;
+            FileLabel = FileName;
+            LoadDevice();
+        }
+
+        private void Window_Loaded(object sender, RoutedEventArgs e)
+        {
+            // 监听 Windows 消息,获取窗口句柄一定要写在窗口 loaded 事件里,才能获取到窗口句柄,否则为空
+            // 窗口过程 - 挂钩
+            (PresentationSource.FromVisual(this) as HwndSource)?.AddHook(DeviceChanged);
+        }
+
+        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+        {
+            if (_noDevice) return;
+            var messageBoxResult = MessageBox.Show("确定退出吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question);
+            if (messageBoxResult == MessageBoxResult.Cancel)
+            {
+                e.Cancel = true;
+            }
+            else
+            {
+                Application.Current.Shutdown();
+            }
+        }
+
+        private void Settings_Click(object sender, RoutedEventArgs e)
+        {
+            new SettingsWindow().ShowDialog();
+        }
+
+        private void LoadDevice()
+        {
+            var portList = _serialTool.FindPort();
+            MessageBoxResult mbr;
+            switch (portList.Count)
+            {
+                case 0:
+                    mbr = MessageBox.Show("没有找到可用硬件!\n请确保连接硬件后再打开本软件。", "错误提示", MessageBoxButton.OK, MessageBoxImage.Warning);
+                    if (mbr == MessageBoxResult.OK)
+                    {
+                        _noDevice = true;
+                        Close();
+                    }
+                    break;
+                case 1:
+                    var serialPort = _serialTool.OpenPort(portList[0], "9600", "8", "1", "无", _appContext.DataReceived);
+                    if (serialPort != null)
+                    {
+                        _appContext.SerialPort = serialPort;
+                    }
+                    break;
+                default:
+                    mbr = MessageBox.Show("请到设置页面配置正确串口!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
+                    if (mbr == MessageBoxResult.OK)
+                    {
+
+                    }
+                    break;
+            }
+        }
+
+        // Windows 消息编号,采用 Windows 的消息机制来捕获插入的 USB 状态
+        public const int WmDeviceChange = 0x219;
+        public const int DbtDeviceArrival = 0x8000;
+        public const int DbtDeviceRemoveComplete = 0x8004;
+
+        // 设备插拔改变函数
+        private IntPtr DeviceChanged(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
+        {
+            if (msg != WmDeviceChange) return IntPtr.Zero;
+            switch (wParam.ToInt32())
+            {
+                case DbtDeviceArrival:
+                    // 设备插入
+                    LoadDevice();
+                    Console.WriteLine("设备插入");
+                    break;
+                case DbtDeviceRemoveComplete:
+                    // 设备卸载
+                    Console.WriteLine("设备卸载");
+                    break;
+            }
+            return IntPtr.Zero;
+        }
+    }
+}

+ 55 - 0
Theatre/Properties/AssemblyInfo.cs

@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("Theatre")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Theatre")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+//若要开始生成可本地化的应用程序,请
+//<PropertyGroup> 中的 .csproj 文件中
+//例如,如果您在源文件中使用的是美国英语,
+//使用的是美国英语,请将 <UICulture> 设置为 en-US。  然后取消
+//对以下 NeutralResourceLanguage 特性的注释。  更新
+//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None, //主题特定资源词典所处位置
+                                     //(当资源未在页面
+                                     //或应用程序资源字典中找到时使用)
+    ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
+                                              //(当资源未在页面
+                                              //、应用程序或任何主题专用资源字典中找到时使用)
+)]
+
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 72 - 0
Theatre/Properties/Resources.Designer.cs

@@ -0,0 +1,72 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Theatre.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Theatre.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   使用此强类型资源类,为所有资源查找
+        ///   重写当前线程的 CurrentUICulture 属性。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 音频资源(wav类型)|*.wav|所有文件|*.* 的本地化字符串。
+        /// </summary>
+        internal static string SettingsWindow_Audio_Filter {
+            get {
+                return ResourceManager.GetString("SettingsWindow_Audio_Filter", resourceCulture);
+            }
+        }
+    }
+}

+ 120 - 0
Theatre/Properties/Resources.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="SettingsWindow_Audio_Filter" xml:space="preserve">
+    <value>音频资源(wav类型)|*.wav|所有文件|*.*</value>
+  </data>
+</root>

+ 98 - 0
Theatre/Properties/Settings.Designer.cs

@@ -0,0 +1,98 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Theatre.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string Audio1 {
+            get {
+                return ((string)(this["Audio1"]));
+            }
+            set {
+                this["Audio1"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string Audio2 {
+            get {
+                return ((string)(this["Audio2"]));
+            }
+            set {
+                this["Audio2"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string Audio3 {
+            get {
+                return ((string)(this["Audio3"]));
+            }
+            set {
+                this["Audio3"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string Audio4 {
+            get {
+                return ((string)(this["Audio4"]));
+            }
+            set {
+                this["Audio4"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string Audio5 {
+            get {
+                return ((string)(this["Audio5"]));
+            }
+            set {
+                this["Audio5"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string Audio6 {
+            get {
+                return ((string)(this["Audio6"]));
+            }
+            set {
+                this["Audio6"] = value;
+            }
+        }
+    }
+}

+ 24 - 0
Theatre/Properties/Settings.settings

@@ -0,0 +1,24 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Theatre.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="Audio1" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="Audio2" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="Audio3" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="Audio4" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="Audio5" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="Audio6" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+  </Settings>
+</SettingsFile>

+ 158 - 0
Theatre/SerialTool.cs

@@ -0,0 +1,158 @@
+using System;
+using System.Collections.Generic;
+using System.IO.Ports;
+
+namespace Theatre
+{
+    class SerialTool
+    {
+        private static SerialTool serialTool = null;
+
+        private SerialTool() { }
+
+        public static SerialTool GetSerialTool()
+        {
+            return serialTool ?? (serialTool = new SerialTool());
+        }
+
+        public List<string> FindPort()
+        {
+            var portList = new List<string>();
+            for (var i = 0; i < 16; i++)
+            {
+                try
+                {
+                    var serialPort = new SerialPort("COM" + (i + 1).ToString());
+                    serialPort.Open();
+                    serialPort.Close();
+                    portList.Add("COM" + (i + 1).ToString());
+                }
+                catch (Exception)
+                {
+                    continue;
+                }
+            }
+            return portList;
+        }
+
+        public delegate void SerialListener(object sender, SerialDataReceivedEventArgs e);
+
+        public SerialPort OpenPort(string portName, string baudRate, string dataBits, string stopBits, string parity, SerialListener serialListener)
+        {
+            // 检测串口设置
+            if (portName == "" || baudRate == "" || dataBits == "" || stopBits == "" || parity == "")
+            {
+                // MessageBox.Show("串口未设置!", "错误提示");
+                return null;
+            }
+            // 设置串口
+            var serialPort = SetPortProperty(portName, baudRate, dataBits, stopBits, parity, serialListener);
+            // 打开串口
+            try
+            {
+                serialPort.Open();
+                return serialPort;
+            }
+            catch (Exception)
+            {
+                // MessageBox.Show("串口无效或已被占用!", "错误提示");
+                return null;
+            }
+        }
+
+        private SerialPort SetPortProperty(string portName, string baudRate, string dataBits, string stopBits, string parity, SerialListener serialListener)
+        {
+            // 设置串口的属性
+            var serialPort = new SerialPort();
+            // 设置串口名
+            serialPort.PortName = portName.Trim();
+            // 设置串口的波特率
+            serialPort.BaudRate = Convert.ToInt32(baudRate.Trim());
+            // 设置停止位
+            float f = Convert.ToSingle(stopBits.Trim());
+            if (f == 0)
+            {
+                serialPort.StopBits = StopBits.None;
+            }
+            else if (f == 1.5)
+            {
+                serialPort.StopBits = StopBits.OnePointFive;
+            }
+            else if (f == 1)
+            {
+                serialPort.StopBits = StopBits.One;
+            }
+            else if (f == 2)
+            {
+                serialPort.StopBits = StopBits.Two;
+            }
+            else
+            {
+                serialPort.StopBits = StopBits.One;
+            }
+            // 设置数据位 
+            serialPort.DataBits = Convert.ToInt16(dataBits.Trim());
+            // 设置奇偶校验位
+            string s = parity.Trim();
+            if (String.Compare(s, "无", StringComparison.Ordinal) == 0)
+            {
+                serialPort.Parity = Parity.None;
+            }
+            else if (String.Compare(s, "奇校验", StringComparison.Ordinal) == 0)
+            {
+                serialPort.Parity = Parity.Odd;
+            }
+            else if (s.CompareTo("偶校验") == 0)
+            {
+                serialPort.Parity = Parity.Even;
+            }
+            else
+            {
+                serialPort.Parity = Parity.None;
+            }
+            // 设置超时读取时间
+            serialPort.ReadTimeout = -1;
+            serialPort.RtsEnable = true;
+            // 定义 DataReceived 事件,当串口收到数据后触发事件
+            serialPort.DataReceived += new SerialDataReceivedEventHandler(serialListener);
+            return serialPort;
+        }
+
+        public bool ClosePort(SerialPort serialPort)
+        {
+            // 关闭串口
+            try
+            {
+                serialPort.Close();
+                return true;
+            }
+            catch (Exception)
+            {
+                return false;
+            }
+        }
+
+        public bool SendToPort(SerialPort serialPort, string data)
+        {
+            // 写串口数据
+            if (serialPort.IsOpen)
+            {
+                try
+                {
+                    serialPort.WriteLine(data);
+                    return true;
+                }
+                catch (Exception)
+                {
+                    // MessageBox.Show("发送数据时发生错误!", "错误提示");
+                    return false;
+                }
+            }
+            else
+            {
+                // MessageBox.Show("串口未打开!", "错误提示");
+                return false;
+            }
+        }
+    }
+}

+ 56 - 0
Theatre/SettingsWindow.xaml

@@ -0,0 +1,56 @@
+<Window x:Class="Theatre.SettingsWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:Theatre"
+        mc:Ignorable="d"
+        Title="设置" Height="520" Width="500" ResizeMode="NoResize" Loaded="Window_Loaded" Closing="Window_Closing">
+    <Grid>
+        <GroupBox Header="连接设备" Margin="10,10,10,0" VerticalAlignment="Top" Height="66">
+            <Grid Margin="10,10,10,10">
+                <Label Content="设备名称" HorizontalAlignment="Left" Height="24"/>
+                <ComboBox x:Name="Devices" Margin="64,0,0,0" Height="24" VerticalAlignment="Top" HorizontalAlignment="Left" Width="230" BorderBrush="White">
+                    <ComboBox.Background>
+                        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                            <GradientStop Color="#FFF0F0F0" Offset="0"/>
+                            <GradientStop Color="White" Offset="1"/>
+                        </LinearGradientBrush>
+                    </ComboBox.Background>
+                    <ComboBox.RenderTransform>
+                        <TransformGroup>
+                            <ScaleTransform/>
+                            <SkewTransform/>
+                            <RotateTransform Angle="0"/>
+                            <TranslateTransform/>
+                        </TransformGroup>
+                    </ComboBox.RenderTransform>
+                </ComboBox>
+                <Button x:Name="Scan" Content="扫描设备" Margin="299,0,0,0" Width="64" Height="24" HorizontalAlignment="Left" Background="White" Foreground="Blue" Click="Scan_Click"/>
+                <Button x:Name="Connect" Content="连接设备" Margin="368,0,0,0" Width="64" Height="24" HorizontalAlignment="Left" Foreground="Green" Background="White" Click="Connect_Click"/>
+            </Grid>
+        </GroupBox>
+        <GroupBox Header="音频资源" Margin="10,81,10,10">
+            <Grid Margin="10,10,10,10">
+                <Label Content="音频一" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top"/>
+                <TextBox x:Name="Audio1" HorizontalAlignment="Left" Width="364" Height="24" Margin="0,29,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" IsEnabled="False" VerticalContentAlignment="Center"/>
+                <Button x:Name="Audio1Choose" Content="选择文件" Margin="369,29,0,0" VerticalAlignment="Top" Height="24" Click="Audio1Choose_Click"/>
+                <Label Content="音频二" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Margin="0,58,0,0"/>
+                <TextBox x:Name="Audio2" HorizontalAlignment="Left" Width="364" Height="24" Margin="0,87,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" IsEnabled="False" VerticalContentAlignment="Center"/>
+                <Button x:Name="Audio2Choose" Content="选择文件" Margin="369,87,0,0" VerticalAlignment="Top" Height="24" Click="Audio2Choose_Click"/>
+                <Label Content="音频三" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Margin="0,116,0,0"/>
+                <TextBox x:Name="Audio3" HorizontalAlignment="Left" Width="364" Height="24" Margin="0,145,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" IsEnabled="False" VerticalContentAlignment="Center"/>
+                <Button x:Name="Audio3Choose" Content="选择文件" Margin="369,145,0,0" VerticalAlignment="Top" Height="24" Click="Audio3Choose_Click"/>
+                <Label Content="音频四" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Margin="0,174,0,0"/>
+                <TextBox x:Name="Audio4" HorizontalAlignment="Left" Width="364" Height="24" Margin="0,203,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" IsEnabled="False" VerticalContentAlignment="Center"/>
+                <Button x:Name="Audio4Choose" Content="选择文件" Margin="369,203,0,0" VerticalAlignment="Top" Height="24" Click="Audio4Choose_Click"/>
+                <Label Content="音频五" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Margin="0,232,0,0"/>
+                <TextBox x:Name="Audio5" HorizontalAlignment="Left" Width="364" Height="24" Margin="0,261,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" IsEnabled="False" VerticalContentAlignment="Center"/>
+                <Button x:Name="Audio5Choose" Content="选择文件" Margin="369,261,0,0" VerticalAlignment="Top" Height="24" Click="Audio5Choose_Click"/>
+                <Label Content="音频六" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Margin="0,290,0,0"/>
+                <TextBox x:Name="Audio6" HorizontalAlignment="Left" Width="364" Height="24" Margin="0,319,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" IsEnabled="False" VerticalContentAlignment="Center"/>
+                <Button x:Name="Audio6Choose" Content="选择文件" Margin="369,319,0,0" VerticalAlignment="Top" Height="24" Click="Audio6Choose_Click"/>
+            </Grid>
+        </GroupBox>
+    </Grid>
+</Window>

+ 177 - 0
Theatre/SettingsWindow.xaml.cs

@@ -0,0 +1,177 @@
+using System.Windows;
+using System.Windows.Forms;
+using System.Windows.Media;
+
+namespace Theatre
+{
+    /// <summary>
+    /// SettingsWindow.xaml 的交互逻辑
+    /// </summary>
+    public partial class SettingsWindow : Window
+    {
+        private readonly AppContext _appContext = AppContext.GetAppContext();
+        private readonly SerialTool _serialTool = SerialTool.GetSerialTool();
+
+        private OpenFileDialog _ofd;
+        
+        public SettingsWindow()
+        {
+            InitializeComponent();
+        }
+
+        private void Window_Loaded(object sender, RoutedEventArgs e)
+        {
+            _ofd = new OpenFileDialog
+            {
+                Filter = Properties.Resources.SettingsWindow_Audio_Filter,
+                ValidateNames = true,
+                CheckPathExists = true,
+                CheckFileExists = true,
+                Multiselect = false
+            };
+
+            Audio1.Text = Properties.Settings.Default.Audio1;
+            Audio2.Text = Properties.Settings.Default.Audio2;
+            Audio3.Text = Properties.Settings.Default.Audio3;
+            Audio4.Text = Properties.Settings.Default.Audio4;
+            Audio5.Text = Properties.Settings.Default.Audio5;
+
+            if (_appContext.PortOpen)
+            {
+                Devices.Items.Clear();
+                Devices.Items.Add(_appContext.SerialPort.PortName);
+                Devices.SelectedIndex = 0;
+                Devices.IsEnabled = false;
+                Connect.Content = "断开连接";
+                Connect.Foreground = Brushes.Red;
+                Scan.IsEnabled = false;
+            }
+            else
+            {
+                Connect.Content = "连接设备";
+                Connect.Foreground = Brushes.Green;
+                Scan_Click(null, null);
+            }
+        }
+
+        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+        {
+            Properties.Settings.Default.Save();
+            Properties.Settings.Default.Reload();
+        }
+
+        private void Scan_Click(object sender, RoutedEventArgs e)
+        {
+            // 清除当前串口号中的所有串口名称
+            Devices.Items.Clear();
+            var portList = _serialTool.FindPort();
+            if (portList.Count == 0)
+            {
+                System.Windows.Forms.MessageBox.Show("没有找到可用设备!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+            }
+            else
+            {
+                portList.ForEach(
+                    delegate (string portName) {
+                        Devices.Items.Add(portName);
+                    });
+                //使 ListBox 显示第1个添加的索引
+                Devices.SelectedIndex = 0;
+            }
+        }
+
+        private void Connect_Click(object sender, RoutedEventArgs e)
+        {
+            if (_appContext.PortOpen)
+            {
+                // 关闭串口
+                if (_serialTool.ClosePort(_appContext.SerialPort))
+                {
+                    Devices.IsEnabled = true;
+                    Scan.IsEnabled = true;
+                    Scan_Click(null, null);
+                    Connect.Content = "连接设备";
+                    Connect.Foreground = Brushes.Green;
+                    _appContext.SerialPort = null;
+                }
+                else
+                {
+                    System.Windows.Forms.MessageBox.Show("断开连接失败!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
+            }
+            else
+            {
+                // 检测串口设置
+                var portName = Devices.Text.Trim();
+                if (portName == "")
+                {
+                    System.Windows.Forms.MessageBox.Show("没有发现可连接设备!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    return;
+                }
+                // 打开串口
+                var serialPort = _serialTool.OpenPort(portName, "9600", "8", "1", "无", _appContext.DataReceived);
+                if (serialPort == null)
+                {
+                    // 打开串口失败
+                    System.Windows.Forms.MessageBox.Show("连接设备失败!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
+                else
+                {
+                    Devices.IsEnabled = false;
+                    Scan.IsEnabled = false;
+                    Connect.Content = "断开连接";
+                    Connect.Foreground = Brushes.Red; ;
+                    _appContext.SerialPort = serialPort;
+                }
+            }
+        }
+
+        private void Audio1Choose_Click(object sender, RoutedEventArgs e)
+        {
+            if (_ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
+            var strFileName = _ofd.FileName;
+            Audio1.Text = strFileName;
+            Properties.Settings.Default.Audio1 = strFileName;
+        }
+
+        private void Audio2Choose_Click(object sender, RoutedEventArgs e)
+        {
+            if (_ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
+            var strFileName = _ofd.FileName;
+            Audio2.Text = strFileName;
+            Properties.Settings.Default.Audio2 = strFileName;
+        }
+
+        private void Audio3Choose_Click(object sender, RoutedEventArgs e)
+        {
+            if (_ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
+            var strFileName = _ofd.FileName;
+            Audio3.Text = strFileName;
+            Properties.Settings.Default.Audio3 = strFileName;
+        }
+
+        private void Audio4Choose_Click(object sender, RoutedEventArgs e)
+        {
+            if (_ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
+            var strFileName = _ofd.FileName;
+            Audio4.Text = strFileName;
+            Properties.Settings.Default.Audio4 = strFileName;
+        }
+
+        private void Audio5Choose_Click(object sender, RoutedEventArgs e)
+        {
+            if (_ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
+            var strFileName = _ofd.FileName;
+            Audio5.Text = strFileName;
+            Properties.Settings.Default.Audio5 = strFileName;
+        }
+
+        private void Audio6Choose_Click(object sender, RoutedEventArgs e)
+        {
+            if (_ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
+            var strFileName = _ofd.FileName;
+            Audio6.Text = strFileName;
+            Properties.Settings.Default.Audio6 = strFileName;
+        }
+    }
+}

+ 116 - 0
Theatre/Theatre.csproj

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{FD89B510-3218-4F63-B311-2D387CF09859}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Theatre</RootNamespace>
+    <AssemblyName>Theatre</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <WarningLevel>4</WarningLevel>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xaml">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsBase" />
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+  </ItemGroup>
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </ApplicationDefinition>
+    <Compile Include="AppContext.cs" />
+    <Compile Include="SerialTool.cs" />
+    <Compile Include="SettingsWindow.xaml.cs">
+      <DependentUpon>SettingsWindow.xaml</DependentUpon>
+    </Compile>
+    <Page Include="MainWindow.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Page Include="SettingsWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <AppDesigner Include="Properties\" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>