一些新设定

This commit is contained in:
Kaniu Tayou
2018-12-18 19:38:27 +08:00
parent 29b281a71f
commit ad745595e8
7 changed files with 78 additions and 67 deletions
+18 -25
View File
@@ -11,13 +11,9 @@ namespace StormChatWPF
{
class Chat
{
public static List<User> userlist = new List<User>();//联系人集合
public static User[] userlist;//联系人集合
public static User ChatNow = new User();//当前聊天对象
internal static void GetUsers(ResultHandler head, User user)
{
}//获取联系人对象
internal static void GetUserList(ResultHead head, User[] users)
{
if (head.Error != "")
@@ -25,27 +21,24 @@ namespace StormChatWPF
MessageBox.Show("无法获取联系人列表");
}
else
return;
}//获取用户列表
internal static void GetUserPhoto(ResultHead head, Image image)
{
if (head.Error != "")
{
MessageBox.Show("无法读取用户图片");
}
}//对用户头像进行赋值
userlist = users;
}//获取联系人用户列表
internal void Log(string user,string password)
{
if (StormClient.Initialize())
{
StormClient.QueueLogin(user,password);
}
else
{
MessageBox.Show("连接服务器失败!");
if (StormClient.Initialize())
{
StormClient.QueueLogin(user,password);
}
else
{
MessageBox.Show("连接服务器失败!");
}
}//登录
internal static void HaveLogin(ResultHead head, User user)
internal static void Reconnect(Exception e)
{
StormClient.Initialize();
}//尝试重连接一次,如果失败,则关闭mainwindow,打开登录窗口
internal static void HaveLogin(ResultHead head, User user)
{
App.Current.Dispatcher.Invoke(
(Action)delegate ()
@@ -55,13 +48,13 @@ namespace StormChatWPF
User.Me = user;
MainWindow userWindow = new MainWindow();
userWindow.Show();
LogWindow.a.Close();
LogWindow.entry.Close();
}
else
{
MessageBox.Show("登录失败!");
}
});
});
}//登录完成