Browse Source

Replace all 342 `== null` with `is null`

Brandon Thetford 1 year ago
parent
commit
da3fe3663d
64 changed files with 317 additions and 317 deletions
  1. 19 19
      Terminal.Gui/Application.cs
  2. 2 2
      Terminal.Gui/Clipboard/Clipboard.cs
  3. 2 2
      Terminal.Gui/Clipboard/ClipboardBase.cs
  4. 2 2
      Terminal.Gui/Configuration/AttributeJsonConverter.cs
  5. 1 1
      Terminal.Gui/Configuration/ColorJsonConverter.cs
  6. 1 1
      Terminal.Gui/Configuration/ColorSchemeJsonConverter.cs
  7. 1 1
      Terminal.Gui/Configuration/ConfigProperty.cs
  8. 5 5
      Terminal.Gui/Configuration/ConfigurationManager.cs
  9. 2 2
      Terminal.Gui/Configuration/SettingsScope.cs
  10. 1 1
      Terminal.Gui/Configuration/ThemeManager.cs
  11. 5 5
      Terminal.Gui/ConsoleDrivers/ConsoleKeyMapping.cs
  12. 2 2
      Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs
  13. 3 3
      Terminal.Gui/ConsoleDrivers/EscSeqUtils/EscSeqReq.cs
  14. 5 5
      Terminal.Gui/ConsoleDrivers/EscSeqUtils/EscSeqUtils.cs
  15. 1 1
      Terminal.Gui/ConsoleDrivers/FakeDriver/FakeDriver.cs
  16. 3 3
      Terminal.Gui/ConsoleDrivers/NetDriver.cs
  17. 4 4
      Terminal.Gui/ConsoleDrivers/WindowsDriver.cs
  18. 1 1
      Terminal.Gui/Drawing/Attribute.cs
  19. 2 2
      Terminal.Gui/Drawing/Thickness.cs
  20. 1 1
      Terminal.Gui/FileServices/DefaultFileOperations.cs
  21. 2 2
      Terminal.Gui/FileServices/FileDialogHistory.cs
  22. 1 1
      Terminal.Gui/Input/KeyBinding.cs
  23. 1 1
      Terminal.Gui/Input/Responder.cs
  24. 1 1
      Terminal.Gui/MainLoop.cs
  25. 4 4
      Terminal.Gui/Text/Autocomplete/PopupAutocomplete.cs
  26. 1 1
      Terminal.Gui/Text/StringExtensions.cs
  27. 5 5
      Terminal.Gui/Text/TextFormatter.cs
  28. 2 2
      Terminal.Gui/View/Layout/PosDim.cs
  29. 7 7
      Terminal.Gui/View/Layout/ViewLayout.cs
  30. 1 1
      Terminal.Gui/View/View.cs
  31. 8 8
      Terminal.Gui/View/ViewDrawing.cs
  32. 2 2
      Terminal.Gui/View/ViewKeyboard.cs
  33. 20 20
      Terminal.Gui/View/ViewSubViews.cs
  34. 2 2
      Terminal.Gui/View/ViewText.cs
  35. 1 1
      Terminal.Gui/Views/AutocompleteFilepathContext.cs
  36. 1 1
      Terminal.Gui/Views/CheckBox.cs
  37. 4 4
      Terminal.Gui/Views/ComboBox.cs
  38. 2 2
      Terminal.Gui/Views/Dialog.cs
  39. 8 8
      Terminal.Gui/Views/FileDialog.cs
  40. 1 1
      Terminal.Gui/Views/FileDialogTableSource.cs
  41. 1 1
      Terminal.Gui/Views/HexView.cs
  42. 11 11
      Terminal.Gui/Views/ListView.cs
  43. 1 1
      Terminal.Gui/Views/Menu/ContextMenu.cs
  44. 22 22
      Terminal.Gui/Views/Menu/Menu.cs
  45. 22 22
      Terminal.Gui/Views/Menu/MenuBar.cs
  46. 1 1
      Terminal.Gui/Views/ProgressBar.cs
  47. 1 1
      Terminal.Gui/Views/RadioGroup.cs
  48. 7 7
      Terminal.Gui/Views/ScrollBarView.cs
  49. 1 1
      Terminal.Gui/Views/ScrollView.cs
  50. 3 3
      Terminal.Gui/Views/Slider.cs
  51. 1 1
      Terminal.Gui/Views/StatusBar.cs
  52. 8 8
      Terminal.Gui/Views/TabView.cs
  53. 1 1
      Terminal.Gui/Views/TableView/ListTableSource.cs
  54. 4 4
      Terminal.Gui/Views/TableView/TableView.cs
  55. 2 2
      Terminal.Gui/Views/TableView/TreeTableSource.cs
  56. 13 13
      Terminal.Gui/Views/TextField.cs
  57. 5 5
      Terminal.Gui/Views/TextValidateField.cs
  58. 23 23
      Terminal.Gui/Views/TextView.cs
  59. 25 25
      Terminal.Gui/Views/Toplevel.cs
  60. 3 3
      Terminal.Gui/Views/ToplevelOverlapped.cs
  61. 5 5
      Terminal.Gui/Views/TreeView/Branch.cs
  62. 16 16
      Terminal.Gui/Views/TreeView/TreeView.cs
  63. 3 3
      Terminal.Gui/Views/Wizard/Wizard.cs
  64. 1 1
      Terminal.Gui/Views/Wizard/WizardStep.cs

+ 19 - 19
Terminal.Gui/Application.cs

@@ -199,7 +199,7 @@ public static partial class Application
         bool calledViaRunT = false
     )
     {
-        if (_initialized && driver == null)
+        if (_initialized && driver is null)
         {
             return;
         }
@@ -235,7 +235,7 @@ public static partial class Application
             ForceDriver = driverName;
         }
 
