minor non-behavior modifying refactoring
MODIFY
WalletWasabi.Gui/CommandLine/PasswordFinderCommand.cs
WalletWasabi.Gui/CommandLine/PasswordFinderCommand.cs
@@ -34,8 +34,8 @@ namespace WalletWasabi.Gui.CommandLine
{ "w|wallet=", "The name of the wallet file.", x => WalletName = x },
{ "s|secret=", "You can specify an encrypted secret key instead of wallet. Example of encrypted secret: 6PYTMDmkxQrSv8TK4761tuKrV8yFwPyZDqjJafcGEiLBHiqBV6WviFxJV4", x => EncryptedSecret = Guard.Correct(x) },
{ "l|language=", "The charset to use: en, es, it, fr, pt. Default=en.", v => Language = v },
- { "n|numbers=", "Try passwords with numbers. Default=true.", v => UseNumbers = (v=="" || v=="1" || v.ToUpper()=="TRUE") },
- { "x|symbols=", "Try passwords with symbolds. Default=true.", v => UseSymbols = (v=="" || v=="1" || v.ToUpper()=="TRUE") },
+ { "n|numbers=", "Try passwords with numbers. Default=true.", v => UseNumbers = (v.Length==0 || v=="1" || v.ToUpper()=="TRUE") },
+ { "x|symbols=", "Try passwords with symbolds. Default=true.", v => UseSymbols = (v.Length==0 || v=="1" || v.ToUpper()=="TRUE") },
{ "h|help", "Show Help", v => ShowHelp = true }
};
}

MODIFY
WalletWasabi.Gui/Controls/LockScreen/LockScreenViewModel.cs
WalletWasabi.Gui/Controls/LockScreen/LockScreenViewModel.cs
@@ -62,7 +62,7 @@ namespace WalletWasabi.Gui.Controls.LockScreen
{
ActiveLockScreen?.Dispose();
- if (currentHash != string.Empty)
+ if (currentHash.Length == 0)
{
ActiveLockScreen = new PinLockScreenViewModel(this);
}

MODIFY
WalletWasabi.Gui/Controls/LockScreen/PinLockScreenViewModel.cs
WalletWasabi.Gui/Controls/LockScreen/PinLockScreenViewModel.cs
@@ -83,7 +83,7 @@ namespace WalletWasabi.Gui.Controls.LockScreen
this.WhenAnyValue(x => x.PinInput)
.Select(Guard.Correct)
- .Where(x => x != string.Empty)
+ .Where(x => x.Length != 0)
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x =>
{

MODIFY
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooser.xaml.cs
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooser.xaml.cs
@@ -27,8 +27,7 @@ namespace WalletWasabi.Gui.ManagedDialogs
private void OnPointerPressed(object sender, PointerPressedEventArgs e)
{
- var model = (e.Source as StyledElement)?.DataContext as ManagedFileChooserItemViewModel;
- if (model is null)
+ if (!((e.Source as StyledElement)?.DataContext is ManagedFileChooserItemViewModel model))
{
return;
}
@@ -53,12 +52,13 @@ namespace WalletWasabi.Gui.ManagedDialogs
{
base.OnDataContextChanged(e);
- var model = DataContext as ManagedFileChooserViewModel;
- if (model is null)
+ if (DataContext is null)
{
return;
}
+ var model = DataContext as ManagedFileChooserViewModel;
+
var preselected = model.SelectedItems.FirstOrDefault();
if (preselected is null)
{

MODIFY
WalletWasabi.Gui/ViewModels/TextResourceViewModelBase.cs
WalletWasabi.Gui/ViewModels/TextResourceViewModelBase.cs
@@ -18,7 +18,7 @@ namespace WalletWasabi.Gui.ViewModels
private string _text;
- public TextResourceViewModelBase(Global global, string title, Uri target) : base(global, title)
+ protected TextResourceViewModelBase(Global global, string title, Uri target) : base(global, title)
{
Text = "";
Target = target;

MODIFY
WalletWasabi.Gui/ViewModels/WasabiDocumentTabViewModel.cs
WalletWasabi.Gui/ViewModels/WasabiDocumentTabViewModel.cs
@@ -20,7 +20,7 @@ namespace WalletWasabi.Gui.ViewModels
private string _successMessage;
private object _dialogResult;
- public WasabiDocumentTabViewModel(Global global, string title)
+ protected WasabiDocumentTabViewModel(Global global, string title)
{
Title = title;
Global = Guard.NotNull(nameof(global), global);

minor non-behavior modifying refactoring