mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Enable nullable: System.Management.Automation.ICommandRuntime (#15566)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System.Management.Automation.Host;
|
||||
|
||||
namespace System.Management.Automation
|
||||
@@ -26,7 +28,7 @@ namespace System.Management.Automation
|
||||
/// <summary>
|
||||
/// Returns an instance of the PSHost implementation for this environment.
|
||||
/// </summary>
|
||||
PSHost Host { get; }
|
||||
PSHost? Host { get; }
|
||||
#region Write
|
||||
/// <summary>
|
||||
/// Display debug information.
|
||||
@@ -65,7 +67,7 @@ namespace System.Management.Automation
|
||||
/// When the cmdlet wants to write a single object out, it will call this
|
||||
/// API. It is up to the implementation to decide what to do with these objects.
|
||||
/// </remarks>
|
||||
void WriteObject(object sendToPipeline);
|
||||
void WriteObject(object? sendToPipeline);
|
||||
|
||||
/// <summary>
|
||||
/// Called to write one or more objects to the output pipe.
|
||||
@@ -83,7 +85,7 @@ namespace System.Management.Automation
|
||||
/// When the cmdlet wants to write multiple objects out, it will call this
|
||||
/// API. It is up to the implementation to decide what to do with these objects.
|
||||
/// </remarks>
|
||||
void WriteObject(object sendToPipeline, bool enumerateCollection);
|
||||
void WriteObject(object? sendToPipeline, bool enumerateCollection);
|
||||
|
||||
/// <summary>
|
||||
/// Called by the cmdlet to display progress information.
|
||||
@@ -219,7 +221,7 @@ namespace System.Management.Automation
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldProcess(string,string,string, out ShouldProcessReason)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldContinue(string,string)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldContinue(string,string,ref bool,ref bool)"/>
|
||||
bool ShouldProcess(string target);
|
||||
bool ShouldProcess(string? target);
|
||||
|
||||
/// <summary>
|
||||
/// Called by a cmdlet to confirm the operation with the user. Cmdlets which make changes
|
||||
@@ -265,7 +267,7 @@ namespace System.Management.Automation
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldProcess(string,string,string, out ShouldProcessReason)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldContinue(string,string)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldContinue(string,string,ref bool,ref bool)"/>
|
||||
bool ShouldProcess(string target, string action);
|
||||
bool ShouldProcess(string? target, string? action);
|
||||
|
||||
/// <summary>
|
||||
/// Called by a cmdlet to confirm the operation with the user. Cmdlets which make changes
|
||||
@@ -319,7 +321,7 @@ namespace System.Management.Automation
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldProcess(string,string,string, out ShouldProcessReason)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldContinue(string,string)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldContinue(string,string,ref bool,ref bool)"/>
|
||||
bool ShouldProcess(string verboseDescription, string verboseWarning, string caption);
|
||||
bool ShouldProcess(string? verboseDescription, string? verboseWarning, string? caption);
|
||||
|
||||
/// <summary>
|
||||
/// Called by a cmdlet to confirm the operation with the user. Cmdlets which make changes
|
||||
@@ -379,7 +381,7 @@ namespace System.Management.Automation
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldProcess(string,string,string)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldContinue(string,string)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldContinue(string,string,ref bool,ref bool)"/>
|
||||
bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason);
|
||||
bool ShouldProcess(string? verboseDescription, string? verboseWarning, string? caption, out ShouldProcessReason shouldProcessReason);
|
||||
|
||||
/// <summary>
|
||||
/// Called by a cmdlet to confirm an operation or grouping of operations with the user.
|
||||
@@ -436,7 +438,7 @@ namespace System.Management.Automation
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldProcess(string)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldProcess(string,string)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldProcess(string,string,string)"/>
|
||||
bool ShouldContinue(string query, string caption);
|
||||
bool ShouldContinue(string? query, string? caption);
|
||||
|
||||
/// <summary>
|
||||
/// Called to confirm an operation or grouping of operations with the user.
|
||||
@@ -501,7 +503,7 @@ namespace System.Management.Automation
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldProcess(string)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldProcess(string,string)"/>
|
||||
/// <seealso cref="System.Management.Automation.ICommandRuntime.ShouldProcess(string,string,string)"/>
|
||||
bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll);
|
||||
bool ShouldContinue(string? query, string? caption, ref bool yesToAll, ref bool noToAll);
|
||||
|
||||
#endregion Should
|
||||
|
||||
@@ -515,7 +517,7 @@ namespace System.Management.Automation
|
||||
/// Gets an object that surfaces the current PowerShell transaction.
|
||||
/// When this object is disposed, PowerShell resets the active transaction.
|
||||
/// </summary>
|
||||
PSTransactionContext CurrentPSTransaction { get; }
|
||||
PSTransactionContext? CurrentPSTransaction { get; }
|
||||
#endregion Transaction Support
|
||||
|
||||
#region Misc
|
||||
@@ -561,7 +563,6 @@ namespace System.Management.Automation
|
||||
/// execute an instance of a Cmdlet. ICommandRuntime2 extends the ICommandRuntime interface
|
||||
/// by adding support for the informational data stream.
|
||||
/// </summary>
|
||||
#nullable enable
|
||||
public interface ICommandRuntime2 : ICommandRuntime
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user