Refactor to make CS happy
MODIFY
WalletWasabi.Gui/Config.cs
WalletWasabi.Gui/Config.cs
@@ -138,6 +138,8 @@ namespace WalletWasabi.Gui
}
}
+ public int MixUntilAnonymitySetValue => GetAnonymitySet(MixUntilAnonymitySet);
+
[DefaultValue(DefaultPrivacyLevelSome)]
[JsonProperty(PropertyName = "PrivacyLevelSome", DefaultValueHandling = DefaultValueHandling.Populate)]
public int PrivacyLevelSome
@@ -387,9 +389,9 @@ namespace WalletWasabi.Gui
};
}
- public int GetMixUntilAnonymitySetValue()
+ public void CorrectMixUntilAnonymitySet()
{
- return GetAnonymitySet(MixUntilAnonymitySet);
+ GetAnonymitySet(MixUntilAnonymitySet);
}
public int GetAnonymitySet(string mixUntilAnonymitySet)
@@ -412,26 +414,6 @@ namespace WalletWasabi.Gui
}
}
- public void CorrectMixUntilAnonymitySet()
- {
- if (MixUntilAnonymitySet == WalletWasabi.Models.MixUntilAnonymitySet.PrivacyLevelSome.ToString())
- {
- return;
- }
- else if (MixUntilAnonymitySet == WalletWasabi.Models.MixUntilAnonymitySet.PrivacyLevelFine.ToString())
- {
- return;
- }
- else if (MixUntilAnonymitySet == WalletWasabi.Models.MixUntilAnonymitySet.PrivacyLevelStrong.ToString())
- {
- return;
- }
- else
- {
- CorrectMixUntilAnonymitySetValue();
- }
- }
-
protected override bool TryEnsureBackwardsCompatibility(string jsonString)
{
try

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -153,7 +153,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
switch (SelectPrivateCheckBoxState)
{
case true:
- SelectCoins(x => x.AnonymitySet >= Global.Config.GetMixUntilAnonymitySetValue());
+ SelectCoins(x => x.AnonymitySet >= Global.Config.MixUntilAnonymitySetValue);
break;
case null:
@@ -169,7 +169,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
switch (SelectNonPrivateCheckBoxState)
{
case true:
- SelectCoins(x => x.AnonymitySet < Global.Config.GetMixUntilAnonymitySetValue());
+ SelectCoins(x => x.AnonymitySet < Global.Config.MixUntilAnonymitySetValue);
break;
case false:
@@ -402,8 +402,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private void RefreshSelectionCheckBoxes(CoinViewModel[] coins)
{
SelectAllCheckBoxState = GetCheckBoxesSelectedState(coins, x => true);
- SelectPrivateCheckBoxState = GetCheckBoxesSelectedState(coins, x => x.AnonymitySet >= Global.Config.GetMixUntilAnonymitySetValue());
- SelectNonPrivateCheckBoxState = GetCheckBoxesSelectedState(coins, x => x.AnonymitySet < Global.Config.GetMixUntilAnonymitySetValue());
+ SelectPrivateCheckBoxState = GetCheckBoxesSelectedState(coins, x => x.AnonymitySet >= Global.Config.MixUntilAnonymitySetValue);
+ SelectNonPrivateCheckBoxState = GetCheckBoxesSelectedState(coins, x => x.AnonymitySet < Global.Config.MixUntilAnonymitySetValue);
}
private void RefreshStatusColumnWidth(CoinViewModel[] coins)

Refactor to make CS happy