private async void LoginSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var login = e.SelectedItem as VaultListPageModel.AutofillLogin;

            if (login == null)
            {
                return;
            }

            if (Uri.StartsWith("http") && _deviceInfoService.Version < 21)
            {
                MoreClickedAsync(login);
            }
            else
            {
                bool doAutofill = true;
                if (login.Fuzzy)
                {
                    doAutofill = await UserDialogs.ConfirmAsync(
                        string.Format(AppResources.BitwardenAutofillServiceMatchConfirm, _name),
                        okText : AppResources.Yes, cancelText : AppResources.No);
                }

                if (doAutofill)
                {
                    GoogleAnalyticsService.TrackExtensionEvent("AutoFilled", Uri.StartsWith("http") ? "Website" : "App");
                    MessagingCenter.Send(Application.Current, "Autofill", login as VaultListPageModel.Login);
                }
            }

            ((ListView)sender).SelectedItem = null;
        }
        private async void CipherSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var cipher = e.SelectedItem as AutofillCipher;

            if (cipher == null)
            {
                return;
            }

            if (_deviceInfoService.Version < 21)
            {
                Helpers.CipherMoreClickedAsync(this, cipher, true);
            }
            else
            {
                bool doAutofill = true;
                if (cipher.Fuzzy)
                {
                    doAutofill = await UserDialogs.ConfirmAsync(
                        string.Format(AppResources.BitwardenAutofillServiceMatchConfirm, _name),
                        okText : AppResources.Yes, cancelText : AppResources.No);
                }

                if (doAutofill)
                {
                    GoogleAnalyticsService.TrackExtensionEvent("AutoFilled", Uri.StartsWith("http") ? "Website" : "App");
                    _deviceActionService.Autofill(cipher);
                }
            }

            ((ListView)sender).SelectedItem = null;
        }
예제 #3
0
 protected async Task LogoutAsync()
 {
     if (!await UserDialogs.ConfirmAsync(AppResources.LogoutConfirmation, null, AppResources.Yes, AppResources.Cancel))
     {
         return;
     }
     AuthService.LogOut();
 }
예제 #4
0
        private async void DeleteClick(ProfileModel model)
        {
            var result = await UserDialogs.ConfirmAsync(new ConfirmConfig()
                                                        .SetTitle(AppResources.ConfirmationTitle)
                                                        .SetOkText(AppResources.Yes)
                                                        .SetCancelText(AppResources.No));

            if (result)
            {
                await RepositoryService.DeleteAsync(model);

                RefreshList();
            }
        }