public SignUpCommand( MainWindowViewModel mainWindowViewModel, IServerChatService serverChatService) { this.mainWindowViewModel = mainWindowViewModel; this.serverChatService = serverChatService; }
public SignOutCommand( IUserService userService, IServerChatService serverChatService, MainWindowViewModel mainWindowViewModel) { this.userService = userService; this.serverChatService = serverChatService; this.mainWindowViewModel = mainWindowViewModel; }
public SignInCommand( MainWindowViewModel mainWindowViewModel, IUserService userService, IServerChatService serverChatService) { this.mainWindowViewModel = mainWindowViewModel; this.userService = userService; this.serverChatService = serverChatService; }
public ServerChatServiceTests() { var serviceCollection = new ServiceCollection(); serviceProvider = DependencyInjectionService.ConfigureServicesTransient(serviceCollection); serverChatService = serviceProvider.GetService <IServerChatService>(); serverChatService.StartServer(); }
public ChatViewModel(IServerChatService serverChat, IUserService userService) { _serverChat = serverChat; _userService = userService; Recipient = _userService.Recipient; _serverChat.MessageReceived += Server_MessageReceived; SendMessageCommand = new RelayCommand(SendMessage); Messages = new ObservableCollection <string>(); }
/// <summary> /// The class Constructor that receives the new TCP Connection, accepting the new client and waiting /// for the messages. /// </summary> /// <param name="tcpCon"></param> /// <param name="serverChatService"></param> public ChatConnectionService(TcpClient tcpCon, IServerChatService serverChatService) { TcpClient = tcpCon; ThreadSender = new Thread(AcceptClient); ThreadSender.Start(); _serverChatService = serverChatService; }
public SwitchChatCommand( IChatService chatService, IUserService userService, IServerChatService serverChatService, IMapper mapper) { this.chatService = chatService; this.userService = userService; this.serverChatService = serverChatService; this.mapper = mapper; }
public LobbyViewModel(IServerGameService serverGame, IServerChatService serverChat, IServerUserService serverUser, IUserService userService, INavigationService nav, IChatService chatService, IGameService gameService) { _serverUser = serverUser; _serverChat = serverChat; _serverGame = serverGame; _userService = userService; _nav = nav; _chatService = chatService; _gameService = gameService; _serverUser.LogInCompleted += Server_LogInCompleted; _serverUser.LogOutCompleted += Server_LogOutCompleted; _serverChat.MessageReceivedCheck += Server_MessageReceivedCheck; _serverGame.GameRequested += Server_GameRequested; _serverGame.GameAccepted += Server_GameAccepted; _serverGame.GameDeclined += Server_GameDeclined; _gameRequests = new List <string>(); LogOutCommand = new RelayCommand(LogOut); StartChatCommand = new RelayCommand <string>(StartChat); RequestGameCommand = new RelayCommand <string>(RequestGame); Task t = LoadUsers(); }
private void loginButton_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(usernameTextbox.Text)) { MessageBox.Show("Username can not be null/whitespace"); return; } usernameTextbox.Enabled = false; loginButton.Enabled = false; _userName = usernameTextbox.Text; _userId = Guid.NewGuid(); var clientChatService = new ClientChatService(); clientChatService.ConnectedClientsListUpdatedEvent += UpdateListOfConnectedClients; clientChatService.NewMessageReceivedEvent += DisplayNewMessage; // Send clientChatService to the server as our callback, so the server can signal us when needed. _serverChatProxy = new ServerChatProxy(clientChatService); _serverChannel = _serverChatProxy.ChannelFactory.CreateChannel(); try { _serverChannel.Logon(_userId, _userName); } catch (Exception) { MessageBox.Show("Failed to logon. Make sure the server application is running."); usernameTextbox.Enabled = true; loginButton.Enabled = true; return; } sendButton.Enabled = true; messageTextbox.Enabled = true; }
public DeleteChatCommand(IServerChatService serverChatService) { this.serverChatService = serverChatService; }
public CreateChatCommand(IServerChatService serverChatService) { this.serverChatService = serverChatService; }
public SendMessageCommand(IServerChatService serverChatService) { this.serverChatService = serverChatService; }
public PromoteChatMemberCommand(IServerChatService serverChatService) { this.serverChatService = serverChatService; }