public MessagesReceiver(IUserStateListener userStateListener, GrowlNotifiactions growlNotifiactions, IUiUserMessageService uiUserMessageService) { _userStateListener = userStateListener; _growlNotifiactions = growlNotifiactions; _uiUserMessageService = uiUserMessageService; _userStateListener.UserStateChanged += HandleStateChanged; _uiUserMessageService.ReceivedMessages += HandleUserMessageServiceReceivedMessages; }
public SendMessageViewModel(IUiUserMessageService userMessageService, long toAccount) { SendingInProgress = false; _sendMessageVisible = Visibility.Collapsed; _userMessageService = userMessageService; _toAccount = toAccount; Send = new DelegateCommand(OnSendMessage); Cancel = new DelegateCommand(OnCancelMessage); }
public RoomStateViewModel(IUiRoomService roomService, IUiAuthenticationService authenticationService, IUiUserMessageService userMessageService) { _roomService = roomService; _authenticationService = authenticationService; _userMessageService = userMessageService; _poller = new Timer(PollUserStates); UserStates = new ObservableCollection <UserStateInfoViewModel>(); _context = SynchronizationContext.Current; roomService.QueryRoomStatusCompleted += HandleQueryRoomStatusCompleted; roomService.JoinRoomCompleted += HandleJoinRoomCompleted; }
public MainWindowViewModel(IUiAuthenticationService authenticationService, IUiRoomService roomService, IUiGlobalRoomsService globalRoomsService, IUserStateService userStateService, IUiUserMessageService uiUserMessageService) { _authenticationService = authenticationService; _roomService = roomService; _loginViewModel = new LoginViewModel(authenticationService); _roomNavigationViewModel = new RoomNavigationViewModel(roomService, globalRoomsService); _roomStateViewModel = new RoomStateViewModel(_roomService, authenticationService, uiUserMessageService); _startStopViewModel = new StartStopViewModel(userStateService); ShowLogin(); _authenticationService.LoginCompleted += HandleLoginCompleted; }
public UserStateInfoViewModel(long accountId, string username, bool isCurrentUser, IUiUserMessageService userMessageService) { Username = SanitizeUsername(username); SortString = isCurrentUser ? "!" : username; AccountId = accountId; SendMessageViewModel = new SendMessageViewModel(userMessageService, AccountId); SendMessageToUserCommand = new DelegateCommand(_ => { SendMessageViewModel.SendMessageVisible = Visibility.Visible; }); }