diff --git a/StormChatWPF/MainWindow.xaml b/StormChatWPF/MainWindow.xaml
index 75688a8..7ac6f61 100644
--- a/StormChatWPF/MainWindow.xaml
+++ b/StormChatWPF/MainWindow.xaml
@@ -7,7 +7,11 @@
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
-
+
+
+
+
+
diff --git a/StormChatWPF/MainWindow.xaml.cs b/StormChatWPF/MainWindow.xaml.cs
index 321390f..ee20688 100644
--- a/StormChatWPF/MainWindow.xaml.cs
+++ b/StormChatWPF/MainWindow.xaml.cs
@@ -1,4 +1,5 @@
-using System;
+using Interact;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -23,6 +24,37 @@ namespace StormChatWPF
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/Resources.Designer.cs b/StormChatWPF/Properties/Resources.Designer.cs
index 1999c40..f0f2a03 100644
--- a/StormChatWPF/Properties/Resources.Designer.cs
+++ b/StormChatWPF/Properties/Resources.Designer.cs
@@ -1,71 +1,73 @@
//------------------------------------------------------------------------------
//
// 此代码由工具生成。
-// 运行时版本: 4.0.30319.42000
+// 运行时版本:4.0.30319.42000
//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,则所做更改将丢失。
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
//
//------------------------------------------------------------------------------
-namespace StormChatWPF.Properties
-{
-
-
+namespace StormChatWPF.Properties {
+ using System;
+
+
///
- /// 强类型资源类,用于查找本地化字符串等。
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
///
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
- // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [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
- {
-
+ 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()
- {
+ internal Resources() {
}
-
+
///
- /// 返回此类使用的缓存 ResourceManager 实例。
+ /// 返回此类使用的缓存的 ResourceManager 实例。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
+ 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 属性
+ /// 重写当前线程的 CurrentUICulture 属性。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
return resourceCulture;
}
- set
- {
+ 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
index af7dbeb..e42b90e 100644
--- a/StormChatWPF/Properties/Resources.resx
+++ b/StormChatWPF/Properties/Resources.resx
@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
+
@@ -68,9 +69,10 @@
-
+
+
@@ -85,9 +87,10 @@
-
+
+
@@ -109,9 +112,13 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.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/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
index 0da8516..41589ed 100644
--- a/StormChatWPF/StormChatWPF.csproj
+++ b/StormChatWPF/StormChatWPF.csproj
@@ -40,6 +40,7 @@
+
@@ -58,6 +59,9 @@
MSBuild:Compile
Designer
+
+ UserWindow.xaml
+
MSBuild:Compile
Designer
@@ -70,6 +74,10 @@
MainWindow.xaml
Code
+
+ Designer
+ MSBuild:Compile
+
@@ -97,5 +105,14 @@
+
+
+
+
+
+ {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();
+ }
+ }
+}