Example #1
0
        public ContainsSymbolsViewModel(PasswordFinderOptions options)
        {
            Options = options;

            YesCommand = ReactiveCommand.Create(() => SetAnswer(true));
            NoCommand  = ReactiveCommand.Create(() => SetAnswer(false));
        }
 public SearchPasswordViewModel(PasswordFinderOptions options)
 {
     Options   = options;
     _hourText = "";
     _minText  = "";
     _secText  = "";
 }
Example #3
0
        public ContainsNumbersViewModel(PasswordFinderOptions options)
        {
            Options = options;
            Title   = "Password Finder";

            YesCommand = ReactiveCommand.Create(() => SetAnswer(true));
            NoCommand  = ReactiveCommand.Create(() => SetAnswer(false));
        }
    public SelectCharsetViewModel(PasswordFinderOptions options)
    {
        Options = options;
        SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);

        EnableBack = true;

        Charsets = Enum.GetValues(typeof(Charset)).Cast <Charset>().Select(x => new CharsetViewModel(this, x));
    }
    public SearchPasswordViewModel(PasswordFinderOptions options)
    {
        Options   = options;
        _hourText = "";
        _minText  = "";
        _secText  = "";

        SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);

        EnableBack = false;
    }
    private async Task FindPasswordAsync(PasswordFinderOptions options, CancellationToken token)
    {
        try
        {
            string?foundPassword = null;
            var    result        = await Task.Run(() => PasswordFinderHelper.TryFind(options, out foundPassword, SetStatus, token));

            if (result && foundPassword is { })
            {
                Navigate().To(new PasswordFoundViewModel(foundPassword), NavigationMode.Clear);
            }
    public ContainsSymbolsViewModel(PasswordFinderOptions options)
    {
        Options = options;

        SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);

        EnableBack = true;

        YesCommand = ReactiveCommand.Create(() => SetAnswer(true));
        NoCommand  = ReactiveCommand.Create(() => SetAnswer(false));
    }
Example #8
0
        public SearchPasswordViewModel(PasswordFinderOptions options)
        {
            Options   = options;
            _hourText = "";
            _minText  = "";
            _secText  = "";

            EnableCancel = true;

            EnableBack = false;
        }
Example #9
0
        public ContainsNumbersViewModel(PasswordFinderOptions options)
        {
            Options = options;
            Icon    = AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/PasswordFinder/{ThemeHelper.CurrentTheme}/numbers.png");

            EnableCancel = true;

            EnableBack = true;

            YesCommand = ReactiveCommand.Create(() => SetAnswer(true));
            NoCommand  = ReactiveCommand.Create(() => SetAnswer(false));
        }
    public ContainsSymbolsViewModel(PasswordFinderOptions options)
    {
        Options = options;
        Icon    = AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/PasswordFinder/{ThemeHelper.CurrentTheme}/symbols.png");

        SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);

        EnableBack = true;

        YesCommand = ReactiveCommand.Create(() => SetAnswer(true));
        NoCommand  = ReactiveCommand.Create(() => SetAnswer(false));
    }
    private async Task OnNextAsync(Wallet wallet)
    {
        var dialogResult =
            await NavigateDialogAsync(
                new CreatePasswordDialogViewModel("Password", "Type in your most likely password", enableEmpty : false)
                , NavigationTarget.CompactDialogScreen);

        if (dialogResult.Result is { } password)
        {
            var options = new PasswordFinderOptions(wallet, password);
            Navigate().To(new SelectCharsetViewModel(options));
        }
    }
 private void FindPassword(PasswordFinderOptions options, CancellationToken token)
 {
     try
     {
         if (PasswordFinderHelper.TryFind(options, out var foundPassword, SetStatus, token))
         {
             Navigate().To(new PasswordFoundViewModel(foundPassword), NavigationMode.Clear);
         }
         else
         {
             Navigate().To(new PasswordNotFoundViewModel(options.Wallet), NavigationMode.Clear);
         }
     }
        private async Task OnNextAsync(Wallet wallet)
        {
            var dialogResult =
                await NavigateDialogAsync(
                    new CreatePasswordDialogViewModel("Type in your most likely password", enableEmpty : false));

            if (dialogResult.Result is { } password)
            {
                var options = new PasswordFinderOptions(wallet, password);
                Navigate().To(new SelectCharsetViewModel(options));
            }

            if (dialogResult.Kind == DialogResultKind.Cancel)
            {
                Navigate().Clear();
            }
        }
Example #14
0
        public SelectCharsetViewModel(PasswordFinderOptions options)
        {
            Title = "Password Finder";

            this.WhenAnyValue(x => x.SelectedCharset)
            .ObserveOn(RxApp.MainThreadScheduler)
            .Subscribe(x =>
            {
                if (x is null)
                {
                    return;
                }

                options.Charset = (Charset)x;
                Navigate().To(new ContainsNumbersViewModel(options));

                SelectedCharset = null;
            });
        }
        public PasswordFinderIntroduceViewModel(Wallet wallet)
        {
            NextCommand = ReactiveCommand.CreateFromTask(async() =>
            {
                var dialogResult =
                    await NavigateDialog(new EnterPasswordViewModel("Type in your most likely password", enableEmpty: false));

                if (dialogResult.Result is { } password)
                {
                    var options = new PasswordFinderOptions(wallet, password);
                    Navigate().To(new SelectCharsetViewModel(options));
                }

                if (dialogResult.Kind == DialogResultKind.Cancel)
                {
                    Navigate().Clear();
                }
            });
        }
Example #16
0
    public SelectCharsetViewModel(PasswordFinderOptions options)
    {
        Title = "Password Finder";

        SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);

        EnableBack = true;

        this.WhenAnyValue(x => x.SelectedCharset)
        .ObserveOn(RxApp.MainThreadScheduler)
        .Subscribe(x =>
        {
            if (x is null)
            {
                return;
            }

            options.Charset = (Charset)x;
            Navigate().To(new ContainsNumbersViewModel(options));

            SelectedCharset = null;
        });
    }