From ecf4d7908e0b6152bb536070c7394c864d2e1fd6 Mon Sep 17 00:00:00 2001 From: Kaniu Tayou <1056879522@qq.com> Date: Tue, 18 Dec 2018 23:55:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=99=BB=E5=BD=95=E7=AA=97?= =?UTF-8?q?=E5=8F=A3UI=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Interact/Client.cs | 2 +- StormChatWPF/Chat.cs | 21 ++++++--------------- StormChatWPF/LogWindow.xaml | 28 ++++++++++++++++++++-------- StormChatWPF/LogWindow.xaml.cs | 3 ++- StormChatWPF/MainWindow.xaml.cs | 4 ++-- StormChatWPF/StormChatWPF.csproj | 6 ++++++ StormChatWPF/UI/登录界面底.png | Bin 0 -> 80589 bytes StormChatWPF/UI/闪电.png | Bin 0 -> 43236 bytes 8 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 StormChatWPF/UI/登录界面底.png create mode 100644 StormChatWPF/UI/闪电.png diff --git a/Interact/Client.cs b/Interact/Client.cs index d782ff0..35aa041 100644 --- a/Interact/Client.cs +++ b/Interact/Client.cs @@ -80,7 +80,7 @@ namespace Interact return false; } - workingDictionary.Clear(); //清空临时记录 + workingDictionary?.Clear(); //清空临时记录 if (sendLoopThread != null) sendLoopThread.Abort(); if (readLoopThread != null) diff --git a/StormChatWPF/Chat.cs b/StormChatWPF/Chat.cs index e67a055..67a49b9 100644 --- a/StormChatWPF/Chat.cs +++ b/StormChatWPF/Chat.cs @@ -19,20 +19,8 @@ namespace StormChatWPF StormClient.OnGetUserListDone += GetContactsList; StormClient.OnMessage +=ReciveMessage; } + internal User SetContact { get; set; }//设置当前联系人对象 - - private User ChatNow; - internal User SetContact - { - get - { - return ChatNow; - } - set - { - ChatNow = value; - } - }//设置当前联系人对象 internal static void GetContactsList(ResultHead head, User[] users) { if (head.Error != "") @@ -47,7 +35,10 @@ namespace StormChatWPF { if (StormClient.Initialize()) { - StormClient.QueueLogin(user,password); + if (!StormClient.QueueLogin(user, password)) + { + MessageBox.Show("登录失败"); + } } else { @@ -68,7 +59,7 @@ namespace StormChatWPF } else { - MessageBox.Show("登录失败!"); + MessageBox.Show("请核对账号密码!"); } }); }//登录完成 diff --git a/StormChatWPF/LogWindow.xaml b/StormChatWPF/LogWindow.xaml index efe8c9a..ed4a88f 100644 --- a/StormChatWPF/LogWindow.xaml +++ b/StormChatWPF/LogWindow.xaml @@ -5,13 +5,25 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:StormChatWPF" mc:Ignorable="d" - Title="MainWindow" Height="450" Width="800"> - - -