is and is not null
MODIFY
WalletWasabi.Fluent/Behaviors/CheckMarkVisibilityBehavior.cs
WalletWasabi.Fluent/Behaviors/CheckMarkVisibilityBehavior.cs
@@ -31,7 +31,7 @@ namespace WalletWasabi.Fluent.Behaviors
{
_disposables?.Dispose();
- if (x != null)
+ if (x is not null)
{
_disposables = new CompositeDisposable();

MODIFY
WalletWasabi.Fluent/Behaviors/FocusBehavior.cs
WalletWasabi.Fluent/Behaviors/FocusBehavior.cs
@@ -21,7 +21,7 @@ namespace WalletWasabi.Fluent.Behaviors
{
base.OnAttached();
- if (AssociatedObject != null)
+ if (AssociatedObject is not null)
{
AssociatedObject.AttachedToLogicalTree += (sender, e) =>
disposables.Add(this.GetObservable(IsFocusedProperty)

MODIFY
WalletWasabi.Fluent/Controls/ConcatenatingWrapPanel.cs
WalletWasabi.Fluent/Controls/ConcatenatingWrapPanel.cs
@@ -153,7 +153,7 @@ namespace WalletWasabi.Fluent.Controls
for (int i = 0, count = children.Count; i < count; i++)
{
var child = children[i];
- if (child != null)
+ if (child is not null)
{
// Flow passes its own constraint to children
child.Measure(childConstraint);
@@ -212,7 +212,7 @@ namespace WalletWasabi.Fluent.Controls
for (int i = 0; i < children.Count; i++)
{
var child = children[i];
- if (child != null)
+ if (child is not null)
{
var sz = new UVSize(
orientation,
@@ -263,7 +263,7 @@ namespace WalletWasabi.Fluent.Controls
for (int i = start; i < end; i++)
{
var child = children[i];
- if (child != null)
+ if (child is not null)
{
if (i == children.Count - 1)
{

MODIFY
WalletWasabi.Fluent/Helpers/PlatformExtension.cs
WalletWasabi.Fluent/Helpers/PlatformExtension.cs
@@ -27,15 +27,15 @@ namespace WalletWasabi.Fluent.Helpers
{
var result = Default;
- if (Osx != null && RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ if (Osx is not null && RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
result = Osx;
}
- else if (Linux != null && RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ else if (Linux is not null && RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
result = Linux;
}
- else if (Windows != null && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ else if (Windows is not null && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
result = Windows;
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
@@ -78,7 +78,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
transactionInfo.Coins = selectedList.Items.SelectMany(x => x.Coins).ToArray();
- if (_privatePocket != null)
+ if (_privatePocket is not null)
{
_privatePocket.IsSelected = false;
}

MODIFY
WalletWasabi/BestEffortEndpointConnector.cs
WalletWasabi/BestEffortEndpointConnector.cs
@@ -46,7 +46,7 @@ namespace WalletWasabi
var useSocks = isTor || socksSettings?.OnlyForOnionHosts is false;
if (useSocks)
{
- if (socksSettings?.SocksEndpoint == null)
+ if (socksSettings?.SocksEndpoint is null)
{
throw new InvalidOperationException("SocksSettingsBehavior.SocksEndpoint is not set but the connection is expecting using socks proxy");
}

MODIFY
WalletWasabi/Nito/Collections/Deque.cs
WalletWasabi/Nito/Collections/Deque.cs
@@ -131,7 +131,7 @@ namespace Nito.Collections
set
{
- if (value is null && default(T) != null)
+ if (value is null && default(T) is not null)
{
throw new ArgumentNullException(nameof(value), $"{nameof(value)} cannot be null.");
}
@@ -336,7 +336,7 @@ namespace Nito.Collections
int IList.Add(object? value)
{
- if (value is null && default(T) != null)
+ if (value is null && default(T) is not null)
{
throw new ArgumentNullException(nameof(value), $"{nameof(value)} cannot be null.");
}
@@ -362,7 +362,7 @@ namespace Nito.Collections
void IList.Insert(int index, object? value)
{
- if (value is null && default(T) != null)
+ if (value is null && default(T) is not null)
{
throw new ArgumentNullException(nameof(value), $"{nameof(value)} cannot be null.");
}

is and is not null