Ejemplo n.º 1
0
        private void SendMessage()
        {
            Message        message        = new Message(MainWindowViewModel.ClientUser, MessageText);
            MessageRequest messageRequest = new MessageRequest(message);

            DataTransferHelper.SendRequestToServer(MainWindowViewModel.Client, messageRequest);
        }
Ejemplo n.º 2
0
        private void SignUp()
        {
            MainWindowViewModel.SettingsManager.Settings.ServerIPAddress = IPAddress;
            MainWindowViewModel.SettingsManager.ApplySettings();
            MainWindowViewModel.Connect();
            if (!MainWindowViewModel.IsConnected)
            {
                return;
            }
            RegistrationRequest registrationRequest = new RegistrationRequest(UserName, Password);

            DataTransferHelper.SendRequestToServer(MainWindowViewModel.Client, registrationRequest);
        }
Ejemplo n.º 3
0
        public static void Disconnect()
        {
            if (!IsConnected)
            {
                return;
            }

            Request disconnectRequest = new SignOutRequest();

            DataTransferHelper.SendRequestToServer(Client, disconnectRequest);
            Client?.Close();

            IsConnected = false;
        }
Ejemplo n.º 4
0
        private void SignOut()
        {
            SignOutRequest signOutRequest = new SignOutRequest();

            DataTransferHelper.SendRequestToServer(MainWindowViewModel.Client, signOutRequest);
        }