示例#1
0
 public ClientWindow(ChatClient client)
 {
     InitializeComponent();
     ChatClient = client;
     ChatClient.UserListReceived += chatClient_UserListReceived;
     ChatClient.MessageReceived  += chatClient_MessageReceived;
     ChatClient.FailReceived     += chatClient_FailReceived;
     tbChat.SelectionChanged     += tbChat_SelectionChanged;
     KeyDown += tbChat_KeyDown;
     Title    = ChatClient.Init() ? string.Format("{0} connected to {1} ({2})", ChatClient.UserName, ChatClient.ServerName,
                                                  ChatClient.ServerAddress) : "Disconnected";
     SetButtons();
 }