private void UserNotAvailable(Guid userId) { Guard.Against.Default(userId, nameof(userId)); var user = AvailableUsers.FirstOrDefault(x => x.UserId == userId); if (user is null) { return; } Device.BeginInvokeOnMainThread(() => { AvailableUsers.Remove(user); RaisePropertyChanged(nameof(UsersCount)); }); }
/// <summary> /// Removes the <see cref="SelectedUser"/> from the <see cref="AvailableUsers"/> /// and deleted its xml file. /// </summary> public void RemoveUser() { try { if (SelectedUser == ActiveUser) { ActiveUser = null; } // remove xml file _fileOperator.Delete(Path.Combine(USERSFOLDER, SelectedUser.Username) + ".xml"); AvailableUsers.Remove(SelectedUser); } catch (Exception ex) { _windowManager.MessageBoxService.ShowDialog("Could not remove user from list: " + ex.Message); } }
/// <summary> /// Removes the <see cref="SelectedUser"/> from the <see cref="AvailableUsers"/> /// and deleted its xml file. /// </summary> public void RemoveUser() { try { if (SelectedUser == ActiveUser) { ActiveUser = null; } // remove xml file File.Delete(USERSFOLDER + "\\" + SelectedUser.Username + ".xml"); AvailableUsers.Remove(SelectedUser); } catch (Exception ex) { MessageBox.Show("Could not remove user from list: " + ex.Message); } }