Inheritance: System.EventArgs
Exemple #1
0
        private void ClientRoomRefreshed(object sender, RoomEventArgs e)
        {
            if (e.Room.Name != Name)
            return;

              MainViewModel.Dispatcher.BeginInvoke(new Action<RoomEventArgs>(args =>
              {
            Description = args.Room;

            foreach (var user in Users)
              user.Dispose();

            Users.Clear();

            foreach (string user in Description.Users)
              Users.Add(new UserViewModel(args.Users.Find(u => string.Equals(u.Nick, user)), this));

            OnPropertyChanged("Name");
            OnPropertyChanged("Admin");
            OnPropertyChanged("Users");
              }), e);
        }
Exemple #2
0
 private void ClientRoomOpened(RoomEventArgs e)
 {
     using (var client = ClientModel.Get())
       {
     RefreshUsers(client);
     RefreshReceivers(client);
     FillMessages(client);
       }
 }
Exemple #3
0
        private void ClientRoomRefreshed(RoomEventArgs e)
        {
            using (var client = ClientModel.Get())
              {
            if (e.RoomName == Name)
              RefreshUsers(client);

            if (e.RoomName == ServerModel.MainRoomName)
              RefreshReceivers(client);
              }
        }
Exemple #4
0
        private void ClientRoomOpened(RoomEventArgs e)
        {
            // If room view model already exist then event will be processed by it self
              if (Rooms.Any(vm => vm.Name == e.RoomName))
            return;

              // Else create new view model
              var roomViewModel = new RoomViewModel(this, e.RoomName, e.Users);
              roomViewModel.Updated = true;
              Rooms.Add(roomViewModel);

              window.Alert();
        }
Exemple #5
0
        private void ClientRoomClosed(RoomEventArgs e)
        {
            var roomViewModel = Rooms.FirstOrDefault(vm => vm.Name == e.RoomName);
              if (roomViewModel == null)
            return;

              Rooms.Remove(roomViewModel);
              roomViewModel.Dispose();

              window.Alert();
        }
Exemple #6
0
    private void ClientRoomClosed(object sender, RoomEventArgs e)
    {
      Dispatcher.BeginInvoke(new Action<RoomEventArgs>(args =>
      {
        RoomViewModel roomViewModel = Rooms.FirstOrDefault(roomVM => roomVM.Name == args.Room.Name);

        if (roomViewModel == null)
          return;

        Rooms.Remove(roomViewModel);
        roomViewModel.Dispose();

        window.Alert();
      }), e);
    }
Exemple #7
0
    private void ClientRoomOpened(object sender, RoomEventArgs e)
    {
      Dispatcher.BeginInvoke(new Action<RoomEventArgs>(args =>
      {
        if (Rooms.FirstOrDefault(roomVM => roomVM.Name == args.Room.Name) != null)
          return;

        RoomViewModel roomViewModel = new RoomViewModel(this, args.Room, args.Users);
        roomViewModel.Updated = true;
        Rooms.Add(roomViewModel);

        window.Alert();
      }), e);
    }
Exemple #8
0
    private void ClientRoomRefreshed(object sender, RoomEventArgs e)
    {
      Dispatcher.BeginInvoke(new Action<RoomEventArgs>(args =>
      {
        if (args.Room.Name == ServerModel.MainRoomName)
        {
          AllUsers.Clear();

          using (var client = ClientModel.Get())
          {
            foreach (string nick in args.Room.Users)
            {
              var user = args.Users.Single(u => u.Equals(nick));
              AllUsers.Add(new UserViewModel(user, null) { IsClient = user.Equals(client.User) });
            }
          }
        }
      }), e);
    }