-        if (Driver == null)
+        if (Driver is null)
         {
             PlatformID p = Environment.OSVersion.Platform;
 
@@ -377,7 +377,7 @@ public static partial class Application
     /// </remarks>
     public static RunState Begin (Toplevel Toplevel)
     {
-        if (Toplevel == null)
+        if (Toplevel is null)
         {
             throw new ArgumentNullException (nameof (Toplevel));
         }
@@ -435,7 +435,7 @@ public static partial class Application
             {
                 Toplevel dup = _topLevels.FirstOrDefault (x => x.Id == Toplevel.Id);
 
-                if (dup == null)
+                if (dup is null)
                 {
                     _topLevels.Push (Toplevel);
                 }
@@ -447,7 +447,7 @@ public static partial class Application
             }
         }
 
-        if (Top == null || Toplevel.IsOverlappedContainer)
+        if (Top is null || Toplevel.IsOverlappedContainer)
         {
             Top = Toplevel;
         }
@@ -629,7 +629,7 @@ public static partial class Application
             }
             catch (Exception error)
             {
-                if (errorHandler == null)
+                if (errorHandler is null)
                 {
                     throw;
                 }
@@ -767,12 +767,12 @@ public static partial class Application
     /// <param name="state">The state returned by the <see cref="Begin(Toplevel)"/> method.</param>
     public static void RunLoop (RunState state)
     {
-        if (state == null)
+        if (state is null)
         {
             throw new ArgumentNullException (nameof (state));
         }
 
-        if (state.Toplevel == null)
+        if (state.Toplevel is null)
         {
             throw new ObjectDisposedException ("state");
         }
@@ -885,7 +885,7 @@ public static partial class Application
     /// </remarks>
     public static void RequestStop (Toplevel top = null)
     {
-        if (OverlappedTop == null || top == null || (OverlappedTop == null && top != null))
+        if (OverlappedTop is null || top is null || (OverlappedTop is null && top != null))
         {
             top = Current;
         }
@@ -1011,7 +1011,7 @@ public static partial class Application
     /// <param name="runState">The <see cref="RunState"/> returned by the <see cref="Begin(Toplevel)"/> method.</param>
     public static void End (RunState runState)
     {
-        if (runState == null)
+        if (runState is null)
         {
             throw new ArgumentNullException (nameof (runState));
         }
@@ -1333,7 +1333,7 @@ public static partial class Application
     /// <param name="view">View that will receive all mouse events until <see cref="UngrabMouse"/> is invoked.</param>
     public static void GrabMouse (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return;
         }
@@ -1348,7 +1348,7 @@ public static partial class Application
     /// <summary>Releases the mouse grab, so mouse events will be routed to the view on which the mouse is.</summary>
     public static void UngrabMouse ()
     {
-        if (MouseGrabView == null)
+        if (MouseGrabView is null)
         {
             return;
         }
@@ -1362,7 +1362,7 @@ public static partial class Application
 
     private static bool OnGrabbingMouse (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return false;
         }
@@ -1375,7 +1375,7 @@ public static partial class Application
 
     private static bool OnUnGrabbingMouse (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return false;
         }
@@ -1388,7 +1388,7 @@ public static partial class Application
 
     private static void OnGrabbedMouse (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return;
         }
@@ -1398,7 +1398,7 @@ public static partial class Application
 
     private static void OnUnGrabbedMouse (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return;
         }
@@ -1487,7 +1487,7 @@ public static partial class Application
             }
         }
 
-        if ((view == null || view == OverlappedTop)
+        if ((view is null || view == OverlappedTop)
             && Current is { Modal: false }
             && OverlappedTop != null
             && a.MouseEvent.Flags != MouseFlags.ReportMousePosition
@@ -1551,7 +1551,7 @@ public static partial class Application
                         View = view
                     };
 
-                    if (_mouseEnteredView == null)
+                    if (_mouseEnteredView is null)
                     {
                         _mouseEnteredView = view;
                         view.OnMouseEnter (me);
@@ -1603,7 +1603,7 @@ public static partial class Application
                     View = view
                 };
 
-                if (_mouseEnteredView == null)
+                if (_mouseEnteredView is null)
                 {
                     _mouseEnteredView = view;
                     view.OnMouseEnter (me);

+ 2 - 2
Terminal.Gui/Clipboard/Clipboard.cs

@@ -33,7 +33,7 @@ public static class Clipboard
                 {
                     string clipData = Application.Driver.Clipboard.GetClipboardData ();
 
-                    if (clipData == null)
+                    if (clipData is null)
                     {
                         // throw new InvalidOperationException ($"{Application.Driver.GetType ().Name}.GetClipboardData returned null instead of string.Empty");
                         clipData = string.Empty;
@@ -55,7 +55,7 @@ public static class Clipboard
             {
                 if (IsSupported)
                 {
-                    if (value == null)
+                    if (value is null)
                     {
                         value = string.Empty;
                     }

+ 2 - 2
Terminal.Gui/Clipboard/ClipboardBase.cs

@@ -17,7 +17,7 @@ public abstract class ClipboardBase : IClipboard
         {
             string result = GetClipboardDataImpl ();
 
-            if (result == null)
+            if (result is null)
             {
                 return string.Empty;
             }
@@ -35,7 +35,7 @@ public abstract class ClipboardBase : IClipboard
     /// <exception cref="NotSupportedException">Thrown if it was not possible to paste to the OS clipboard.</exception>
     public void SetClipboardData (string text)
     {
-        if (text == null)
+        if (text is null)
         {
             throw new ArgumentNullException (nameof (text));
         }

+ 2 - 2
Terminal.Gui/Configuration/AttributeJsonConverter.cs

@@ -13,7 +13,7 @@ internal class AttributeJsonConverter : JsonConverter<Attribute>
     {
         get
         {
-            if (_instance == null)
+            if (_instance is null)
             {
                 _instance = new AttributeJsonConverter ();
             }
@@ -37,7 +37,7 @@ internal class AttributeJsonConverter : JsonConverter<Attribute>
         {
             if (reader.TokenType == JsonTokenType.EndObject)
             {
-                if (foreground == null || background == null)
+                if (foreground is null || background is null)
                 {
                     throw new JsonException ("Both Foreground and Background colors must be provided.");
                 }

+ 1 - 1
Terminal.Gui/Configuration/ColorJsonConverter.cs

@@ -13,7 +13,7 @@ internal class ColorJsonConverter : JsonConverter<Color>
     {
         get
         {
-            if (_instance == null)
+            if (_instance is null)
             {
                 _instance = new ColorJsonConverter ();
             }

+ 1 - 1
Terminal.Gui/Configuration/ColorSchemeJsonConverter.cs

@@ -13,7 +13,7 @@ internal class ColorSchemeJsonConverter : JsonConverter<ColorScheme>
     {
         get
         {
-            if (instance == null)
+            if (instance is null)
             {
                 instance = new ColorSchemeJsonConverter ();
             }

+ 1 - 1
Terminal.Gui/Configuration/ConfigProperty.cs

@@ -96,7 +96,7 @@ public class ConfigProperty
 
     internal object? UpdateValueFrom (object source)
     {
-        if (source == null)
+        if (source is null)
         {
             return PropertyValue;
         }

+ 5 - 5
Terminal.Gui/Configuration/ConfigurationManager.cs

@@ -145,7 +145,7 @@ public static class ConfigurationManager
     {
         get
         {
-            if (_settings == null)
+            if (_settings is null)
             {
                 throw new InvalidOperationException (
                                                      "ConfigurationManager has not been initialized. Call ConfigurationManager.Reset() before accessing the Settings property."
@@ -320,7 +320,7 @@ public static class ConfigurationManager
     {
         Debug.WriteLine (@"ConfigurationManager.Reset()");
 
-        if (_allConfigProperties == null)
+        if (_allConfigProperties is null)
         {
             Initialize ();
         }
@@ -364,12 +364,12 @@ public static class ConfigurationManager
     /// <returns><paramref name="destination"/> updated from <paramref name="source"/></returns>
     internal static object? DeepMemberwiseCopy (object? source, object? destination)
     {
-        if (destination == null)
+        if (destination is null)
         {
             throw new ArgumentNullException (nameof (destination));
         }
 
-        if (source == null)
+        if (source is null)
         {
             return null!;
         }
@@ -474,7 +474,7 @@ public static class ConfigurationManager
     /// </remarks>
     internal static void GetHardCodedDefaults ()
     {
-        if (_allConfigProperties == null)
+        if (_allConfigProperties is null)
         {
             throw new InvalidOperationException ("Initialize must be called first.");
         }

+ 2 - 2
Terminal.Gui/Configuration/SettingsScope.cs

@@ -102,7 +102,7 @@ public class SettingsScope : Scope<SettingsScope>
     /// <param name="resourceName"></param>
     public SettingsScope? UpdateFromResource (Assembly assembly, string resourceName)
     {
-        if (resourceName == null || string.IsNullOrEmpty (resourceName))
+        if (resourceName is null || string.IsNullOrEmpty (resourceName))
         {
             Debug.WriteLine (
                              $"ConfigurationManager: Resource \"{resourceName}\" does not exist in \"{assembly.GetName ().Name}\"."
@@ -113,7 +113,7 @@ public class SettingsScope : Scope<SettingsScope>
 
         using Stream? stream = assembly.GetManifestResourceStream (resourceName)!;
 
-        if (stream == null)
+        if (stream is null)
         {
             Debug.WriteLine (
                              $"ConfigurationManager: Failed to read resource \"{resourceName}\" from \"{assembly.GetName ().Name}\"."

+ 1 - 1
Terminal.Gui/Configuration/ThemeManager.cs

@@ -78,7 +78,7 @@ public class ThemeManager : IDictionary<string, ThemeScope>
                    Dictionary<string, ThemeScope>; // themes ?? new Dictionary<string, ThemeScope> ();
         set =>
 
-            //if (themes == null || value == null) {
+            //if (themes is null || value is null) {
             //	themes = value;
             //} else {
             //	themes = (Dictionary<string, ThemeScope>)DeepMemberwiseCopy (value!, themes!)!;

+ 5 - 5
Terminal.Gui/ConsoleDrivers/ConsoleKeyMapping.cs

@@ -155,7 +155,7 @@ public static class ConsoleKeyMapping
                 ScanCodeMapping sCode =
                     _scanCodes.FirstOrDefault (e => e.UnicodeChar == keyValue && e.Modifiers == modifiers);
 
-                if (sCode == null && modifiers == (ConsoleModifiers.Alt | ConsoleModifiers.Control))
+                if (sCode is null && modifiers == (ConsoleModifiers.Alt | ConsoleModifiers.Control))
                 {
                     return _scanCodes.FirstOrDefault (e => e.UnicodeChar == keyValue && e.Modifiers == 0);
                 }
@@ -164,7 +164,7 @@ public static class ConsoleKeyMapping
             case "VirtualKey":
                 sCode = _scanCodes.FirstOrDefault (e => e.VirtualKey == (VK)keyValue && e.Modifiers == modifiers);
 
-                if (sCode == null && modifiers == (ConsoleModifiers.Alt | ConsoleModifiers.Control))
+                if (sCode is null && modifiers == (ConsoleModifiers.Alt | ConsoleModifiers.Control))
                 {
                     return _scanCodes.FirstOrDefault (e => e.VirtualKey == (VK)keyValue && e.Modifiers == 0);
                 }
@@ -328,12 +328,12 @@ public static class ConsoleKeyMapping
         {
             ScanCodeMapping sCode = _scanCodes.FirstOrDefault (e => e.UnicodeChar == keyValue);
 
-            if (sCode == null)
+            if (sCode is null)
             {
                 consoleKey = (byte)(keyValue & byte.MaxValue);
                 sCode = _scanCodes.FirstOrDefault (e => e.VirtualKey == (VK)consoleKey);
 
-                if (sCode == null)
+                if (sCode is null)
                 {
                     consoleKey = 0;
                     outputChar = keyValue;
@@ -568,7 +568,7 @@ public static class ConsoleKeyMapping
             scanCode = scode.ScanCode;
         }
 
-        if (scode == null)
+        if (scode is null)
         {
             scode = unicodeChar != 0 ? GetScanCode ("UnicodeChar", decodedChar, mod) : null;
 

+ 2 - 2
Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs

@@ -118,7 +118,7 @@ internal class UnixMainLoop : IMainLoopDriver
             _cursesDriver.ProcessWinChange ();
         }
 
-        if (_pollMap == null)
+        if (_pollMap is null)
         {
             return;
         }
@@ -159,7 +159,7 @@ internal class UnixMainLoop : IMainLoopDriver
     /// </remarks>
     internal object AddWatch (int fileDescriptor, Condition condition, Func<MainLoop, bool> callback)
     {
-        if (callback == null)
+        if (callback is null)
         {
             throw new ArgumentNullException (nameof (callback));
         }

+ 3 - 3
Terminal.Gui/ConsoleDrivers/EscSeqUtils/EscSeqReq.cs

@@ -48,7 +48,7 @@ public class EscSeqRequests
         {
             EscSeqReqStatus found = Statuses.Find (x => x.Terminator == terminator);
 
-            if (found == null)
+            if (found is null)
             {
                 Statuses.Add (new EscSeqReqStatus (terminator, numReq));
             }
@@ -71,7 +71,7 @@ public class EscSeqRequests
         {
             EscSeqReqStatus found = Statuses.Find (x => x.Terminator == terminator);
 
-            if (found == null)
+            if (found is null)
             {
                 return false;
             }
@@ -102,7 +102,7 @@ public class EscSeqRequests
         {
             EscSeqReqStatus found = Statuses.Find (x => x.Terminator == terminator);
 
-            if (found == null)
+            if (found is null)
             {
                 return;
             }

+ 5 - 5
Terminal.Gui/ConsoleDrivers/EscSeqUtils/EscSeqUtils.cs

@@ -200,7 +200,7 @@ public static class EscSeqUtils
         switch (c1Control)
         {
             case "ESC":
-                if (values == null && string.IsNullOrEmpty (terminator))
+                if (values is null && string.IsNullOrEmpty (terminator))
                 {
                     key = ConsoleKey.Escape;
 
@@ -515,7 +515,7 @@ public static class EscSeqUtils
     /// </returns>
     public static (string c1Control, string code, string [] values, string terminating) GetEscapeResult (char [] kChar)
     {
-        if (kChar == null || kChar.Length == 0)
+        if (kChar is null || kChar.Length == 0)
         {
             return (null, null, null, null);
         }
@@ -866,7 +866,7 @@ public static class EscSeqUtils
                  || buttonState == MouseFlags.Button2Pressed
                  || buttonState == MouseFlags.Button3Pressed
                  || buttonState == MouseFlags.Button4Pressed)
-             && lastMouseButtonPressed == null)
+             && lastMouseButtonPressed is null)
             || (isButtonPressed && lastMouseButtonPressed != null && buttonState.HasFlag (MouseFlags.ReportMousePosition)))
         {
             mouseFlags [0] = buttonState;
@@ -1131,7 +1131,7 @@ public static class EscSeqUtils
     /// <returns>The <see cref="ConsoleKeyInfo"/> resized.</returns>
     public static ConsoleKeyInfo [] ResizeArray (ConsoleKeyInfo consoleKeyInfo, ConsoleKeyInfo [] cki)
     {
-        Array.Resize (ref cki, cki == null ? 1 : cki.Length + 1);
+        Array.Resize (ref cki, cki is null ? 1 : cki.Length + 1);
         cki [cki.Length - 1] = consoleKeyInfo;
 
         return cki;
@@ -1232,7 +1232,7 @@ public static class EscSeqUtils
 
             View view = Application.WantContinuousButtonPressedView;
 
-            if (view == null)
+            if (view is null)
             {
                 break;
             }

+ 1 - 1
Terminal.Gui/ConsoleDrivers/FakeDriver/FakeDriver.cs

@@ -523,7 +523,7 @@ public class FakeDriver : ConsoleDriver
 
         protected override void SetClipboardDataImpl (string text)
         {
-            if (text == null)
+            if (text is null)
             {
                 throw new ArgumentNullException (nameof (text));
             }

+ 3 - 3
Terminal.Gui/ConsoleDrivers/NetDriver.cs

@@ -262,7 +262,7 @@ internal class NetEvents : IDisposable
                     if ((consoleKeyInfo.KeyChar == (char)KeyCode.Esc && !_isEscSeq)
                         || (consoleKeyInfo.KeyChar != (char)KeyCode.Esc && _isEscSeq))
                     {
-                        if (_cki == null && consoleKeyInfo.KeyChar != (char)KeyCode.Esc && _isEscSeq)
+                        if (_cki is null && consoleKeyInfo.KeyChar != (char)KeyCode.Esc && _isEscSeq)
                         {
                             _cki = EscSeqUtils.ResizeArray (
                                                             new ConsoleKeyInfo (
@@ -1646,7 +1646,7 @@ internal class NetMainLoop : IMainLoopDriver
     /// <exception cref="ArgumentNullException"></exception>
     public NetMainLoop (ConsoleDriver consoleDriver = null)
     {
-        if (consoleDriver == null)
+        if (consoleDriver is null)
         {
             throw new ArgumentNullException (nameof (consoleDriver));
         }
@@ -1760,7 +1760,7 @@ internal class NetMainLoop : IMainLoopDriver
 
             try
             {
-                while (_resultQueue.Peek () == null)
+                while (_resultQueue.Peek () is null)
                 {
                     _resultQueue.Dequeue ();
                 }

+ 4 - 4
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

@@ -998,7 +998,7 @@ internal class WindowsDriver : ConsoleDriver
     public WindowsConsole WinConsole { get; private set; }
 
     /// <inheritdoc/>
-    public override bool EnsureCursorVisibility () { return WinConsole == null || WinConsole.EnsureCursorVisibility (); }
+    public override bool EnsureCursorVisibility () { return WinConsole is null || WinConsole.EnsureCursorVisibility (); }
 
     public WindowsConsole.KeyEventRecord FromVKPacketToKeyEventRecord (WindowsConsole.KeyEventRecord keyEvent)
     {
@@ -1143,7 +1143,7 @@ internal class WindowsDriver : ConsoleDriver
     {
         _cachedCursorVisibility = visibility;
 
-        return WinConsole == null || WinConsole.SetCursorVisibility (visibility);
+        return WinConsole is null || WinConsole.SetCursorVisibility (visibility);
     }
 
     #region Not Implemented
@@ -1709,7 +1709,7 @@ internal class WindowsDriver : ConsoleDriver
 
             View view = Application.WantContinuousButtonPressedView;
 
-            if (view == null)
+            if (view is null)
             {
                 break;
             }
@@ -1797,7 +1797,7 @@ internal class WindowsDriver : ConsoleDriver
             Y = mouseEvent.MousePosition.Y
         };
 
-        if ((mouseEvent.ButtonState != 0 && mouseEvent.EventFlags == 0 && _lastMouseButtonPressed == null && !_isButtonDoubleClicked)
+        if ((mouseEvent.ButtonState != 0 && mouseEvent.EventFlags == 0 && _lastMouseButtonPressed is null && !_isButtonDoubleClicked)
             || (_lastMouseButtonPressed == null
                 && mouseEvent.EventFlags.HasFlag (WindowsConsole.EventFlags.MouseMoved)
                 && mouseEvent.ButtonState != 0

+ 1 - 1
Terminal.Gui/Drawing/Attribute.cs

@@ -72,7 +72,7 @@ public readonly struct Attribute : IEquatable<Attribute>
         Background = background;
 
         // TODO: Once CursesDriver supports truecolor all the PlatformColor stuff goes away
-        if (Application.Driver == null)
+        if (Application.Driver is null)
         {
             PlatformColor = -1;
 

+ 2 - 2
Terminal.Gui/Drawing/Thickness.cs

@@ -217,7 +217,7 @@ public class Thickness : IEquatable<Thickness>
             // Draw the diagnostics label on the bottom
             var tf = new TextFormatter
             {
-                Text = label == null ? string.Empty : $"{label} {this}",
+                Text = label is null ? string.Empty : $"{label} {this}",
                 Alignment = TextAlignment.Centered,
                 VerticalAlignment = VerticalTextAlignment.Bottom
             };
@@ -233,7 +233,7 @@ public class Thickness : IEquatable<Thickness>
     public override bool Equals (object obj)
     {
         //Check for null and compare run-time types.
-        if (obj == null || !GetType ().Equals (obj.GetType ()))
+        if (obj is null || !GetType ().Equals (obj.GetType ()))
         {
             return false;
         }

+ 1 - 1
Terminal.Gui/FileServices/DefaultFileOperations.cs

@@ -53,7 +53,7 @@ public class DefaultFileOperations : IFileOperations
     public IFileSystemInfo Rename (IFileSystem fileSystem, IFileSystemInfo toRename)
     {
         // Don't allow renaming C: or D: or / (on linux) etc
-        if (toRename is IDirectoryInfo dir && dir.Parent == null)
+        if (toRename is IDirectoryInfo dir && dir.Parent is null)
         {
             return null;
         }

+ 2 - 2
Terminal.Gui/FileServices/FileDialogHistory.cs

@@ -28,7 +28,7 @@ internal class FileDialogHistory
         }
 
         // nowhere to go
-        if (goTo == null)
+        if (goTo is null)
         {
             return false;
         }
@@ -63,7 +63,7 @@ internal class FileDialogHistory
 
     internal void Push (FileDialogState state, bool clearForward)
     {
-        if (state == null)
+        if (state is null)
         {
             return;
         }

+ 1 - 1
Terminal.Gui/Input/KeyBinding.cs

@@ -97,7 +97,7 @@ public class KeyBindings
             throw new ArgumentException (@"At least one command must be specified", nameof (commands));
         }
 
-        if (key == null || !key.IsValid)
+        if (key is null || !key.IsValid)
         {
             //throw new ArgumentException ("Invalid Key", nameof (commands));
             return;

+ 1 - 1
Terminal.Gui/Input/Responder.cs

@@ -132,7 +132,7 @@ public class Responder : IDisposable
                                            | BindingFlags.DeclaredOnly
                                           );
 
-        if (m == null)
+        if (m is null)
         {
             return false;
         }

+ 1 - 1
Terminal.Gui/MainLoop.cs

@@ -125,7 +125,7 @@ internal class MainLoop : IDisposable
     /// </remarks>
     internal object AddTimeout (TimeSpan time, Func<bool> callback)
     {
-        if (callback == null)
+        if (callback is null)
         {
             throw new ArgumentNullException (nameof (callback));
         }

+ 4 - 4
Terminal.Gui/Text/Autocomplete/PopupAutocomplete.cs

@@ -23,7 +23,7 @@ public abstract class PopupAutocomplete : AutocompleteBase
     {
         get
         {
-            if (colorScheme == null)
+            if (colorScheme is null)
             {
                 colorScheme = Colors.ColorSchemes ["Menu"];
             }
@@ -125,7 +125,7 @@ public abstract class PopupAutocomplete : AutocompleteBase
             return false;
         }
 
-        if (popup == null || Suggestions.Count == 0)
+        if (popup is null || Suggestions.Count == 0)
         {
             ManipulatePopup ();
 
@@ -516,7 +516,7 @@ public abstract class PopupAutocomplete : AutocompleteBase
 
     private void ManipulatePopup ()
     {
-        if (Visible && popup == null)
+        if (Visible && popup is null)
         {
             popup = new Popup (this) { Frame = Rect.Empty };
             top?.Add (popup);
@@ -568,7 +568,7 @@ public abstract class PopupAutocomplete : AutocompleteBase
 
         public override void OnDrawContent (Rect contentArea)
         {
-            if (autocomplete.LastPopupPos == null)
+            if (autocomplete.LastPopupPos is null)
             {
                 return;
             }

+ 1 - 1
Terminal.Gui/Text/StringExtensions.cs

@@ -55,7 +55,7 @@ public static class StringExtensions
     /// <remarks>This is a Terminal.Gui extension method to <see cref="string"/> to support TUI text manipulation.</remarks>
     /// <param name="str">The string to measure.</param>
     /// <returns></returns>
-    public static int GetColumns (this string str) { return str == null ? 0 : str.EnumerateRunes ().Sum (r => Math.Max (r.GetColumns (), 0)); }
+    public static int GetColumns (this string str) { return str is null ? 0 : str.EnumerateRunes ().Sum (r => Math.Max (r.GetColumns (), 0)); }
 
     /// <summary>Gets the number of runes in the string.</summary>
     /// <remarks>This is a Terminal.Gui extension method to <see cref="string"/> to support TUI text manipulation.</remarks>

+ 5 - 5
Terminal.Gui/Text/TextFormatter.cs

@@ -270,7 +270,7 @@ public class TextFormatter
         get => _text;
         set
         {
-            bool textWasNull = _text == null && value != null;
+            bool textWasNull = _text is null && value != null;
             _text = EnableNeedsFormat (value);
 
             if ((AutoSize && Alignment != TextAlignment.Justified && VerticalAlignment != VerticalTextAlignment.Justified) || (textWasNull && Size.IsEmpty))
@@ -505,7 +505,7 @@ public class TextFormatter
             {
                 Rune lastRuneUsed = rune;
 
-                if (lastZeroWidthPos == null)
+                if (lastZeroWidthPos is null)
                 {
                     if (idx < 0 || x + current + colOffset < 0)
                     {
@@ -540,7 +540,7 @@ public class TextFormatter
                         rune = runes [idx];
                     }
 
-                    if (lastZeroWidthPos == null)
+                    if (lastZeroWidthPos is null)
                     {
                         driver?.Move (x, current);
                     }
@@ -611,7 +611,7 @@ public class TextFormatter
                     {
                         if (runeWidth == 0)
                         {
-                            if (lastZeroWidthPos == null)
+                            if (lastZeroWidthPos is null)
                             {
                                 lastZeroWidthPos = new List<Point?> ();
                             }
@@ -1764,7 +1764,7 @@ public class TextFormatter
     /// <returns>The index of the last Rune in <paramref name="runes"/> that fit in <paramref name="columns"/>.</returns>
     public static int GetLengthThatFits (List<Rune> runes, int columns, int tabWidth = 0)
     {
-        if (runes == null || runes.Count == 0)
+        if (runes is null || runes.Count == 0)
         {
             return 0;
         }

+ 2 - 2
Terminal.Gui/View/Layout/PosDim.cs

@@ -422,7 +422,7 @@ public class Pos
                     break;
             }
 
-            if (Target == null)
+            if (Target is null)
             {
                 throw new NullReferenceException (nameof (Target));
             }
@@ -726,7 +726,7 @@ public class Dim
 
         public override string ToString ()
         {
-            if (Target == null)
+            if (Target is null)
             {
                 throw new NullReferenceException ();
             }

+ 7 - 7
Terminal.Gui/View/Layout/ViewLayout.cs

@@ -177,7 +177,7 @@ public partial class View
 #endif // DEBUG
 
             // BUGBUG: I think there's a bug here. This should be && not ||
-            if (Margin == null || Border == null || Padding == null)
+            if (Margin is null || Border is null || Padding is null)
             {
                 return new Rect (default (Point), Frame.Size);
             }
@@ -556,7 +556,7 @@ public partial class View
     {
         resy = resx = 0;
 
-        if (start == null || !start.Frame.Contains (x, y))
+        if (start is null || !start.Frame.Contains (x, y))
         {
             return null;
         }
@@ -581,7 +581,7 @@ public partial class View
                     {
                         View deep = FindDeepestView (v, rx, ry, out resx, out resy);
 
-                        if (deep == null)
+                        if (deep is null)
                         {
                             return v;
                         }
@@ -846,7 +846,7 @@ public partial class View
     /// <summary>Overriden by <see cref="Adornment"/> to do nothing, as the <see cref="Adornment"/> does not have adornments.</summary>
     internal virtual void LayoutAdornments ()
     {
-        if (Margin == null)
+        if (Margin is null)
         {
             return; // CreateAdornments () has not been called yet
         }
@@ -1248,7 +1248,7 @@ public partial class View
             if (from == to)
             {
                 // if not yet added to the result, add it and remove from edge
-                if (result.Find (v => v == from) == null)
+                if (result.Find (v => v == from) is null)
                 {
                     result.Add (from);
                 }
@@ -1258,13 +1258,13 @@ public partial class View
             else if (from.SuperView == to.SuperView)
             {
                 // if 'from' is not yet added to the result, add it
-                if (result.Find (v => v == from) == null)
+                if (result.Find (v => v == from) is null)
                 {
                     result.Add (from);
                 }
 
                 // if 'to' is not yet added to the result, add it
-                if (result.Find (v => v == to) == null)
+                if (result.Find (v => v == to) is null)
                 {
                     result.Add (to);
                 }

+ 1 - 1
Terminal.Gui/View/View.cs

@@ -139,7 +139,7 @@ public partial class View : Responder, ISupportInitializeNotification
             {
                 if (value)
                 {
-                    if (SuperView == null || SuperView?.Enabled == true)
+                    if (SuperView is null || SuperView?.Enabled == true)
                     {
                         base.Enabled = value;
                     }

+ 8 - 8
Terminal.Gui/View/ViewDrawing.cs

@@ -11,7 +11,7 @@ public partial class View
     {
         get
         {
-            if (_colorScheme == null)
+            if (_colorScheme is null)
             {
                 return SuperView?.ColorScheme;
             }
@@ -100,7 +100,7 @@ public partial class View
     /// <param name="regionScreen">The screen-relative rectangle to clear.</param>
     public void Clear (Rect regionScreen)
     {
-        if (Driver == null)
+        if (Driver is null)
         {
             return;
         }
@@ -123,7 +123,7 @@ public partial class View
     /// </remarks>
     public Rect ClipToBounds ()
     {
-        if (Driver == null)
+        if (Driver is null)
         {
             return Rect.Empty;
         }
@@ -279,7 +279,7 @@ public partial class View
     {
         ColorScheme cs = ColorScheme;
 
-        if (ColorScheme == null)
+        if (ColorScheme is null)
         {
             cs = new ColorScheme ();
         }
@@ -297,7 +297,7 @@ public partial class View
     {
         ColorScheme cs = ColorScheme;
 
-        if (ColorScheme == null)
+        if (ColorScheme is null)
         {
             cs = new ColorScheme ();
         }
@@ -315,7 +315,7 @@ public partial class View
     {
         ColorScheme cs = ColorScheme;
 
-        if (ColorScheme == null)
+        if (ColorScheme is null)
         {
             cs = new ColorScheme ();
         }
@@ -329,7 +329,7 @@ public partial class View
     /// <param name="row">the row to move to, in view-relative coordinates.</param>
     public void Move (int col, int row)
     {
-        if (Driver == null || Driver?.Rows == 0)
+        if (Driver is null || Driver?.Rows == 0)
         {
             return;
         }
@@ -544,7 +544,7 @@ public partial class View
             Padding?.SetNeedsDisplay (Padding.Bounds);
         }
 
-        if (_subviews == null)
+        if (_subviews is null)
         {
             return;
         }

+ 2 - 2
Terminal.Gui/View/ViewKeyboard.cs

@@ -215,7 +215,7 @@ public partial class View
 
     private void SetHotKey ()
     {
-        if (TextFormatter == null || HotKeySpecifier == new Rune ('\xFFFF'))
+        if (TextFormatter is null || HotKeySpecifier == new Rune ('\xFFFF'))
         {
             return; // throw new InvalidOperationException ("Can't set HotKey unless a TextFormatter has been created");
         }
@@ -263,7 +263,7 @@ public partial class View
                 return;
             }
 
-            if (SuperView?._tabIndexes == null || SuperView?._tabIndexes.Count == 1)
+            if (SuperView?._tabIndexes is null || SuperView?._tabIndexes.Count == 1)
             {
                 _tabIndex = 0;
 

+ 20 - 20
Terminal.Gui/View/ViewSubViews.cs

@@ -36,17 +36,17 @@ public partial class View
     /// </remarks>
     public virtual void Add (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return;
         }
 
-        if (_subviews == null)
+        if (_subviews is null)
         {
             _subviews = new List<View> ();
         }
 
-        if (_tabIndexes == null)
+        if (_tabIndexes is null)
         {
             _tabIndexes = new List<View> ();
         }
@@ -97,7 +97,7 @@ public partial class View
     /// </remarks>
     public void Add (params View [] views)
     {
-        if (views == null)
+        if (views is null)
         {
             return;
         }
@@ -188,7 +188,7 @@ public partial class View
     /// <remarks></remarks>
     public virtual void Remove (View view)
     {
-        if (view == null || _subviews == null)
+        if (view is null || _subviews is null)
         {
             return;
         }
@@ -220,7 +220,7 @@ public partial class View
     /// <summary>Removes all subviews (children) added via <see cref="Add(View)"/> or <see cref="Add(View[])"/> from this View.</summary>
     public virtual void RemoveAll ()
     {
-        if (_subviews == null)
+        if (_subviews is null)
         {
             return;
         }
@@ -402,11 +402,11 @@ public partial class View
                     SetHasFocus (false, this);
                     SuperView?.EnsureFocus ();
 
-                    if (SuperView != null && SuperView.Focused == null)
+                    if (SuperView != null && SuperView.Focused is null)
                     {
                         SuperView.FocusNext ();
 
-                        if (SuperView.Focused == null && Application.Current != null)
+                        if (SuperView.Focused is null && Application.Current != null)
                         {
                             Application.Current.FocusNext ();
                         }
@@ -499,7 +499,7 @@ public partial class View
     {
         get
         {
-            if (Focused == null)
+            if (Focused is null)
             {
                 return null;
             }
@@ -519,7 +519,7 @@ public partial class View
     /// <param name="view">View.</param>
     private void SetFocus (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return;
         }
@@ -556,7 +556,7 @@ public partial class View
             }
         }
 
-        if (c == null)
+        if (c is null)
         {
             throw new ArgumentException ("the specified view is not part of the hierarchy of this view");
         }
@@ -611,7 +611,7 @@ public partial class View
     /// </summary>
     public void EnsureFocus ()
     {
-        if (Focused == null && _subviews?.Count > 0)
+        if (Focused is null && _subviews?.Count > 0)
         {
             if (FocusDirection == NavigationDirection.Forward)
             {
@@ -632,7 +632,7 @@ public partial class View
             return;
         }
 
-        if (_tabIndexes == null)
+        if (_tabIndexes is null)
         {
             SuperView?.SetFocus (this);
 
@@ -658,7 +658,7 @@ public partial class View
             return;
         }
 
-        if (_tabIndexes == null)
+        if (_tabIndexes is null)
         {
             SuperView?.SetFocus (this);
 
@@ -691,12 +691,12 @@ public partial class View
 
         FocusDirection = NavigationDirection.Backward;
 
-        if (_tabIndexes == null || _tabIndexes.Count == 0)
+        if (_tabIndexes is null || _tabIndexes.Count == 0)
         {
             return false;
         }
 
-        if (Focused == null)
+        if (Focused is null)
         {
             FocusLast ();
 
@@ -757,12 +757,12 @@ public partial class View
 
         FocusDirection = NavigationDirection.Forward;
 
-        if (_tabIndexes == null || _tabIndexes.Count == 0)
+        if (_tabIndexes is null || _tabIndexes.Count == 0)
         {
             return false;
         }
 
-        if (Focused == null)
+        if (Focused is null)
         {
             FocusFirst ();
 
@@ -813,7 +813,7 @@ public partial class View
 
     private View GetMostFocused (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return null;
         }
@@ -838,7 +838,7 @@ public partial class View
 
         // BUGBUG: v2 - This needs to support children of Frames too
 
-        if (Focused == null && SuperView != null)
+        if (Focused is null && SuperView != null)
         {
             SuperView.EnsureFocus ();
         }

+ 2 - 2
Terminal.Gui/View/ViewText.cs

@@ -313,7 +313,7 @@ public partial class View
 
                     // TODO: v2 - This uses frame.Width; it should only use Bounds
                     if (_frame.Width < colWidth
-                        && (Width == null || (Bounds.Width >= 0 && Width is Dim.DimAbsolute && Width.Anchor (0) >= 0 && Width.Anchor (0) < colWidth)))
+                        && (Width is null || (Bounds.Width >= 0 && Width is Dim.DimAbsolute && Width.Anchor (0) >= 0 && Width.Anchor (0) < colWidth)))
                     {
                         sizeRequired = new Size (colWidth, Bounds.Height);
 
@@ -322,7 +322,7 @@ public partial class View
 
                     break;
                 default:
-                    if (_frame.Height < 1 && (Height == null || (Height is Dim.DimAbsolute && Height.Anchor (0) == 0)))
+                    if (_frame.Height < 1 && (Height is null || (Height is Dim.DimAbsolute && Height.Anchor (0) == 0)))
                     {
                         sizeRequired = new Size (Bounds.Width, 1);
 

+ 1 - 1
Terminal.Gui/Views/AutocompleteFilepathContext.cs

@@ -25,7 +25,7 @@ internal class FilepathSuggestionGenerator : ISuggestionGenerator
             state = fileState.State;
         }
 
-        if (state == null)
+        if (state is null)
         {
             return Enumerable.Empty<Suggestion> ();
         }

+ 1 - 1
Terminal.Gui/Views/CheckBox.cs

@@ -68,7 +68,7 @@ public class CheckBox : View
         get => _checked;
         set
         {
-            if (value == null && !AllowNullChecked)
+            if (value is null && !AllowNullChecked)
             {
                 return;
             }

+ 4 - 4
Terminal.Gui/Views/ComboBox.cs

@@ -372,7 +372,7 @@ public class ComboBox : View
     /// </remarks>
     public void SetSource (IList source)
     {
-        if (source == null)
+        if (source is null)
         {
             Source = null;
         }
@@ -605,7 +605,7 @@ public class ComboBox : View
 
     private void ProcessLayout ()
     {
-        if (Bounds.Height < _minimumHeight && (Height == null || Height is Dim.DimAbsolute))
+        if (Bounds.Height < _minimumHeight && (Height is null || Height is Dim.DimAbsolute))
         {
             Height = _minimumHeight;
         }
@@ -723,7 +723,7 @@ public class ComboBox : View
 
     private void SetSearchSet ()
     {
-        if (Source == null)
+        if (Source is null)
         {
             return;
         }
@@ -873,7 +873,7 @@ public class ComboBox : View
 
                 Move (0, row);
 
-                if (Source == null || item >= Source.Count)
+                if (Source is null || item >= Source.Count)
                 {
                     for (var c = 0; c < f.Width; c++)
                     {

+ 2 - 2
Terminal.Gui/Views/Dialog.cs

@@ -80,7 +80,7 @@ public class Dialog : Window
         get => _buttons.ToArray ();
         init
         {
-            if (value == null)
+            if (value is null)
             {
                 return;
             }
@@ -105,7 +105,7 @@ public class Dialog : Window
     /// <param name="button">Button to add.</param>
     public void AddButton (Button button)
     {
-        if (button == null)
+        if (button is null)
         {
             return;
         }

+ 8 - 8
Terminal.Gui/Views/FileDialog.cs

@@ -876,7 +876,7 @@ public class FileDialog : Dialog
 
     private IFileSystemInfo [] GetFocusedFiles ()
     {
-        if (!_tableView.HasFocus || !_tableView.CanFocus || FileOperationsHandler == null)
+        if (!_tableView.HasFocus || !_tableView.CanFocus || FileOperationsHandler is null)
         {
             return null;
         }
@@ -1229,7 +1229,7 @@ public class FileDialog : Dialog
     //		}
     private void RestartSearch ()
     {
-        if (_disposed || State?.Directory == null)
+        if (_disposed || State?.Directory is null)
         {
             return;
         }
@@ -1240,7 +1240,7 @@ public class FileDialog : Dialog
         }
 
         // user is clearing search terms
-        if (_tbFind.Text == null || _tbFind.Text.Length == 0)
+        if (_tbFind.Text is null || _tbFind.Text.Length == 0)
         {
             // Wait for search cancellation (if any) to finish
             // then push the current dir state
@@ -1259,7 +1259,7 @@ public class FileDialog : Dialog
 
     private void ShowCellContextMenu (Point? clickedCell, MouseEventEventArgs e)
     {
-        if (clickedCell == null)
+        if (clickedCell is null)
         {
             return;
         }
@@ -1394,7 +1394,7 @@ public class FileDialog : Dialog
 
         FileSystemInfoStats stats = RowToStats (obj.NewRow);
 
-        if (stats == null)
+        if (stats is null)
         {
             return;
         }
@@ -1439,7 +1439,7 @@ public class FileDialog : Dialog
 
     private void TreeView_SelectionChanged (object sender, SelectionChangedEventArgs<IFileSystemInfo> e)
     {
-        if (e.NewValue == null)
+        if (e.NewValue is null)
         {
             return;
         }
@@ -1487,7 +1487,7 @@ public class FileDialog : Dialog
 
     private void WriteStateToTableView ()
     {
-        if (State == null)
+        if (State is null)
         {
             return;
         }
@@ -1511,7 +1511,7 @@ public class FileDialog : Dialog
                                                                   _fileDialog.State?.Children [idx]
                                                                  );
 
-            if (val == null)
+            if (val is null)
             {
                 return string.Empty;
             }

+ 1 - 1
Terminal.Gui/Views/FileDialogTableSource.cs

@@ -65,7 +65,7 @@ internal class FileDialogTableSource : ITableSource
             case 1:
                 return stats?.HumanReadableLength ?? string.Empty;
             case 2:
-                if (stats == null || stats.IsParent || stats.LastWriteTime == null)
+                if (stats is null || stats.IsParent || stats.LastWriteTime is null)
                 {
                     return string.Empty;
                 }

+ 1 - 1
Terminal.Gui/Views/HexView.cs

@@ -173,7 +173,7 @@ public class HexView : View
         get => source;
         set
         {
-            if (value == null)
+            if (value is null)
             {
                 throw new ArgumentNullException ("source");
             }

+ 11 - 11
Terminal.Gui/Views/ListView.cs

@@ -201,7 +201,7 @@ public class ListView : View
         get => _left;
         set
         {
-            if (_source == null)
+            if (_source is null)
             {
                 return;
             }
@@ -226,7 +226,7 @@ public class ListView : View
         get => _selected;
         set
         {
-            if (_source == null || _source.Count == 0)
+            if (_source is null || _source.Count == 0)
             {
                 return;
             }
@@ -265,7 +265,7 @@ public class ListView : View
         get => _top;
         set
         {
-            if (_source == null)
+            if (_source is null)
             {
                 return;
             }
@@ -363,7 +363,7 @@ public class ListView : View
             SetFocus ();
         }
 
-        if (_source == null)
+        if (_source is null)
         {
             return false;
         }
@@ -643,7 +643,7 @@ public class ListView : View
 
             Move (0, row);
 
-            if (_source == null || item >= _source.Count)
+            if (_source is null || item >= _source.Count)
             {
                 for (var c = 0; c < f.Width; c++)
                 {
@@ -695,7 +695,7 @@ public class ListView : View
     /// <returns></returns>
     public virtual bool OnOpenSelectedItem ()
     {
-        if (_source.Count <= _selected || _selected < 0 || OpenSelectedItem == null)
+        if (_source.Count <= _selected || _selected < 0 || OpenSelectedItem is null)
         {
             return false;
         }
@@ -819,7 +819,7 @@ public class ListView : View
     /// </remarks>
     public void SetSource (IList source)
     {
-        if (source == null && (Source == null || !(Source is ListWrapper)))
+        if (source is null && (Source is null || !(Source is ListWrapper)))
         {
             Source = null;
         }
@@ -840,7 +840,7 @@ public class ListView : View
         return Task.Factory.StartNew (
                                       () =>
                                       {
-                                          if (source == null && (Source == null || !(Source is ListWrapper)))
+                                          if (source is null && (Source is null || !(Source is ListWrapper)))
                                           {
                                               Source = null;
                                           }
@@ -903,7 +903,7 @@ public class ListWrapper : IListDataSource
         container.Move (col, line);
         object t = _source? [item];
 
-        if (t == null)
+        if (t is null)
         {
             RenderUstr (driver, "", col, line, width);
         }
@@ -950,7 +950,7 @@ public class ListWrapper : IListDataSource
     /// <inheritdoc/>
     public int StartsWith (string search)
     {
-        if (_source == null || _source?.Count == 0)
+        if (_source is null || _source?.Count == 0)
         {
             return -1;
         }
@@ -980,7 +980,7 @@ public class ListWrapper : IListDataSource
 
     private int GetMaxLengthItem ()
     {
-        if (_source == null || _source?.Count == 0)
+        if (_source is null || _source?.Count == 0)
         {
             return 0;
         }

+ 1 - 1
Terminal.Gui/Views/Menu/ContextMenu.cs

@@ -179,7 +179,7 @@ public sealed class ContextMenu : IDisposable
         {
             if (frame.Bottom - rect.Height - 1 >= 0 || !ForceMinimumPosToZero)
             {
-                if (Host == null)
+                if (Host is null)
                 {
                     position.Y = frame.Bottom - rect.Height - 1;
                 }

+ 22 - 22
Terminal.Gui/Views/Menu/Menu.cs

@@ -103,7 +103,7 @@ public class MenuItem
         {
             _checkType = value;
 
-            if (_checkType == MenuItemCheckStyle.Checked && !_allowNullChecked && Checked == null)
+            if (_checkType == MenuItemCheckStyle.Checked && !_allowNullChecked && Checked is null)
             {
                 Checked = false;
             }
@@ -300,7 +300,7 @@ internal sealed class Menu : View
 
     internal static Rect MakeFrame (int x, int y, MenuItem [] items, Menu parent = null)
     {
-        if (items == null || items.Length == 0)
+        if (items is null || items.Length == 0)
         {
             return new Rect ();
         }
@@ -485,7 +485,7 @@ internal sealed class Menu : View
 #if SUPPORT_ALT_TO_ACTIVATE_MENU
     void SuperView_KeyUp (object sender, KeyEventArgs e)
     {
-        if (SuperView == null || SuperView.CanFocus == false || SuperView.Visible == false)
+        if (SuperView is null || SuperView.CanFocus == false || SuperView.Visible == false)
         {
             return;
         }
@@ -496,7 +496,7 @@ internal sealed class Menu : View
 
     private void AddKeyBindings (MenuBarItem menuBarItem)
     {
-        if (menuBarItem == null || menuBarItem.Children == null)
+        if (menuBarItem is null || menuBarItem.Children is null)
         {
             return;
         }
@@ -544,12 +544,12 @@ internal sealed class Menu : View
             {
                 MenuItem item = _barItems.Children [_currentChild];
 
-                if (item == null)
+                if (item is null)
                 {
                     return true;
                 }
 
-                bool disabled = item == null || !item.IsEnabled ();
+                bool disabled = item is null || !item.IsEnabled ();
 
                 if (!disabled && (_host.UseSubMenusSingleFrame || !CheckSubMenu ()))
                 {
@@ -598,7 +598,7 @@ internal sealed class Menu : View
 
             MenuItem [] children = _barItems.Children;
 
-            if (children == null)
+            if (children is null)
             {
                 return base.OnInvokingKeyBindings (keyEvent);
             }
@@ -667,7 +667,7 @@ internal sealed class Menu : View
 
     private bool FindShortcutInChildMenu (KeyCode key, MenuBarItem menuBarItem)
     {
-        if (menuBarItem?.Children == null)
+        if (menuBarItem?.Children is null)
         {
             return false;
         }
@@ -753,7 +753,7 @@ internal sealed class Menu : View
 
     internal Attribute DetermineColorSchemeFor (MenuItem item, int index)
     {
-        if (item == null)
+        if (item is null)
         {
             return GetNormalColor ();
         }
@@ -768,7 +768,7 @@ internal sealed class Menu : View
 
     public override void OnDrawContent (Rect contentArea)
     {
-        if (_barItems.Children == null)
+        if (_barItems.Children is null)
         {
             return;
         }
@@ -795,11 +795,11 @@ internal sealed class Menu : View
             MenuItem item = _barItems.Children [i];
 
             Driver.SetAttribute (
-                                 item == null ? GetNormalColor () :
+                                 item is null ? GetNormalColor () :
                                  i == _currentChild ? ColorScheme.Focus : GetNormalColor ()
                                 );
 
-            if (item == null && BorderStyle != LineStyle.None)
+            if (item is null && BorderStyle != LineStyle.None)
             {
                 Move (-1, i);
                 Driver.AddRune (Glyphs.LeftTee);
@@ -824,7 +824,7 @@ internal sealed class Menu : View
                     break;
                 }
 
-                if (item == null)
+                if (item is null)
                 {
                     Driver.AddRune (Glyphs.HLine);
                 }
@@ -844,7 +844,7 @@ internal sealed class Menu : View
                 }
             }
 
-            if (item == null)
+            if (item is null)
             {
                 if (BorderStyle != LineStyle.None && SuperView?.Frame.Right - Frame.X > Frame.Width)
                 {
@@ -867,7 +867,7 @@ internal sealed class Menu : View
             }
 
             // Support Checked even though CheckType wasn't set
-            if (item.CheckType == MenuItemCheckStyle.Checked && item.Checked == null)
+            if (item.CheckType == MenuItemCheckStyle.Checked && item.Checked is null)
             {
                 textToDraw = $"{nullCheckedChar} {item.Title}";
             }
@@ -974,7 +974,7 @@ internal sealed class Menu : View
 
     public void Run (Action action)
     {
-        if (action == null || _host == null)
+        if (action is null || _host is null)
         {
             return;
         }
@@ -1075,7 +1075,7 @@ internal sealed class Menu : View
                 _host.OpenMenu (_host._selected);
             }
         }
-        while (_barItems.Children [_currentChild] == null || disabled);
+        while (_barItems.Children [_currentChild] is null || disabled);
 
         SetNeedsDisplay ();
         SetParentSetNeedsDisplay ();
@@ -1156,7 +1156,7 @@ internal sealed class Menu : View
 
             break;
         }
-        while (_barItems.Children [_currentChild] == null || disabled);
+        while (_barItems.Children [_currentChild] is null || disabled);
 
         SetNeedsDisplay ();
         SetParentSetNeedsDisplay ();
@@ -1192,7 +1192,7 @@ internal sealed class Menu : View
 
         _host._handled = false;
         bool disabled;
-        int meY = me.Y - (Border == null ? 0 : Border.Thickness.Top);
+        int meY = me.Y - (Border is null ? 0 : Border.Thickness.Top);
 
         if (me.Flags == MouseFlags.Button1Clicked)
         {
@@ -1210,7 +1210,7 @@ internal sealed class Menu : View
 
             MenuItem item = _barItems.Children [meY];
 
-            if (item == null || !item.IsEnabled ())
+            if (item is null || !item.IsEnabled ())
             {
                 disabled = true;
             }
@@ -1245,7 +1245,7 @@ internal sealed class Menu : View
 
             MenuItem item = _barItems.Children [meY];
 
-            if (item == null)
+            if (item is null)
             {
                 return true;
             }
@@ -1276,7 +1276,7 @@ internal sealed class Menu : View
 
     internal bool CheckSubMenu ()
     {
-        if (_currentChild == -1 || _barItems.Children [_currentChild] == null)
+        if (_currentChild == -1 || _barItems.Children [_currentChild] is null)
         {
             return true;
         }

+ 22 - 22
Terminal.Gui/Views/Menu/MenuBar.cs

@@ -49,7 +49,7 @@ public class MenuBarItem : MenuItem
     /// <value>The children.</value>
     public MenuItem [] Children { get; set; }
 
-    internal bool IsTopLevel => Parent == null && (Children == null || Children.Length == 0) && Action != null;
+    internal bool IsTopLevel => Parent is null && (Children is null || Children.Length == 0) && Action != null;
 
     /// <summary>Get the index of a child <see cref="MenuItem"/>.</summary>
     /// <param name="children"></param>
@@ -97,7 +97,7 @@ public class MenuBarItem : MenuItem
 
     internal void AddKeyBindings (MenuBar menuBar)
     {
-        if (Children == null)
+        if (Children is null)
         {
             return;
         }
@@ -126,7 +126,7 @@ public class MenuBarItem : MenuItem
 
     private void SetInitialProperties (string title, object children, MenuItem parent = null, bool isTopLevel = false)
     {
-        if (!isTopLevel && children == null)
+        if (!isTopLevel && children is null)
         {
             throw new ArgumentNullException (
                                              nameof (children),
@@ -345,7 +345,7 @@ public class MenuBar : View
         {
             _menus = value;
 
-            if (Menus == null)
+            if (Menus is null)
             {
                 return;
             }
@@ -588,7 +588,7 @@ public class MenuBar : View
         _selected = 0;
         SetNeedsDisplay ();
 
-        _previousFocused = SuperView == null ? Application.Current.Focused : SuperView.Focused;
+        _previousFocused = SuperView is null ? Application.Current.Focused : SuperView.Focused;
         OpenMenu (_selected);
 
         if (!SelectEnabledItem (
@@ -645,9 +645,9 @@ public class MenuBar : View
         _selected = idx;
         _selectedSub = sIdx;
 
-        if (_openMenu == null)
+        if (_openMenu is null)
         {
-            _previousFocused = SuperView == null ? Application.Current?.Focused ?? null : SuperView.Focused;
+            _previousFocused = SuperView is null ? Application.Current?.Focused ?? null : SuperView.Focused;
         }
 
         OpenMenu (idx, sIdx, subMenu);
@@ -661,7 +661,7 @@ public class MenuBar : View
             e.Handled = true;
 
             // User pressed Alt 
-            if (!IsMenuOpen && _openMenu == null && !_openedByAltKey)
+            if (!IsMenuOpen && _openMenu is null && !_openedByAltKey)
             {
                 // There's no open menu, the first menu item should be highlighted.
                 // The right way to do this is to SetFocus(MenuBar), but for some reason
@@ -825,7 +825,7 @@ public class MenuBar : View
 
                     LastFocused.SetFocus ();
                 }
-                else if (_openSubMenu == null || _openSubMenu.Count == 0)
+                else if (_openSubMenu is null || _openSubMenu.Count == 0)
                 {
                     CloseAllMenus ();
                 }
@@ -860,13 +860,13 @@ public class MenuBar : View
     /// <returns>The location offset.</returns>
     internal Point GetScreenOffset ()
     {
-        if (Driver == null)
+        if (Driver is null)
         {
             return Point.Empty;
         }
 
-        Rect superViewFrame = SuperView == null ? Driver.Bounds : SuperView.Frame;
-        View sv = SuperView == null ? Application.Current : SuperView;
+        Rect superViewFrame = SuperView is null ? Driver.Bounds : SuperView.Frame;
+        View sv = SuperView is null ? Application.Current : SuperView;
         Point boundsOffset = sv.GetBoundsOffset ();
 
         return new Point (
@@ -937,7 +937,7 @@ public class MenuBar : View
                                                                                  )
                                               : null;
 
-                    if ((_selectedSub == -1 || _openSubMenu == null || _openSubMenu?.Count - 1 == _selectedSub) && subMenu == null)
+                    if ((_selectedSub == -1 || _openSubMenu is null || _openSubMenu?.Count - 1 == _selectedSub) && subMenu is null)
                     {
                         if (_openSubMenu != null && !CloseMenu (false, true))
                         {
@@ -1000,7 +1000,7 @@ public class MenuBar : View
         {
             case null:
                 // Open a submenu below a MenuBar
-                _lastFocused ??= SuperView == null ? Application.Current?.MostFocused : SuperView.MostFocused;
+                _lastFocused ??= SuperView is null ? Application.Current?.MostFocused : SuperView.MostFocused;
 
                 if (_openSubMenu != null && !CloseMenu (false, true))
                 {
@@ -1024,7 +1024,7 @@ public class MenuBar : View
                 var locationOffset = Point.Empty;
 
                 // if SuperView is null then it's from a ContextMenu
-                if (SuperView == null)
+                if (SuperView is null)
                 {
                     locationOffset = GetScreenOffset ();
                 }
@@ -1052,7 +1052,7 @@ public class MenuBar : View
                 break;
             default:
                 // Opens a submenu next to another submenu (openSubMenu)
-                if (_openSubMenu == null)
+                if (_openSubMenu is null)
                 {
                     _openSubMenu = new List<Menu> ();
                 }
@@ -1188,7 +1188,7 @@ public class MenuBar : View
 
     internal bool Run (Action action)
     {
-        if (action == null)
+        if (action is null)
         {
             return false;
         }
@@ -1212,7 +1212,7 @@ public class MenuBar : View
         bool forward = true
     )
     {
-        if (chldren == null)
+        if (chldren is null)
         {
             newCurrent = -1;
 
@@ -1258,7 +1258,7 @@ public class MenuBar : View
                 }
             }
 
-            if (child == null || !child.IsEnabled ())
+            if (child is null || !child.IsEnabled ())
             {
                 if (forward)
                 {
@@ -1286,7 +1286,7 @@ public class MenuBar : View
     /// <param name="item"></param>
     internal bool SelectItem (MenuItem item)
     {
-        if (item?.Action == null)
+        if (item?.Action is null)
         {
             return false;
         }
@@ -1636,7 +1636,7 @@ public class MenuBar : View
     {
         menuItemToSelect = null;
 
-        if (key == KeyCode.Null || menuBarItem?.Children == null)
+        if (key == KeyCode.Null || menuBarItem?.Children is null)
         {
             return false;
         }
@@ -1905,7 +1905,7 @@ public class MenuBar : View
 
     private MenuBar GetMouseGrabViewInstance (View view)
     {
-        if (view == null || Application.MouseGrabView == null)
+        if (view is null || Application.MouseGrabView is null)
         {
             return null;
         }

+ 1 - 1
Terminal.Gui/Views/ProgressBar.cs

@@ -213,7 +213,7 @@ public class ProgressBar : View
     /// </remarks>
     public void Pulse ()
     {
-        if (_activityPos == null || _activityPos.Length == 0)
+        if (_activityPos is null || _activityPos.Length == 0)
         {
             PopulateActivityPos ();
         }

+ 1 - 1
Terminal.Gui/Views/RadioGroup.cs

@@ -400,7 +400,7 @@ public class RadioGroup : View
 
     private static Rect MakeRect (int x, int y, List<string> radioLabels)
     {
-        if (radioLabels == null)
+        if (radioLabels is null)
         {
             return new Rect (x, y, 0, 0);
         }

+ 7 - 7
Terminal.Gui/Views/ScrollBarView.cs

@@ -57,12 +57,12 @@ public class ScrollBarView : View
     /// </param>
     public ScrollBarView (View host, bool isVertical, bool showBothScrollIndicator = true)
     {
-        if (host == null)
+        if (host is null)
         {
             throw new ArgumentNullException ("The host parameter can't be null.");
         }
 
-        if (host.SuperView == null)
+        if (host.SuperView is null)
         {
             throw new ArgumentNullException ("The host SuperView parameter can't be null.");
         }
@@ -307,7 +307,7 @@ public class ScrollBarView : View
         barsize -= 2;
         int pos = Position;
 
-        if (mouseEvent.Flags != MouseFlags.Button1Released && (Application.MouseGrabView == null || Application.MouseGrabView != this))
+        if (mouseEvent.Flags != MouseFlags.Button1Released && (Application.MouseGrabView is null || Application.MouseGrabView != this))
         {
             Application.GrabMouse (this);
         }
@@ -451,7 +451,7 @@ public class ScrollBarView : View
     /// <inheritdoc/>
     public override void OnDrawContent (Rect contentArea)
     {
-        if (ColorScheme == null || ((!_showScrollIndicator || Size == 0) && AutoHideScrollBars && Visible))
+        if (ColorScheme is null || ((!_showScrollIndicator || Size == 0) && AutoHideScrollBars && Visible))
         {
             if ((!_showScrollIndicator || Size == 0) && AutoHideScrollBars && Visible)
             {
@@ -818,8 +818,8 @@ public class ScrollBarView : View
         }
 
         if (Host != null
-            && ((_contentBottomRightCorner == null && OtherScrollBarView == null)
-                || (_contentBottomRightCorner == null && OtherScrollBarView != null && OtherScrollBarView._contentBottomRightCorner == null)))
+            && ((_contentBottomRightCorner is null && OtherScrollBarView is null)
+                || (_contentBottomRightCorner is null && OtherScrollBarView != null && OtherScrollBarView._contentBottomRightCorner is null)))
         {
             _contentBottomRightCorner = new ContentBottomRightCorner { Visible = Host.Visible };
 
@@ -892,7 +892,7 @@ public class ScrollBarView : View
         SetWidthHeight ();
         SetRelativeLayout (SuperView?.Frame ?? Host?.Frame ?? Frame);
 
-        if (OtherScrollBarView == null)
+        if (OtherScrollBarView is null)
         {
             // Only do this once if both scrollbars are enabled
             ShowHideScrollBars ();

+ 1 - 1
Terminal.Gui/Views/ScrollView.cs

@@ -445,7 +445,7 @@ public class ScrollView : View
     /// <param name="view">The view to remove from the scrollview.</param>
     public override void Remove (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return;
         }

+ 3 - 3
Terminal.Gui/Views/Slider.cs

@@ -327,7 +327,7 @@ public class Slider<T> : View
     /// <param name="orientation">Initial slider orientation.</param>
     public Slider (List<T> options, Orientation orientation = Orientation.Horizontal)
     {
-        if (options == null)
+        if (options is null)
         {
             SetInitialProperties (null, orientation);
         }
@@ -998,7 +998,7 @@ public class Slider<T> : View
     {
         // TODO: make this more surgical to reduce repaint
 
-        if (_options == null && _options.Count > 0)
+        if (_options is null && _options.Count > 0)
         {
             return;
         }
@@ -1033,7 +1033,7 @@ public class Slider<T> : View
 
     private string AlignText (string text, int width, TextAlignment textAlignment)
     {
-        if (text == null)
+        if (text is null)
         {
             return "";
         }

+ 1 - 1
Terminal.Gui/Views/StatusBar.cs

@@ -309,7 +309,7 @@ public class StatusBar : View
 
     private void Run (Action action)
     {
-        if (action == null)
+        if (action is null)
         {
             return;
         }

+ 8 - 8
Terminal.Gui/Views/TabView.cs

@@ -214,7 +214,7 @@ public class TabView : View
         _tabs.Add (tab);
         _tabsBar.Add (tab);
 
-        if (SelectedTab == null || andSelect)
+        if (SelectedTab is null || andSelect)
         {
             SelectedTab = tab;
 
@@ -291,7 +291,7 @@ public class TabView : View
     /// <summary>Updates <see cref="TabScrollOffset"/> to ensure that <see cref="SelectedTab"/> is visible.</summary>
     public void EnsureSelectedTabIsVisible ()
     {
-        if (!IsInitialized || SelectedTab == null)
+        if (!IsInitialized || SelectedTab is null)
         {
             return;
         }
@@ -335,7 +335,7 @@ public class TabView : View
     /// <param name="tab"></param>
     public void RemoveTab (Tab tab)
     {
-        if (tab == null || !_tabs.Contains (tab))
+        if (tab is null || !_tabs.Contains (tab))
         {
             return;
         }
@@ -346,7 +346,7 @@ public class TabView : View
         _tabs.Remove (tab);
 
         // if the currently selected tab is no longer a member of Tabs
-        if (SelectedTab == null || !Tabs.Contains (SelectedTab))
+        if (SelectedTab is null || !Tabs.Contains (SelectedTab))
         {
             // select the tab closest to the one that disappeared
             int toSelect = Math.Max (idx - 1, 0);
@@ -381,7 +381,7 @@ public class TabView : View
         }
 
         // if there is only one tab anyway or nothing is selected
-        if (Tabs.Count == 1 || SelectedTab == null)
+        if (Tabs.Count == 1 || SelectedTab is null)
         {
             SelectedTab = Tabs.ElementAt (0);
             SetNeedsDisplay ();
@@ -672,7 +672,7 @@ public class TabView : View
 
         public override void OnDrawContentComplete (Rect contentArea)
         {
-            if (_host._tabLocations == null)
+            if (_host._tabLocations is null)
             {
                 return;
             }
@@ -1259,7 +1259,7 @@ public class TabView : View
                         tab.Margin.Thickness = new Thickness (0, 0, 0, topLine);
                     }
                 }
-                else if (selected == null)
+                else if (selected is null)
                 {
                     if (_host.Style.TabsOnBottom)
                     {
@@ -1332,7 +1332,7 @@ public class TabView : View
 
             TabToRender selected = _host._tabLocations.FirstOrDefault (t => t.IsSelected);
 
-            if (selected == null)
+            if (selected is null)
             {
                 return;
             }

+ 1 - 1
Terminal.Gui/Views/TableView/ListTableSource.cs

@@ -124,7 +124,7 @@ public class ListTableSource : ITableSource
     /// <returns></returns>
     private int CalculateMaxLength ()
     {
-        if (List == null || Count == 0)
+        if (List is null || Count == 0)
         {
             return 0;
         }

+ 4 - 4
Terminal.Gui/Views/TableView/TableView.cs

@@ -489,7 +489,7 @@ public class TableView : View
         ColumnToRender colHit = viewPort.FirstOrDefault (c => c.Column == tableColumn);
 
         // current column is outside the scroll area
-        if (colHit == null)
+        if (colHit is null)
         {
             return null;
         }
@@ -571,7 +571,7 @@ public class TableView : View
     /// </remarks>
     public void EnsureSelectedCellIsVisible ()
     {
-        if (Table == null || Table.Columns <= 0)
+        if (Table is null || Table.Columns <= 0)
         {
             return;
         }
@@ -1586,7 +1586,7 @@ public class TableView : View
     /// <returns></returns>
     private string GetRepresentation (object value, ColumnStyle colStyle)
     {
-        if (value == null || value == DBNull.Value)
+        if (value is null || value == DBNull.Value)
         {
             return NullSymbol;
         }
@@ -1885,7 +1885,7 @@ public class TableView : View
                                            );
 
                 // if users custom color getter returned null, use the row scheme
-                if (scheme == null)
+                if (scheme is null)
                 {
                     scheme = rowScheme;
                 }

+ 2 - 2
Terminal.Gui/Views/TableView/TreeTableSource.cs

@@ -136,7 +136,7 @@ public class TreeTableSource<T> : IEnumerableTableSource<T>, IDisposable where T
 
         T obj = _tree.GetObjectOnRow (_tableView.SelectedRow);
 
-        if (obj == null)
+        if (obj is null)
         {
             return;
         }
@@ -170,7 +170,7 @@ public class TreeTableSource<T> : IEnumerableTableSource<T>, IDisposable where T
     {
         Point? hit = _tableView.ScreenToCell (e.MouseEvent.X, e.MouseEvent.Y, out int? headerIfAny, out int? offsetX);
 
-        if (hit == null || headerIfAny != null || !IsInTreeColumn (hit.Value.X, false) || offsetX == null)
+        if (hit is null || headerIfAny != null || !IsInTreeColumn (hit.Value.X, false) || offsetX is null)
         {
             return;
         }

+ 13 - 13
Terminal.Gui/Views/TextField.cs

@@ -755,7 +755,7 @@ public class TextField : View
     {
         ColorScheme cs = ColorScheme;
 
-        if (ColorScheme == null)
+        if (ColorScheme is null)
         {
             cs = new ColorScheme ();
         }
@@ -796,7 +796,7 @@ public class TextField : View
         ClearAllSelection ();
         (int col, int row)? newPos = GetModel ().WordBackward (_cursorPosition, 0);
 
-        if (newPos == null)
+        if (newPos is null)
         {
             return;
         }
@@ -819,7 +819,7 @@ public class TextField : View
         ClearAllSelection ();
         (int col, int row)? newPos = GetModel ().WordForward (_cursorPosition, 0);
 
-        if (newPos == null)
+        if (newPos is null)
         {
             return;
         }
@@ -883,7 +883,7 @@ public class TextField : View
             _isButtonReleased = false;
             PrepareSelection (x);
 
-            if (Application.MouseGrabView == null)
+            if (Application.MouseGrabView is null)
             {
                 Application.GrabMouse (this);
             }
@@ -906,7 +906,7 @@ public class TextField : View
             {
                 (int col, int row)? newPosBw = GetModel ().WordBackward (x, 0);
 
-                if (newPosBw == null)
+                if (newPosBw is null)
                 {
                     return true;
                 }
@@ -922,7 +922,7 @@ public class TextField : View
 
             (int col, int row)? newPosFw = GetModel ().WordForward (x, 0);
 
-            if (newPosFw == null)
+            if (newPosFw is null)
             {
                 return true;
             }
@@ -1232,7 +1232,7 @@ public class TextField : View
         //if (string.IsNullOrEmpty (Clipboard.Contents))
         //	return true;
         //var clip = TextModel.ToRunes (Clipboard.Contents);
-        //if (clip == null)
+        //if (clip is null)
         //	return true;
 
         //if (point == text.Count) {
@@ -1449,7 +1449,7 @@ public class TextField : View
     {
         ColorScheme cs = ColorScheme;
 
-        if (ColorScheme == null)
+        if (ColorScheme is null)
         {
             cs = new ColorScheme ();
         }
@@ -1472,7 +1472,7 @@ public class TextField : View
 
     private void HistoryText_ChangeText (object sender, HistoryText.HistoryTextItem obj)
     {
-        if (obj == null)
+        if (obj is null)
         {
             return;
         }
@@ -1663,7 +1663,7 @@ public class TextField : View
         ClearAllSelection ();
         (int col, int row)? newPos = GetModel ().WordBackward (_cursorPosition, 0);
 
-        if (newPos == null)
+        if (newPos is null)
         {
             return;
         }
@@ -1689,7 +1689,7 @@ public class TextField : View
             {
                 (int col, int row)? newPos = GetModel ().WordBackward (x, 0);
 
-                if (newPos == null)
+                if (newPos is null)
                 {
                     return;
                 }
@@ -1709,7 +1709,7 @@ public class TextField : View
         ClearAllSelection ();
         (int col, int row)? newPos = GetModel ().WordForward (_cursorPosition, 0);
 
-        if (newPos == null)
+        if (newPos is null)
         {
             return;
         }
@@ -1729,7 +1729,7 @@ public class TextField : View
             int x = _start > -1 && _start > _cursorPosition ? _start : _cursorPosition;
             (int col, int row)? newPos = GetModel ().WordForward (x, 0);
 
-            if (newPos == null)
+            if (newPos is null)
             {
                 return;
             }

+ 5 - 5
Terminal.Gui/Views/TextValidateField.cs

@@ -478,7 +478,7 @@ namespace Terminal.Gui
         {
             get
             {
-                if (_provider == null)
+                if (_provider is null)
                 {
                     return false;
                 }
@@ -512,7 +512,7 @@ namespace Terminal.Gui
         {
             get
             {
-                if (_provider == null)
+                if (_provider is null)
                 {
                     return string.Empty;
                 }
@@ -521,7 +521,7 @@ namespace Terminal.Gui
             }
             set
             {
-                if (_provider == null)
+                if (_provider is null)
                 {
                     return;
                 }
@@ -557,7 +557,7 @@ namespace Terminal.Gui
         /// <inheritdoc/>
         public override void OnDrawContent (Rect contentArea)
         {
-            if (_provider == null)
+            if (_provider is null)
             {
                 Move (0, 0);
                 Driver.AddStr ("Error: ITextValidateProvider not set!");
@@ -617,7 +617,7 @@ namespace Terminal.Gui
         /// <inheritdoc/>
         public override bool OnProcessKeyDown (Key a)
         {
-            if (_provider == null)
+            if (_provider is null)
             {
                 return false;
             }

+ 23 - 23
Terminal.Gui/Views/TextView.cs

@@ -61,7 +61,7 @@ internal class TextModel
 
     public bool CloseFile ()
     {
-        if (FilePath == null)
+        if (FilePath is null)
         {
             throw new ArgumentNullException (nameof (FilePath));
         }
@@ -148,7 +148,7 @@ internal class TextModel
 
     public void LoadStream (Stream input)
     {
-        if (input == null)
+        if (input is null)
         {
             throw new ArgumentNullException (nameof (input));
         }
@@ -565,7 +565,7 @@ internal class TextModel
     // Returns the left column in a range of the string.
     internal static int CalculateLeftColumn (List<Rune> t, int start, int end, int width, int tabWidth = 0)
     {
-        if (t == null || t.Count == 0)
+        if (t is null || t.Count == 0)
         {
             return 0;
         }
@@ -632,7 +632,7 @@ internal class TextModel
         int tabWidth = 0
     )
     {
-        if (t == null || t.Count == 0)
+        if (t is null || t.Count == 0)
         {
             return (0, 0);
         }
@@ -687,7 +687,7 @@ internal class TextModel
         bool matchWholeWord = false
     )
     {
-        if (text == null || _lines.Count == 0)
+        if (text is null || _lines.Count == 0)
         {
             gaveFullTurn = false;
 
@@ -730,7 +730,7 @@ internal class TextModel
         bool matchWholeWord = false
     )
     {
-        if (text == null || _lines.Count == 0)
+        if (text is null || _lines.Count == 0)
         {
             gaveFullTurn = false;
 
@@ -3218,7 +3218,7 @@ public class TextView : View
     {
         ColorScheme? cs = ColorScheme;
 
-        if (ColorScheme == null)
+        if (ColorScheme is null)
         {
             cs = new ColorScheme ();
         }
@@ -3485,7 +3485,7 @@ public class TextView : View
             _lastWasKill = false;
             _columnTrack = CurrentColumn;
 
-            if (Application.MouseGrabView == null)
+            if (Application.MouseGrabView is null)
             {
                 Application.GrabMouse (this);
             }
@@ -3770,10 +3770,10 @@ public class TextView : View
     /// <summary>Invoke the <see cref="UnwrappedCursorPosition"/> event with the unwrapped <see cref="CursorPosition"/>.</summary>
     public virtual void OnUnwrappedCursorPosition (int? cRow = null, int? cCol = null)
     {
-        int? row = cRow == null ? CurrentRow : cRow;
-        int? col = cCol == null ? CurrentColumn : cCol;
+        int? row = cRow is null ? CurrentRow : cRow;
+        int? col = cCol is null ? CurrentColumn : cCol;
 
-        if (cRow == null && cCol == null && _wordWrap)
+        if (cRow is null && cCol is null && _wordWrap)
         {
             row = _wrapManager!.GetModelLineFromWrappedLines (CurrentRow);
             col = _wrapManager.GetModelColFromWrappedLines (CurrentRow, CurrentColumn);
@@ -3795,7 +3795,7 @@ public class TextView : View
 
         if (_copyWithoutSelection && contents.FirstOrDefault (x => x == '\n' || x == '\r') == 0)
         {
-            List<RuneCell> runeList = contents == null ? new List<RuneCell> () : TextModel.ToRuneCellList (contents);
+            List<RuneCell> runeList = contents is null ? new List<RuneCell> () : TextModel.ToRuneCellList (contents);
             List<RuneCell> currentLine = GetCurrentLine ();
 
             _historyText.Add (new List<List<RuneCell>> { new (currentLine) }, CursorPosition);
@@ -3852,7 +3852,7 @@ public class TextView : View
     {
         ProcessAutocomplete ();
 
-        if (!CanFocus || !Enabled || Application.Driver == null)
+        if (!CanFocus || !Enabled || Application.Driver is null)
         {
             return;
         }
@@ -4628,7 +4628,7 @@ public class TextView : View
         long selection;
         long point;
 
-        if (startRow == null || startCol == null || cRow == null || cCol == null)
+        if (startRow is null || startCol is null || cRow is null || cCol is null)
         {
             selection = ((long)(uint)_selectionStartRow << 32) | (uint)_selectionStartColumn;
             point = ((long)(uint)CurrentRow << 32) | (uint)CurrentColumn;
@@ -4675,7 +4675,7 @@ public class TextView : View
         var maxrow = (int)(end >> 32);
         var startCol = (int)(start & 0xffffffff);
         var endCol = (int)(end & 0xffffffff);
-        List<RuneCell> line = model == null ? _model.GetLine (startRow) : model.GetLine (startRow);
+        List<RuneCell> line = model is null ? _model.GetLine (startRow) : model.GetLine (startRow);
 
         if (startRow == maxrow)
         {
@@ -4695,7 +4695,7 @@ public class TextView : View
                                     );
         }
 
-        line = model == null ? _model.GetLine (maxrow) : model.GetLine (maxrow);
+        line = model is null ? _model.GetLine (maxrow) : model.GetLine (maxrow);
         res = res + Environment.NewLine + StringFromRunes (line.GetRange (0, endCol));
 
         return res;
@@ -5768,7 +5768,7 @@ public class TextView : View
 
                 for (int c = l.Count - 1; c > -1; c--)
                 {
-                    if (l [c].ColorScheme == null)
+                    if (l [c].ColorScheme is null)
                     {
                         l [c].ColorScheme = cell.ColorScheme;
                     }
@@ -5782,7 +5782,7 @@ public class TextView : View
             return;
         }
 
-        if (cell.ColorScheme == null)
+        if (cell.ColorScheme is null)
         {
             for (int r = row; r > -1; r--)
             {
@@ -5805,9 +5805,9 @@ public class TextView : View
         {
             int cRow = row;
 
-            while (cell.ColorScheme == null)
+            while (cell.ColorScheme is null)
             {
-                if ((colWithColor == 0 || cell.ColorScheme == null) && cRow > 0)
+                if ((colWithColor == 0 || cell.ColorScheme is null) && cRow > 0)
                 {
                     line = GetLine (--cRow);
                     colWithColor = line.Count - 1;
@@ -5820,9 +5820,9 @@ public class TextView : View
             }
         }
 
-        if (cell.ColorScheme != null && colWithColor > -1 && colWithoutColor < lineToSet.Count && lineToSet [colWithoutColor].ColorScheme == null)
+        if (cell.ColorScheme != null && colWithColor > -1 && colWithoutColor < lineToSet.Count && lineToSet [colWithoutColor].ColorScheme is null)
         {
-            while (lineToSet [colWithoutColor].ColorScheme == null)
+            while (lineToSet [colWithoutColor].ColorScheme is null)
             {
                 lineToSet [colWithoutColor].ColorScheme = cell.ColorScheme;
                 colWithoutColor--;
@@ -6415,7 +6415,7 @@ public class TextView : View
 
     private string StringFromRunes (List<RuneCell> cells)
     {
-        if (cells == null)
+        if (cells is null)
         {
             throw new ArgumentNullException (nameof (cells));
         }

+ 25 - 25
Terminal.Gui/Views/Toplevel.cs

@@ -143,7 +143,7 @@ public partial class Toplevel : View
 
     /// <summary>Gets or sets a value indicating whether this <see cref="Toplevel"/> can focus.</summary>
     /// <value><c>true</c> if can focus; otherwise, <c>false</c>.</value>
-    public override bool CanFocus => SuperView == null ? true : base.CanFocus;
+    public override bool CanFocus => SuperView is null ? true : base.CanFocus;
 
     /// <summary>
     ///     <see langword="true"/> if was already loaded by the <see cref="Application.Begin(Toplevel)"/>
@@ -276,7 +276,7 @@ public partial class Toplevel : View
         {
             if (_dragPosition.HasValue)
             {
-                if (SuperView == null)
+                if (SuperView is null)
                 {
                     // Redraw the entire app window using just our Frame. Since we are 
                     // Application.Top, and our Frame always == our Bounds (Location is always (0,0))
@@ -437,11 +437,11 @@ public partial class Toplevel : View
         {
             base.PositionCursor ();
 
-            if (Focused == null)
+            if (Focused is null)
             {
                 EnsureFocus ();
 
-                if (Focused == null)
+                if (Focused is null)
                 {
                     Driver.SetCursorVisibility (CursorVisibility.Invisible);
                 }
@@ -450,7 +450,7 @@ public partial class Toplevel : View
             return;
         }
 
-        if (Focused == null)
+        if (Focused is null)
         {
             foreach (Toplevel top in Application.OverlappedChildren)
             {
@@ -465,7 +465,7 @@ public partial class Toplevel : View
 
         base.PositionCursor ();
 
-        if (Focused == null)
+        if (Focused is null)
         {
             Driver.SetCursorVisibility (CursorVisibility.Invisible);
         }
@@ -495,18 +495,18 @@ public partial class Toplevel : View
             maxWidth -= superView.GetAdornmentsThickness ().Left + superView.GetAdornmentsThickness ().Right;
         }
 
-        if ((superView != top || top?.SuperView != null || (top != Application.Top && top.Modal) || (top?.SuperView == null && top.IsOverlapped))
+        if ((superView != top || top?.SuperView != null || (top != Application.Top && top.Modal) || (top?.SuperView is null && top.IsOverlapped))
 
             // BUGBUG: Prevously PositionToplevel required LayotuStyle.Computed
             && (top.Frame.X + top.Frame.Width > maxWidth || ny > top.Frame.Y) /*&& top.LayoutStyle == LayoutStyle.Computed*/)
         {
-            if ((top.X == null || top.X is Pos.PosAbsolute) && top.Frame.X != nx)
+            if ((top.X is null || top.X is Pos.PosAbsolute) && top.Frame.X != nx)
             {
                 top.X = nx;
                 layoutSubviews = true;
             }
 
-            if ((top.Y == null || top.Y is Pos.PosAbsolute) && top.Frame.Y != ny)
+            if ((top.Y is null || top.Y is Pos.PosAbsolute) && top.Frame.Y != ny)
             {
                 top.Y = ny;
                 layoutSubviews = true;
@@ -703,7 +703,7 @@ public partial class Toplevel : View
         int maxWidth;
         View superView;
 
-        if (top?.SuperView == null || top == Application.Top || top?.SuperView == Application.Top)
+        if (top?.SuperView is null || top == Application.Top || top?.SuperView == Application.Top)
         {
             maxWidth = Driver.Cols;
             superView = Application.Top;
@@ -738,7 +738,7 @@ public partial class Toplevel : View
         //System.Diagnostics.Debug.WriteLine ($"nx:{nx}, rWidth:{rWidth}");
         bool menuVisible, statusVisible;
 
-        if (top?.SuperView == null || top == Application.Top || top?.SuperView == Application.Top)
+        if (top?.SuperView is null || top == Application.Top || top?.SuperView == Application.Top)
         {
             menuVisible = Application.Top.MenuBar?.Visible == true;
             menuBar = Application.Top.MenuBar;
@@ -756,7 +756,7 @@ public partial class Toplevel : View
             menuBar = ((Toplevel)t).MenuBar;
         }
 
-        if (top?.SuperView == null || top == Application.Top || top?.SuperView == Application.Top)
+        if (top?.SuperView is null || top == Application.Top || top?.SuperView == Application.Top)
         {
             maxWidth = menuVisible ? 1 : 0;
         }
@@ -767,7 +767,7 @@ public partial class Toplevel : View
 
         ny = Math.Max (targetY, maxWidth);
 
-        if (top?.SuperView == null || top == Application.Top || top?.SuperView == Application.Top)
+        if (top?.SuperView is null || top == Application.Top || top?.SuperView == Application.Top)
         {
             statusVisible = Application.Top.StatusBar?.Visible == true;
             statusBar = Application.Top.StatusBar;
@@ -785,7 +785,7 @@ public partial class Toplevel : View
             statusBar = ((Toplevel)t).StatusBar;
         }
 
-        if (top?.SuperView == null || top == Application.Top || top?.SuperView == Application.Top)
+        if (top?.SuperView is null || top == Application.Top || top?.SuperView == Application.Top)
         {
             maxWidth = statusVisible ? Driver.Rows - 1 : Driver.Rows;
         }
@@ -919,7 +919,7 @@ public partial class Toplevel : View
 
     private void FocusNearestView (IEnumerable<View> views, NavigationDirection direction)
     {
-        if (views == null)
+        if (views is null)
         {
             return;
         }
@@ -964,7 +964,7 @@ public partial class Toplevel : View
 
     private View GetDeepestFocusedSubview (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return null;
         }
@@ -1002,12 +1002,12 @@ public partial class Toplevel : View
 
     private void MoveNextViewOrTop ()
     {
-        if (Application.OverlappedTop == null)
+        if (Application.OverlappedTop is null)
         {
             Toplevel top = Modal ? this : Application.Top;
             top.FocusNext ();
 
-            if (top.Focused == null)
+            if (top.Focused is null)
             {
                 top.FocusNext ();
             }
@@ -1043,12 +1043,12 @@ public partial class Toplevel : View
 
     private void MovePreviousViewOrTop ()
     {
-        if (Application.OverlappedTop == null)
+        if (Application.OverlappedTop is null)
         {
             Toplevel top = Modal ? this : Application.Top;
             top.FocusPrev ();
 
-            if (top.Focused == null)
+            if (top.Focused is null)
             {
                 top.FocusPrev ();
             }
@@ -1097,12 +1097,12 @@ public class ToplevelEqualityComparer : IEqualityComparer<Toplevel>
     /// <returns><see langword="true"/> if the specified objects are equal; otherwise, <see langword="false"/>.</returns>
     public bool Equals (Toplevel x, Toplevel y)
     {
-        if (y == null && x == null)
+        if (y is null && x is null)
         {
             return true;
         }
 
-        if (x == null || y == null)
+        if (x is null || y is null)
         {
             return false;
         }
@@ -1124,7 +1124,7 @@ public class ToplevelEqualityComparer : IEqualityComparer<Toplevel>
     /// </exception>
     public int GetHashCode (Toplevel obj)
     {
-        if (obj == null)
+        if (obj is null)
         {
             throw new ArgumentNullException ();
         }
@@ -1165,12 +1165,12 @@ public sealed class ToplevelComparer : IComparer<Toplevel>
             return 0;
         }
 
-        if (x == null)
+        if (x is null)
         {
             return -1;
         }
 
-        if (y == null)
+        if (y is null)
         {
             return 1;
         }

+ 3 - 3
Terminal.Gui/Views/ToplevelOverlapped.cs

@@ -77,7 +77,7 @@ public static partial class Application
     /// <returns>The matched view.</returns>
     public static Toplevel GetTopOverlappedChild (Type type = null, string [] exclude = null)
     {
-        if (OverlappedTop == null)
+        if (OverlappedTop is null)
         {
             return null;
         }
@@ -186,7 +186,7 @@ public static partial class Application
 
     private static bool OverlappedChildNeedsDisplay ()
     {
-        if (OverlappedTop == null)
+        if (OverlappedTop is null)
         {
             return false;
         }
@@ -206,7 +206,7 @@ public static partial class Application
 
     private static bool SetCurrentOverlappedAsTop ()
     {
-        if (OverlappedTop == null && Current != Top && Current?.SuperView == null && Current?.Modal == false)
+        if (OverlappedTop is null && Current != Top && Current?.SuperView is null && Current?.Modal == false)
         {
             Top = Current;
 

+ 5 - 5
Terminal.Gui/Views/TreeView/Branch.cs

@@ -49,7 +49,7 @@ internal class Branch<T> where T : class
     public bool CanExpand ()
     {
         // if we do not know the children yet
-        if (ChildBranches == null)
+        if (ChildBranches is null)
         {
             //if there is a rapid method for determining whether there are children
             if (tree.TreeBuilder.SupportsCanExpand)
@@ -252,7 +252,7 @@ internal class Branch<T> where T : class
     /// <summary>Expands the current branch if possible.</summary>
     public void Expand ()
     {
-        if (ChildBranches == null)
+        if (ChildBranches is null)
         {
             FetchChildren ();
         }
@@ -266,7 +266,7 @@ internal class Branch<T> where T : class
     /// <summary>Fetch the children of this branch. This method populates <see cref="ChildBranches"/>.</summary>
     public virtual void FetchChildren ()
     {
-        if (tree.TreeBuilder == null)
+        if (tree.TreeBuilder is null)
         {
             return;
         }
@@ -331,7 +331,7 @@ internal class Branch<T> where T : class
 
         // we don't want to loose the state of our children so lets be selective about how we refresh
         //if we don't know about any children yet just use the normal method
-        if (ChildBranches == null)
+        if (ChildBranches is null)
         {
             FetchChildren ();
         }
@@ -521,7 +521,7 @@ internal class Branch<T> where T : class
     /// <returns></returns>
     private bool IsLast ()
     {
-        if (Parent == null)
+        if (Parent is null)
         {
             return this == tree.roots.Values.LastOrDefault ();
         }

+ 16 - 16
Terminal.Gui/Views/TreeView/TreeView.cs

@@ -35,7 +35,7 @@ public class TreeView : TreeView<ITreeNode>
     public TreeView ()
     {
         TreeBuilder = new TreeNodeBuilder ();
-        AspectGetter = o => o == null ? "Null" : o.Text ?? o?.ToString () ?? "Unamed Node";
+        AspectGetter = o => o is null ? "Null" : o.Text ?? o?.ToString () ?? "Unamed Node";
     }
 }
 
@@ -526,7 +526,7 @@ public class TreeView<T> : View, ITreeView where T : class
             multiSelectedRegions.Clear ();
         }
 
-        if (SelectedObject == null)
+        if (SelectedObject is null)
         {
             SelectedObject = roots.Keys.FirstOrDefault ();
         }
@@ -577,7 +577,7 @@ public class TreeView<T> : View, ITreeView where T : class
     {
         T o = SelectedObject;
 
-        if (o == null)
+        if (o is null)
         {
             return;
         }
@@ -619,7 +619,7 @@ public class TreeView<T> : View, ITreeView where T : class
     {
         T o = SelectedObject;
 
-        if (o == null)
+        if (o is null)
         {
             return;
         }
@@ -755,7 +755,7 @@ public class TreeView<T> : View, ITreeView where T : class
     /// <param name="toExpand">The object to expand.</param>
     public void Expand (T toExpand)
     {
-        if (toExpand == null)
+        if (toExpand is null)
         {
             return;
         }
@@ -769,7 +769,7 @@ public class TreeView<T> : View, ITreeView where T : class
     /// <param name="toExpand">The object to expand.</param>
     public void ExpandAll (T toExpand)
     {
-        if (toExpand == null)
+        if (toExpand is null)
         {
             return;
         }
@@ -832,7 +832,7 @@ public class TreeView<T> : View, ITreeView where T : class
     {
         Branch<T> branch = ObjectToBranch (o);
 
-        if (branch == null || !branch.IsExpanded)
+        if (branch is null || !branch.IsExpanded)
         {
             return new T [0];
         }
@@ -949,7 +949,7 @@ public class TreeView<T> : View, ITreeView where T : class
     /// <param name="toSelect"></param>
     public void GoTo (T toSelect)
     {
-        if (ObjectToBranch (toSelect) == null)
+        if (ObjectToBranch (toSelect) is null)
         {
             return;
         }
@@ -1052,7 +1052,7 @@ public class TreeView<T> : View, ITreeView where T : class
             // The line they clicked on a branch
             Branch<T> clickedBranch = HitTest (me.Y);
 
-            if (clickedBranch == null)
+            if (clickedBranch is null)
             {
                 return false;
             }
@@ -1102,7 +1102,7 @@ public class TreeView<T> : View, ITreeView where T : class
             // The line they clicked on a branch
             Branch<T> clickedBranch = HitTest (me.Y);
 
-            if (clickedBranch == null)
+            if (clickedBranch is null)
             {
                 return false;
             }
@@ -1141,12 +1141,12 @@ public class TreeView<T> : View, ITreeView where T : class
     ///<inheritdoc/>
     public override void OnDrawContent (Rect contentArea)
     {
-        if (roots == null)
+        if (roots is null)
         {
             return;
         }
 
-        if (TreeBuilder == null)
+        if (TreeBuilder is null)
         {
             Move (0, 0);
             Driver.AddStr (NoBuilderError);
@@ -1181,7 +1181,7 @@ public class TreeView<T> : View, ITreeView where T : class
     {
         Application.Driver.SetCursorVisibility (DesiredCursorVisibility);
 
-        if (SelectedObject == null && Objects.Any ())
+        if (SelectedObject is null && Objects.Any ())
         {
             SelectedObject = Objects.First ();
         }
@@ -1369,7 +1369,7 @@ public class TreeView<T> : View, ITreeView where T : class
     /// <param name="all"></param>
     protected void CollapseImpl (T toCollapse, bool all)
     {
-        if (toCollapse == null)
+        if (toCollapse is null)
         {
             return;
         }
@@ -1377,7 +1377,7 @@ public class TreeView<T> : View, ITreeView where T : class
         Branch<T> branch = ObjectToBranch (toCollapse);
 
         // Nothing to collapse
-        if (branch == null)
+        if (branch is null)
         {
             return;
         }
@@ -1391,7 +1391,7 @@ public class TreeView<T> : View, ITreeView where T : class
             branch.Collapse ();
         }
 
-        if (SelectedObject != null && ObjectToBranch (SelectedObject) == null)
+        if (SelectedObject != null && ObjectToBranch (SelectedObject) is null)
         {
             // If the old selection suddenly became invalid then clear it
             SelectedObject = null;

+ 3 - 3
Terminal.Gui/Views/Wizard/Wizard.cs

@@ -247,7 +247,7 @@ public class Wizard : Dialog
     {
         LinkedListNode<WizardStep> step = null;
 
-        if (CurrentStep == null)
+        if (CurrentStep is null)
         {
             // Get first step, assume it is next
             step = _steps.First;
@@ -289,7 +289,7 @@ public class Wizard : Dialog
     {
         LinkedListNode<WizardStep> step = null;
 
-        if (CurrentStep == null)
+        if (CurrentStep is null)
         {
             // Get last step, assume it is previous
             step = _steps.Last;
@@ -532,7 +532,7 @@ public class Wizard : Dialog
 
     private void UpdateButtonsAndTitle ()
     {
-        if (CurrentStep == null)
+        if (CurrentStep is null)
         {
             return;
         }

+ 1 - 1
Terminal.Gui/Views/Wizard/WizardStep.cs

@@ -143,7 +143,7 @@ public class WizardStep : FrameView
     /// <remarks></remarks>
     public override void Remove (View view)
     {
-        if (view == null)
+        if (view is null)
         {
             return;
         }