public void ProcessObject(Server.MyObject obj)
 {
     //if(obj is Server.Database.ChatContent)
     if (obj is Server.ChatContent)
     {
         ChatContent temp = obj as ChatContent;
         fChat       item = ListFormShow[0] as fChat;
         if ("" == temp.Receiver && temp.Sender == "")
         {
             temp.Receiver = User.UserName;
         }
         item.ShowChatContent(temp);
     }
     else if (obj is UserAccount)
     {
         RemoveOrAddUserOnline(obj as UserAccount);
     }
 }
Beispiel #2
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (Login() == true)
     {
         Server.Logger.Write("Dang nhap thanh cong");
         //Server.Logger.Write(ClientSite.Instance.User.UserName);
         this.Hide();
         fChat f = new fChat();
         ClientSite.Instance.ListFormShow.Add(f);
         f.ShowDialog();
         this.Show();
     }
     else
     {
         MessageBox.Show("Đăng nhập thất bại!");
         Server.Logger.Write("Can't connect!");
     }
     ClientSite.Instance.Finish();
 }