Esempio n. 1
0
        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();
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
 public Login()
 {
     try
     {
         InitializeComponent();
         _chatClient = new ChatService.ChatClient("Unisex");
     }
     catch (FaultException ex)
     {
         MessageBox.Show("Service error");
     }
     catch (Exception ex)
     {
         MessageBox.Show("Client error");
     }
 }
Esempio n. 5
0
        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";
            }
        }