public DeleteMessages(CurrentUser user, int roomId) { this._user = user; this._roomId = roomId; this._client = new ChatService.ChatClient("Unisex"); InitializeComponent(); PopulateMyMessages(); }
public ChatroomOptions(CurrentUser user) { InitializeComponent(); this._currentUser = user; this._client = new ChatService.ChatClient("Unisex"); SetComponentsToCorrectState(user); PopulateCurrentOnlineUsersCounter(); _timer = new Timer(); _timer.Interval = 3000; _timer.Tick += RefreshCounter; _timer.Start(); }
public static string PopulateChatWithMessages(int roomId, string endpoint) { var _chatClient = new ChatService.ChatClient(endpoint); var userMessages = _chatClient.GetChatFromDatabase(roomId); string result = ""; foreach (var message in userMessages) { if (message.RoomID == roomId) result += string.Format("{0}: {1} ({2}) \r\n", message.Submitter, message.Message, message.TimeStamp.ToShortTimeString()); } return result; }
public Login() { try { InitializeComponent(); _chatClient = new ChatService.ChatClient("Unisex"); } catch (FaultException ex) { MessageBox.Show("Service error"); } catch (Exception ex) { MessageBox.Show("Client error"); } }
private void PopulateList() { textBoxCurrentOnline.Text = ""; var client = new ChatService.ChatClient("Unisex"); var onlineUsers = client.GetOnlineUsers(); foreach (var user in onlineUsers) { string stringUser = ""; for (int i = 0; i < user.Length; i++) { if (i == 0) stringUser += user[i].ToString().ToUpper(); else stringUser += user[i].ToString().ToLower(); } textBoxCurrentOnline.Text += stringUser + "\r\n"; } }