From 2a4b6b4417cea092b7985d215cf0cb2d49b9ee66 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 00:21:39 +0100 Subject: [PATCH 1/3] Enable nullable: System.Management.Automation.Host.IHostUISupportsMultipleChoiceSelection --- .../engine/hostifaces/MshHostUserInterface.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs index caaaa17a9ac..7f2dd06f1c4 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs @@ -1196,6 +1196,8 @@ public void Dispose() private bool _disposed = false; } +#nullable enable + /// /// This interface needs to be implemented by PSHost objects that want to support PromptForChoice /// by giving the user ability to select more than one choice. The PromptForChoice method available @@ -1225,10 +1227,12 @@ public interface IHostUISupportsMultipleChoiceSelection /// implementation. /// /// - Collection PromptForChoice(string caption, string message, - Collection choices, IEnumerable defaultChoices); + Collection PromptForChoice(string? caption, string? message, + Collection choices, IEnumerable? defaultChoices); } +#nullable restore + /// /// Helper methods used by PowerShell's Hosts: ConsoleHost and InternalHost to process /// PromptForChoice. From 8c916ad7d2e7548780080d4a3a4c89e637881a1a Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 18:55:45 +0100 Subject: [PATCH 2/3] Removing whitespace before/after nullable pragma --- .../engine/hostifaces/MshHostUserInterface.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs index 7f2dd06f1c4..83cd11423d8 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs @@ -1197,7 +1197,6 @@ public void Dispose() } #nullable enable - /// /// This interface needs to be implemented by PSHost objects that want to support PromptForChoice /// by giving the user ability to select more than one choice. The PromptForChoice method available @@ -1230,7 +1229,6 @@ public interface IHostUISupportsMultipleChoiceSelection Collection PromptForChoice(string? caption, string? message, Collection choices, IEnumerable? defaultChoices); } - #nullable restore /// From a08f3aed835da5e3bbecde6c50777cfb0acee716 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 20 Nov 2020 19:39:46 +0100 Subject: [PATCH 3/3] Removing whitespace before/after nullable pragma --- .../engine/hostifaces/MshHostUserInterface.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs index 83cd11423d8..9f235262b06 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs @@ -1196,12 +1196,12 @@ public void Dispose() private bool _disposed = false; } -#nullable enable /// /// This interface needs to be implemented by PSHost objects that want to support PromptForChoice /// by giving the user ability to select more than one choice. The PromptForChoice method available /// in PSHostUserInterface class supports only one choice selection. /// +#nullable enable public interface IHostUISupportsMultipleChoiceSelection { ///