コード例 #1
0
ファイル: VaultEditLoginPage.cs プロジェクト: GaryDeng/mobile
        protected override void OnAppearing()
        {
            base.OnAppearing();
            if (!_connectivity.IsConnected)
            {
                AlertNoConnection();
            }

            PasswordCell?.InitEvents();
            UsernameCell?.InitEvents();
            UriCell?.InitEvents();
            NameCell?.InitEvents();
            NotesCell?.InitEvents();
            TotpCell?.InitEvents();
            FolderCell?.InitEvents();

            if (PasswordCell?.Button != null)
            {
                PasswordCell.Button.Clicked += PasswordButton_Clicked;
            }
            if (TotpCell?.Button != null)
            {
                TotpCell.Button.Clicked += TotpButton_Clicked;
            }
            if (GenerateCell != null)
            {
                GenerateCell.Tapped += GenerateCell_Tapped;
            }
            if (DeleteCell != null)
            {
                DeleteCell.Tapped += DeleteCell_Tapped;
            }
        }
コード例 #2
0
ファイル: VaultAddLoginPage.cs プロジェクト: x10GitHub/mobile
        protected override void OnAppearing()
        {
            base.OnAppearing();
            if (!_connectivity.IsConnected)
            {
                AlertNoConnection();
            }

            PasswordCell.InitEvents();
            UsernameCell.InitEvents();
            UriCell.InitEvents();
            NameCell.InitEvents();
            NotesCell.InitEvents();
            TotpCell.InitEvents();
            FolderCell.InitEvents();
            PasswordCell.Button.Clicked += PasswordButton_Clicked;
            if (TotpCell?.Button != null)
            {
                TotpCell.Button.Clicked += TotpButton_Clicked;
            }
            GenerateCell.Tapped += GenerateCell_Tapped;

            if (!_fromAutofill && !_settings.GetValueOrDefault(AddedLoginAlertKey, false))
            {
                _settings.AddOrUpdateValue(AddedLoginAlertKey, true);
                if (Device.RuntimePlatform == Device.iOS)
                {
                    DisplayAlert(AppResources.BitwardenAppExtension, AppResources.BitwardenAppExtensionAlert,
                                 AppResources.Ok);
                }
                else if (Device.RuntimePlatform == Device.Android && !_appInfoService.AutofillServiceEnabled)
                {
                    DisplayAlert(AppResources.BitwardenAutofillService, AppResources.BitwardenAutofillServiceAlert,
                                 AppResources.Ok);
                }
            }

            NameCell.Entry.FocusWithDelay();
        }