Example #1
0
 /// <summary>
 /// Send given nickname to service.
 /// </summary>
 /// <param name="nickname">The nickname information.</param>
 private void SendNickname(string nickname)
 {
     myNickname = nickname;
     client     = new ChatServiceCallbackClient();
     client.SaveUser(client, nickname);
     client.UserInfo       += new UserInformation(client_UserInformation_Event);
     client.UpdateChatRoom += new UpdateChatRooms(client_UpdateChatRoomInformation_Event);
 }
Example #2
0
 public Chat(ChatServiceCallbackClient client, ChatClient.ChatService.User userInfo, ChatClient.ChatService.ChatRoom chatRoom)
 {
     InitializeComponent();
     this.client    = client;
     this.userInfo  = userInfo;
     this.chatRoom  = chatRoom;
     header.Content = chatRoom.Name + " Chat Room";
     client.JoinChatRoom(userInfo.Id + userInfo.Nickname, chatRoom.Id + chatRoom.Name);
     client.LatestMessageList += new LatestMessages(client_LatestMessages_Event);
 }
Example #3
0
        /// <summary>
        /// Creates chat room.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            var tempChatRoomName = newChatRoom.Text;

            if (tempChatRoomName.Length < 1)
            {
                MessageBox.Show("Please Enter a Chat Room Name.");
                return;
            }

            if (client == null)
            {
                client = new ChatServiceCallbackClient();
            }

            client.CreateChatRoom(tempChatRoomName);
        }
Example #4
0
 /// <summary>
 /// Call Save User method.
 /// </summary>
 /// <param name="client">The client instance of ChatService.</param>
 /// <param name="nickname">The nickname information.</param>
 public void SaveUser(ChatServiceCallbackClient client, string nickname)
 {
     inst       = new InstanceContext(client);
     chatClient = new ChatService.ChatServiceClient(inst);
     chatClient.SaveUser(nickname);
 }