Exemplo n.º 1
0
        public async Task <bool> DeleteProfile(ProfileModel selectedProfile, ModuleModel moduleModel)
        {
            var confirm = await _dialogService.ShowQuestionMessageBox("Delete profile",
                                                                      $"Are you sure you want to delete the profile named: {selectedProfile.Name}?\n\n" +
                                                                      "This cannot be undone.");

            if (!confirm.Value)
            {
                return(false);
            }

            var defaultProfile = ProfileProvider.GetProfile(_deviceManager.ActiveKeyboard, moduleModel, "Default");
            var deleteProfile  = selectedProfile;

            moduleModel.ChangeProfile(defaultProfile);
            ProfileProvider.DeleteProfile(deleteProfile);

            return(true);
        }
Exemplo n.º 2
0
        public async void DeleteProfile()
        {
            if (SelectedProfile == null)
            {
                return;
            }

            var confirm = await
                          DialogService.ShowQuestionMessageBox("Delete profile",
                                                               $"Are you sure you want to delete the profile named: {SelectedProfile.Name}?\n\n" +
                                                               "This cannot be undone.");

            if (!confirm.Value)
            {
                return;
            }

            ProfileProvider.DeleteProfile(SelectedProfile);
            LoadProfiles();
        }
Exemplo n.º 3
0
        public async void DeleteProfile()
        {
            if (SelectedProfile == null)
            {
                return;
            }

            var confirmed = await ProfileEditorModel.ConfirmDeleteProfile(SelectedProfile, _moduleModel);

            if (!confirmed)
            {
                return;
            }

            var deleteProfile = SelectedProfile;

            _moduleModel.ChangeProfile(null);
            ProfileProvider.DeleteProfile(deleteProfile);

            LoadProfiles();
            SelectedProfileName = "Default";
        }