diff --git a/StormChat.sln b/StormChat.sln
index 699c9eb..335c8d2 100644
--- a/StormChat.sln
+++ b/StormChat.sln
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StormChat", "StormChat\Stor
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interact", "Interact\Interact.csproj", "{CEF054AF-95B7-4B88-934E-02705FEEA554}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StormChatWPF", "StormChatWPF\StormChatWPF.csproj", "{CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -41,6 +43,18 @@ Global
{CEF054AF-95B7-4B88-934E-02705FEEA554}.Release|x64.Build.0 = Release|Any CPU
{CEF054AF-95B7-4B88-934E-02705FEEA554}.Release|x86.ActiveCfg = Release|Any CPU
{CEF054AF-95B7-4B88-934E-02705FEEA554}.Release|x86.Build.0 = Release|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Debug|x64.Build.0 = Debug|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Debug|x86.Build.0 = Debug|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Release|x64.ActiveCfg = Release|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Release|x64.Build.0 = Release|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Release|x86.ActiveCfg = Release|Any CPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/StormChatWPF/App.config b/StormChatWPF/App.config
new file mode 100644
index 0000000..731f6de
--- /dev/null
+++ b/StormChatWPF/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StormChatWPF/App.xaml b/StormChatWPF/App.xaml
new file mode 100644
index 0000000..3292a54
--- /dev/null
+++ b/StormChatWPF/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/StormChatWPF/App.xaml.cs b/StormChatWPF/App.xaml.cs
new file mode 100644
index 0000000..55f30e6
--- /dev/null
+++ b/StormChatWPF/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 StormChatWPF
+{
+ ///
+ /// App.xaml 的交互逻辑
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/StormChatWPF/MainWindow.xaml b/StormChatWPF/MainWindow.xaml
new file mode 100644
index 0000000..7ac6f61
--- /dev/null
+++ b/StormChatWPF/MainWindow.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/StormChatWPF/MainWindow.xaml.cs b/StormChatWPF/MainWindow.xaml.cs
new file mode 100644
index 0000000..ee20688
--- /dev/null
+++ b/StormChatWPF/MainWindow.xaml.cs
@@ -0,0 +1,60 @@
+using Interact;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace StormChatWPF
+{
+ ///
+ /// MainWindow.xaml 的交互逻辑
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ StormClient.OnLoginDone += HaveLogin;
+ }
+
+ private void Login_button_Click(object sender, RoutedEventArgs e)
+ {
+ if (StormClient.Initialize())
+ {
+ StormClient.QueueLogin(AccountBox.Text, passwordBox.Password, null);
+ }
+ else
+ {
+ MessageBox.Show("连接服务器失败!");
+ }
+ }
+
+ private void HaveLogin(ResultHead head, User user)
+ {
+ App.Current.Dispatcher.Invoke((Action)delegate ()
+ {
+ if (head.Error == "")
+ {
+ User.Me = user;
+ UserWindow userWindow = new UserWindow();
+ userWindow.Show();
+ this.Close();
+ }
+ else
+ {
+ MessageBox.Show("登录失败!");
+ }
+ });
+ }
+ }
+}
diff --git a/StormChatWPF/Properties/AssemblyInfo.cs b/StormChatWPF/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..b9bf3cb
--- /dev/null
+++ b/StormChatWPF/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("StormChatWPF")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("StormChatWPF")]
+[assembly: AssemblyCopyright("Copyright © 2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+//若要开始生成可本地化的应用程序,请设置
+//.csproj 文件中的 CultureYouAreCodingWith
+//例如,如果您在源文件中使用的是美国英语,
+//使用的是美国英语,请将 设置为 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")]
diff --git a/StormChatWPF/Properties/Resources.Designer.cs b/StormChatWPF/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..f0f2a03
--- /dev/null
+++ b/StormChatWPF/Properties/Resources.Designer.cs
@@ -0,0 +1,73 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace StormChatWPF.Properties {
+ using System;
+
+
+ ///
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.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() {
+ }
+
+ ///
+ /// 返回此类使用的缓存的 ResourceManager 实例。
+ ///
+ [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("StormChatWPF.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 重写当前线程的 CurrentUICulture 属性
+ /// 重写当前线程的 CurrentUICulture 属性。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap LogFormBackground {
+ get {
+ object obj = ResourceManager.GetObject("LogFormBackground", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/StormChatWPF/Properties/Resources.resx b/StormChatWPF/Properties/Resources.resx
new file mode 100644
index 0000000..e42b90e
--- /dev/null
+++ b/StormChatWPF/Properties/Resources.resx
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\Resources\LogFormBackground.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/StormChatWPF/Properties/Settings.Designer.cs b/StormChatWPF/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..bafedfd
--- /dev/null
+++ b/StormChatWPF/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace StormChatWPF.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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;
+ }
+ }
+ }
+}
diff --git a/StormChatWPF/Properties/Settings.settings b/StormChatWPF/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/StormChatWPF/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StormChatWPF/Resources/LogFormBackground.jpg b/StormChatWPF/Resources/LogFormBackground.jpg
new file mode 100644
index 0000000..ea8dcfe
Binary files /dev/null and b/StormChatWPF/Resources/LogFormBackground.jpg differ
diff --git a/StormChatWPF/StormChatWPF.csproj b/StormChatWPF/StormChatWPF.csproj
new file mode 100644
index 0000000..41589ed
--- /dev/null
+++ b/StormChatWPF/StormChatWPF.csproj
@@ -0,0 +1,118 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}
+ WinExe
+ StormChatWPF
+ StormChatWPF
+ v4.6.1
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ StormChatWPF.App
+
+
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ UserWindow.xaml
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+
+
+ {cef054af-95b7-4b88-934e-02705feea554}
+ Interact
+
+
+
+
\ No newline at end of file
diff --git a/StormChatWPF/UserWindow.xaml b/StormChatWPF/UserWindow.xaml
new file mode 100644
index 0000000..4f0b28f
--- /dev/null
+++ b/StormChatWPF/UserWindow.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/StormChatWPF/UserWindow.xaml.cs b/StormChatWPF/UserWindow.xaml.cs
new file mode 100644
index 0000000..990aa17
--- /dev/null
+++ b/StormChatWPF/UserWindow.xaml.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace StormChatWPF
+{
+ ///
+ /// UserWindow.xaml 的交互逻辑
+ ///
+ public partial class UserWindow : Window
+ {
+ public UserWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}