Fix SA1642 for Microsoft.PowerShell.Commands.Utility (#14142)

https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1642.md
This commit is contained in:
xtqqczze 2020-11-21 14:58:37 +00:00 committed by GitHub
parent 8691607143
commit ca21c7cdbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 73 additions and 46 deletions

View File

@ -14,7 +14,7 @@ namespace Microsoft.PowerShell.Commands
class ConsoleColorCmdlet : PSCmdlet
{
/// <summary>
/// Default ctor.
/// Initializes a new instance of the <see cref="ConsoleColorCmdlet"/> class.
/// </summary>
public ConsoleColorCmdlet()
{

View File

@ -883,7 +883,7 @@ namespace Microsoft.PowerShell.Commands
private readonly StringBuilder _outputString;
/// <summary>
/// Create ExportCsvHelper instance.
/// Initializes a new instance of the <see cref="ExportCsvHelper"/> class.
/// </summary>
/// <param name="delimiter">Delimiter char.</param>
/// <param name="quoteKind">Kind of quoting.</param>

View File

@ -38,7 +38,7 @@ namespace System.Management.Automation
private CustomInternalSerializer _serializer;
/// <summary>
/// Constructor.
/// Initializes a new instance of the <see cref="CustomSerialization"/> class.
/// </summary>
/// <param name="writer">
/// writer to be used for serialization.
@ -74,7 +74,7 @@ namespace System.Management.Automation
public static int MshDefaultSerializationDepth { get; } = 1;
/// <summary>
/// Constructor.
/// Initializes a new instance of the <see cref="CustomSerialization"/> class.
/// </summary>
/// <param name="writer">
/// writer to be used for serialization.
@ -208,7 +208,7 @@ namespace System.Management.Automation
private bool _firstobjectcall = true;
/// <summary>
/// Constructor.
/// Initializes a new instance of the <see cref="CustomInternalSerializer"/> class.
/// </summary>
/// <param name="writer">
/// Xml writer to be used.

View File

@ -51,7 +51,7 @@ namespace Microsoft.PowerShell.Commands
#region Constructors
/// <summary>
/// Constructor.
/// Initializes a new instance of the <see cref="PSRunspaceDebug"/> class.
/// </summary>
/// <param name="enabled">Enable debugger option.</param>
/// <param name="breakAll">BreakAll option.</param>

View File

@ -54,7 +54,7 @@ namespace Microsoft.PowerShell.Commands
#region Constructors
/// <summary>
/// Constructor for OutGridView.
/// Initializes a new instance of the <see cref="OutGridViewCommand"/> class.
/// </summary>
public OutGridViewCommand()
{

View File

@ -39,7 +39,7 @@ namespace Microsoft.PowerShell.Commands
private readonly GraphicalHostReflectionWrapper _graphicalHostReflectionWrapper;
/// <summary>
/// Initializes a new instance of the OutWindowProxy class.
/// Initializes a new instance of the <see cref="OutWindowProxy"/> class.
/// </summary>
internal OutWindowProxy(string title, OutputModeOption outPutMode, OutGridViewCommand parentCmdlet)
{

View File

@ -14,7 +14,8 @@ namespace Microsoft.PowerShell.Commands
public class FormatListCommand : OuterFormatTableAndListBase
{
/// <summary>
/// Constructor to set the inner command.
/// Initializes a new instance of the <see cref="FormatListCommand"/> class
/// and sets the inner command.
/// </summary>
public FormatListCommand()
{

View File

@ -14,7 +14,8 @@ namespace Microsoft.PowerShell.Commands
public class FormatCustomCommand : OuterFormatShapeCommandBase
{
/// <summary>
/// Constructor to se the inner command.
/// Initializes a new instance of the <see cref="FormatCustomCommand"/> class
/// and sets the inner command.
/// </summary>
public FormatCustomCommand()
{

View File

@ -14,7 +14,8 @@ namespace Microsoft.PowerShell.Commands
public class FormatTableCommand : OuterFormatTableBase
{
/// <summary>
/// Constructor to set the inner command.
/// Initializes a new instance of the <see cref="FormatTableCommand"/> class
/// and sets the inner command.
/// </summary>
public FormatTableCommand()
{

View File

@ -16,7 +16,8 @@ namespace Microsoft.PowerShell.Commands
public class FormatWideCommand : OuterFormatShapeCommandBase
{
/// <summary>
/// Constructor to se the inner command.
/// Initializes a new instance of the <see cref="FormatWideCommand"/> class
/// and sets the inner command.
/// </summary>
public FormatWideCommand()
{

View File

@ -25,7 +25,8 @@ namespace Microsoft.PowerShell.Commands
public class OutFileCommand : FrontEndCommandBase
{
/// <summary>
/// Set inner command.
/// Initializes a new instance of the <see cref="OutFileCommand"/> class
/// and sets the inner command.
/// </summary>
public OutFileCommand()
{

View File

@ -14,7 +14,8 @@ namespace Microsoft.PowerShell.Commands
public class OutPrinterCommand : FrontEndCommandBase
{
/// <summary>
/// Set inner command.
/// Initializes a new instance of the <see cref="OutPrinterCommand"/> class
/// and sets the inner command.
/// </summary>
public OutPrinterCommand()
{

View File

@ -70,6 +70,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
#endregion
/// <summary>
/// Initializes static members of the <see cref="PrinterLineOutput"/> class.
/// Used for static initializations like DefaultPrintFontName.
/// </summary>
static PrinterLineOutput()
@ -81,7 +82,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
}
/// <summary>
/// Constructor for the class.
/// Initializes a new instance of the <see cref="PrinterLineOutput"/> class.
/// </summary>
/// <param name="printerName">Name of printer, if null use default printer.</param>
internal PrinterLineOutput(string printerName)

View File

@ -61,7 +61,8 @@ namespace Microsoft.PowerShell.Commands
#endregion
/// <summary>
/// Set inner command.
/// Initializes a new instance of the <see cref="OutStringCommand"/> class
/// and sets the inner command.
/// </summary>
public OutStringCommand()
{

View File

@ -22,7 +22,7 @@ namespace Microsoft.PowerShell.Commands
return Definition;
}
/// <summary>
/// Initializes a new instance of this class.
/// Initializes a new instance of the <see cref="MemberDefinition"/> class.
/// </summary>
public MemberDefinition(string typeName, string name, PSMemberTypes memberType, string definition)
{

View File

@ -583,7 +583,7 @@ namespace Microsoft.PowerShell.Commands
internal class PolymorphicRandomNumberGenerator
{
/// <summary>
/// Constructor.
/// Initializes a new instance of the <see cref="PolymorphicRandomNumberGenerator"/> class.
/// </summary>
public PolymorphicRandomNumberGenerator()
{

View File

@ -27,7 +27,7 @@ namespace Microsoft.PowerShell.Commands
public sealed class GenericMeasureInfo : MeasureInfo
{
/// <summary>
/// Default ctor.
/// Initializes a new instance of the <see cref="GenericMeasureInfo"/> class.
/// </summary>
public GenericMeasureInfo()
{
@ -77,6 +77,7 @@ namespace Microsoft.PowerShell.Commands
public sealed class GenericObjectMeasureInfo : MeasureInfo
{
/// <summary>
/// Initializes a new instance of the <see cref="GenericObjectMeasureInfo"/> class.
/// Default ctor.
/// </summary>
public GenericObjectMeasureInfo()
@ -122,6 +123,7 @@ namespace Microsoft.PowerShell.Commands
public sealed class TextMeasureInfo : MeasureInfo
{
/// <summary>
/// Initializes a new instance of the <see cref="TextMeasureInfo"/> class.
/// Default ctor.
/// </summary>
public TextMeasureInfo()
@ -162,6 +164,7 @@ namespace Microsoft.PowerShell.Commands
where V : new()
{
/// <summary>
/// Initializes a new instance of the <see cref="MeasureObjectDictionary{V}"/> class.
/// Default ctor.
/// </summary>
internal MeasureObjectDictionary() : base(StringComparer.OrdinalIgnoreCase)
@ -216,6 +219,7 @@ namespace Microsoft.PowerShell.Commands
}
/// <summary>
/// Initializes a new instance of the <see cref="MeasureObjectCommand"/> class.
/// Default constructor.
/// </summary>
public MeasureObjectCommand()

View File

@ -30,7 +30,7 @@ namespace Microsoft.PowerShell.Commands
}
/// <summary>
/// ObjectCommandPropertyValue constructor.
/// Initializes a new instance of the <see cref="ObjectCommandPropertyValue"/> class.
/// </summary>
/// <param name="propVal">Property Value.</param>
/// <param name="isCaseSensitive">Indicates if the Property value comparison has to be case sensitive or not.</param>
@ -139,6 +139,7 @@ namespace Microsoft.PowerShell.Commands
internal class ObjectCommandComparer : IComparer
{
/// <summary>
/// Initializes a new instance of the <see cref="ObjectCommandComparer"/> class.
/// Constructor that doesn't set any private field.
/// Necessary because compareTo can compare two objects by calling
/// ((ICompare)obj1).CompareTo(obj2) without using a key.

View File

@ -478,7 +478,7 @@ namespace Microsoft.PowerShell.Commands
}
/// <summary>
/// OrderByProperty constructor.
/// Initializes a new instance of the <see cref="OrderByProperty"/> class.
/// </summary>
internal OrderByProperty()
{

View File

@ -20,7 +20,7 @@ namespace Microsoft.PowerShell.Commands
public sealed class ReadHostCommand : PSCmdlet
{
/// <summary>
/// Constructs a new instance.
/// Initializes a new instance of the <see cref="ReadHostCommand"/> class.
/// </summary>
public
ReadHostCommand()

View File

@ -18,7 +18,8 @@ namespace Microsoft.PowerShell.Commands
internal sealed class PSPropertyExpressionFilter
{
/// <summary>
/// Construct the class, using an array of patterns.
/// Initializes a new instance of the <see cref="PSPropertyExpressionFilter"/> class
/// with the specified array of patterns.
/// </summary>
/// <param name="wildcardPatternsStrings">Array of pattern strings to use.</param>
internal PSPropertyExpressionFilter(string[] wildcardPatternsStrings)

View File

@ -14,7 +14,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension
public class ShowCommandCommandInfo
{
/// <summary>
/// Creates an instance of the ShowCommandCommandInfo class based on a CommandInfo object.
/// Initializes a new instance of the <see cref="ShowCommandCommandInfo"/> class
/// with the specified <see cref="CommandInfo"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.
@ -62,7 +63,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension
}
/// <summary>
/// Creates an instance of the ShowCommandCommandInfo class based on a PSObject object.
/// Initializes a new instance of the <see cref="ShowCommandCommandInfo"/> class
/// with the specified <see cref="PSObject"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.

View File

@ -12,7 +12,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension
public class ShowCommandModuleInfo
{
/// <summary>
/// Creates an instance of the ShowCommandModuleInfo class based on a CommandInfo object.
/// Initializes a new instance of the <see cref="ShowCommandModuleInfo"/> class
/// with the specified <see cref="CommandInfo"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.
@ -28,7 +29,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension
}
/// <summary>
/// Creates an instance of the ShowCommandModuleInfo class based on a PSObject object.
/// Initializes a new instance of the <see cref="ShowCommandModuleInfo"/> class
/// with the specified <see cref="PSObject"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.

View File

@ -14,7 +14,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension
public class ShowCommandParameterInfo
{
/// <summary>
/// Creates an instance of the ShowCommandParameterInfo class based on a CommandParameterInfo object.
/// Initializes a new instance of the <see cref="ShowCommandParameterInfo"/> class
/// with the specified <see cref="CommandParameterInfo"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.
@ -41,6 +42,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension
}
/// <summary>
/// Initializes a new instance of the <see cref="ShowCommandParameterInfo"/> class.
/// Creates an instance of the ShowCommandParameterInfo class based on a PSObject object.
/// </summary>
/// <param name="other">

View File

@ -14,7 +14,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension
public class ShowCommandParameterSetInfo
{
/// <summary>
/// Creates an instance of the ShowCommandParameterSetInfo class based on a CommandParameterSetInfo object.
/// Initializes a new instance of the <see cref="ShowCommandParameterSetInfo"/> class
/// with the specified <see cref="CommandParameterSetInfo"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.
@ -32,7 +33,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension
}
/// <summary>
/// Creates an instance of the ShowCommandParameterSetInfo class based on a PSObject object.
/// Initializes a new instance of the <see cref="ShowCommandParameterSetInfo"/> class
/// with the specified <see cref="PSObject"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.

View File

@ -13,7 +13,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension
public class ShowCommandParameterType
{
/// <summary>
/// Creates an instance of the ShowCommandParameterType class based on a Type object.
/// Initializes a new instance of the <see cref="ShowCommandParameterType"/> class
/// with the specified <see cref="Type"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.
@ -42,7 +43,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension
}
/// <summary>
/// Creates an instance of the ShowCommandParameterType class based on a Type object.
/// Initializes a new instance of the <see cref="ShowCommandParameterType"/> class
/// with the specified <see cref="Type"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.

View File

@ -30,7 +30,7 @@ namespace Microsoft.PowerShell.Commands
#region Constructors
/// <summary>
/// Constructor for BasicHtmlWebResponseObject.
/// Initializes a new instance of the <see cref="BasicHtmlWebResponseObject"/> class.
/// </summary>
/// <param name="response"></param>
public BasicHtmlWebResponseObject(HttpResponseMessage response)
@ -38,7 +38,8 @@ namespace Microsoft.PowerShell.Commands
{ }
/// <summary>
/// Constructor for HtmlWebResponseObject with memory stream.
/// Initializes a new instance of the <see cref="BasicHtmlWebResponseObject"/> class
/// with the specified <paramref name="contentStream"/>.
/// </summary>
/// <param name="response"></param>
/// <param name="contentStream"></param>

View File

@ -863,7 +863,7 @@ namespace Microsoft.PowerShell.Commands
public sealed class HttpResponseException : HttpRequestException
{
/// <summary>
/// Constructor for HttpResponseException.
/// Initializes a new instance of the <see cref="HttpResponseException"/> class.
/// </summary>
/// <param name="message">Message for the exception.</param>
/// <param name="response">Response from the HTTP server.</param>

View File

@ -144,7 +144,7 @@ namespace Microsoft.PowerShell.Commands
#region Constructors
/// <summary>
/// Constructor for WebResponseObject.
/// Initializes a new instance of the <see cref="WebResponseObject"/> class.
/// </summary>
/// <param name="response"></param>
public WebResponseObject(HttpResponseMessage response)
@ -152,7 +152,8 @@ namespace Microsoft.PowerShell.Commands
{ }
/// <summary>
/// Constructor for WebResponseObject with contentStream.
/// Initializes a new instance of the <see cref="WebResponseObject"/> class
/// with the specified <paramref name="contentStream"/>.
/// </summary>
/// <param name="response"></param>
/// <param name="contentStream"></param>

View File

@ -18,7 +18,7 @@ namespace Microsoft.PowerShell.Commands
#region Virtual Method Overrides
/// <summary>
/// Default constructor for InvokeWebRequestCommand.
/// Initializes a new instance of the <see cref="InvokeWebRequestCommand"/> class.
/// </summary>
public InvokeWebRequestCommand() : base()
{

View File

@ -31,7 +31,7 @@ namespace Microsoft.PowerShell.Commands
public Dictionary<string, string> Fields { get; }
/// <summary>
/// Constructor for FormObject.
/// Initializes a new instance of the <see cref="FormObject"/> class.
/// </summary>
/// <param name="id"></param>
/// <param name="method"></param>

View File

@ -32,6 +32,7 @@ namespace Microsoft.PowerShell.Commands
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="WebResponseContentMemoryStream"/> class.
/// </summary>
/// <param name="stream"></param>
/// <param name="initialCapacity"></param>

View File

@ -75,7 +75,7 @@ namespace Microsoft.PowerShell.Commands
public int RetryIntervalInSeconds { get; set; }
/// <summary>
/// Construct a new instance of a WebRequestSession object.
/// Initializes a new instance of the <see cref="WebRequestSession"/> class.
/// </summary>
public WebRequestSession()
{

View File

@ -393,7 +393,7 @@ namespace Microsoft.PowerShell.Commands
public sealed class WriteErrorCommand : WriteOrThrowErrorCommand
{
/// <summary>
/// Constructor.
/// Initializes a new instance of the <see cref="WriteErrorCommand"/> class.
/// </summary>
public WriteErrorCommand()
{
@ -433,7 +433,7 @@ namespace Microsoft.PowerShell.Commands
{
#region ctor
/// <summary>
/// Constructor for class WriteErrorException.
/// Initializes a new instance of the <see cref="WriteErrorException"/> class.
/// </summary>
/// <returns>Constructed object.</returns>
public WriteErrorException()
@ -442,7 +442,7 @@ namespace Microsoft.PowerShell.Commands
}
/// <summary>
/// Constructor for class WriteErrorException.
/// Initializes a new instance of the <see cref="WriteErrorException"/> class.
/// </summary>
/// <param name="message"></param>
/// <returns>Constructed object.</returns>
@ -452,7 +452,7 @@ namespace Microsoft.PowerShell.Commands
}
/// <summary>
/// Constructor for class WriteErrorException.
/// Initializes a new instance of the <see cref="WriteErrorException"/> class.
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
@ -466,7 +466,7 @@ namespace Microsoft.PowerShell.Commands
#region Serialization
/// <summary>
/// Serialization constructor for class WriteErrorException.
/// Initializes a new instance of the <see cref="WriteErrorException"/> class for serialization.
/// </summary>
/// <param name="info">Serialization information.</param>
/// <param name="context">Streaming context.</param>

View File

@ -23,7 +23,7 @@ namespace Microsoft.PowerShell.Commands
#region TraceListener constructors and disposer
/// <summary>
/// Default constructor used if no.
/// Initializes a new instance of the <see cref="PSHostTraceListener"/> class.
/// </summary>
internal PSHostTraceListener(PSCmdlet cmdlet)
: base(string.Empty)