Beispiel #1
0
        public async System.Threading.Tasks.Task OpenRoomAsync(string roomId)
        {
            Chromium.SetSettings(roomId);
            var jepa = Chromium.Connect();

            jepa.Height = 720;
            jepa.Width  = 405;

            VideoChatCanvas.Children.Add(jepa);
            chatGrid.Visibility      = Visibility.Visible;
            GraphCanvas.Visibility   = Visibility.Visible;
            ControlCanvas.Visibility = Visibility.Visible;
            leaveButton.Visibility   = Visibility.Visible;
            LobbysCanvas.Visibility  = Visibility.Hidden;
            conferenssionString.Text = $"Конференция №{roomId.Substring(0, 8)}";
            ConferensionString.Text  = $"Чат конференции №{roomId.Substring(0, 8)}";
            ///
            try
            {
                await SocketConnector.InitializeClientAsync();

                SocketConnector.SetSettings(roomId, UserInfo.Name);
                SocketConnector.client.On("chat-message", async response =>
                {
                    var text = JsonConvert.DeserializeObject <JSONmessage[]>(response.ToString());
                    await Dispatcher.BeginInvoke((Action)(() => ChatBox.AppendText($"{text[0].UserId}: {text[0].Message}\n\n")));
                    Console.WriteLine($"{text[0].UserId}: {text[0].Message}");
                });
                chatTextBox.IsReadOnly = (SocketConnector.IsConnected) ? false : true;
            }
            catch { }
        }
Beispiel #2
0
        private void SendButton_Clicked(object sender, RoutedEventArgs e)
        {
            chatCount += 1;
            ChatsScrollView.ScrollToBottom();
            ChatBox.AppendText($"Вы: {chatTextBox.Text}\n\n");
            SocketConnector.SendMessage(chatTextBox.Text);
            chatTextBox.Text = "";

            //ChatTextBlock.Text = chatTextBox.Text;
        }
Beispiel #3
0
        private async System.Threading.Tasks.Task LobbyLeave_ClickAsync(object sender, RoutedEventArgs e)
        {
            await SocketConnector.Disconnect();

            chatTextBox.IsReadOnly            = (SocketConnector.IsConnected) ? false : true;
            chatGrid.Visibility               = Visibility.Hidden;
            ConferensionIDTextBox.BorderBrush = Brushes.Gray;
            GraphCanvas.Visibility            = Visibility.Hidden;
            FreeModeCanvas.Visibility         = Visibility.Hidden;
            ControlCanvas.Visibility          = Visibility.Hidden;
            conferenssionString.Text          = "Конференция № ...";
            leaveButton.Visibility            = Visibility.Hidden;

            CreateLobbyButton.Visibility     = Visibility.Visible;
            ConferensionIDTextBox.Visibility = Visibility.Hidden;
            CancelLobbyButton.Visibility     = Visibility.Hidden;
            ConnectToLobbyButton.Visibility  = Visibility.Hidden;
            LobbysCanvas.Visibility          = Visibility.Visible;
        }