diff --git a/.globalconfig b/.globalconfig index f0cc41c388e..f4d807cbe44 100644 --- a/.globalconfig +++ b/.globalconfig @@ -1022,7 +1022,7 @@ dotnet_diagnostic.SA1001.severity = none dotnet_diagnostic.SA1002.severity = warning # SA1003: Symbols should be spaced correctly -dotnet_diagnostic.SA1003.severity = none +dotnet_diagnostic.SA1003.severity = warning # SA1004: Documentation lines should begin with single space dotnet_diagnostic.SA1004.severity = none diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs index 5e548a405ac..c27c7493ddb 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs @@ -115,8 +115,8 @@ internal class AsyncResultCompleteEventArgs : AsyncResultEventArgsBase /// public AsyncResultCompleteEventArgs( CimSession session, - IObservable observable) : - base(session, observable, AsyncResultType.Completion) + IObservable observable) + : base(session, observable, AsyncResultType.Completion) { } } @@ -137,8 +137,8 @@ internal class AsyncResultObjectEventArgs : AsyncResultEventArgsBase public AsyncResultObjectEventArgs( CimSession session, IObservable observable, - object resultObject) : - base(session, observable, AsyncResultType.Result) + object resultObject) + : base(session, observable, AsyncResultType.Result) { this.resultObject = resultObject; } @@ -162,8 +162,8 @@ internal class AsyncResultErrorEventArgs : AsyncResultEventArgsBase public AsyncResultErrorEventArgs( CimSession session, IObservable observable, - Exception error) : - base(session, observable, AsyncResultType.Exception) + Exception error) + : base(session, observable, AsyncResultType.Exception) { this.error = error; } @@ -179,8 +179,8 @@ public AsyncResultErrorEventArgs( CimSession session, IObservable observable, Exception error, - CimResultContext cimResultContext) : - base(session, observable, AsyncResultType.Exception, cimResultContext) + CimResultContext cimResultContext) + : base(session, observable, AsyncResultType.Exception, cimResultContext) { this.error = error; } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs index 89afe3a3837..a4d73ae8156 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs @@ -164,11 +164,11 @@ public SwitchParameter Continuous FrenchCultureId, new List>() { // 'APOSTROPHE' to 'RIGHT SINGLE QUOTATION MARK' - new Tuple((char) 0x0027, (char) 0x2019), + new Tuple((char)0x0027, (char)0x2019), // 'MODIFIER LETTER APOSTROPHE' to 'RIGHT SINGLE QUOTATION MARK' - new Tuple((char) 0x02BC, (char) 0x2019), + new Tuple((char)0x02BC, (char)0x2019), // 'HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT' to 'RIGHT SINGLE QUOTATION MARK' - new Tuple((char) 0x275C, (char) 0x2019), + new Tuple((char)0x275C, (char)0x2019), } } }; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs index 6528e8394c2..df89a5eb2aa 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs @@ -1609,8 +1609,7 @@ protected override void ProcessRecord() if (!Force && drive == SessionState.Drive.Current) { PSInvalidOperationException invalidOperation = - (PSInvalidOperationException) - PSTraceSource.NewInvalidOperationException( + (PSInvalidOperationException)PSTraceSource.NewInvalidOperationException( NavigationResources.RemoveDriveInUse, drive.Name); @@ -2637,8 +2636,7 @@ protected override void ProcessRecord() if (isCurrentLocationOrAncestor) { PSInvalidOperationException invalidOperation = - (PSInvalidOperationException) - PSTraceSource.NewInvalidOperationException( + (PSInvalidOperationException)PSTraceSource.NewInvalidOperationException( NavigationResources.RemoveItemInUse, resolvedPath.Path); @@ -3012,8 +3010,7 @@ private void MoveItem(string path, bool literalPath = false) if (!InvokeProvider.Item.Exists(path, currentContext)) { PSInvalidOperationException invalidOperation = - (PSInvalidOperationException) - PSTraceSource.NewInvalidOperationException( + (PSInvalidOperationException)PSTraceSource.NewInvalidOperationException( NavigationResources.MoveItemDoesntExist, path); @@ -3099,8 +3096,7 @@ private void MoveItem(string path, bool literalPath = false) if (isCurrentLocationOrAncestor) { PSInvalidOperationException invalidOperation = - (PSInvalidOperationException) - PSTraceSource.NewInvalidOperationException( + (PSInvalidOperationException)PSTraceSource.NewInvalidOperationException( NavigationResources.MoveItemInUse, path); @@ -3354,8 +3350,7 @@ private void RenameItem(string path, bool literalPath = false) if (!InvokeProvider.Item.Exists(path, currentContext)) { PSInvalidOperationException invalidOperation = - (PSInvalidOperationException) - PSTraceSource.NewInvalidOperationException( + (PSInvalidOperationException)PSTraceSource.NewInvalidOperationException( NavigationResources.RenameItemDoesntExist, path); @@ -3441,8 +3436,7 @@ private void RenameItem(string path, bool literalPath = false) if (isCurrentLocationOrAncestor) { PSInvalidOperationException invalidOperation = - (PSInvalidOperationException) - PSTraceSource.NewInvalidOperationException( + (PSInvalidOperationException)PSTraceSource.NewInvalidOperationException( NavigationResources.RenamedItemInUse, path); diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs index c2458fabb5e..a157964c637 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs @@ -551,8 +551,7 @@ internal static void RemoveBreakHandler() { var handle = NativeMethods.CreateFile( "CONIN$", - (UInt32) - (NativeMethods.AccessQualifiers.GenericRead | NativeMethods.AccessQualifiers.GenericWrite), + (UInt32)(NativeMethods.AccessQualifiers.GenericRead | NativeMethods.AccessQualifiers.GenericWrite), (UInt32)NativeMethods.ShareModes.ShareRead, (IntPtr)0, (UInt32)NativeMethods.CreationDisposition.OpenExisting, @@ -2171,8 +2170,7 @@ private static void ReadConsoleOutputPlain { for (int c = atContentsCol; c < bufferSize.X + atContentsCol; c++, characterBufferIndex++) { - contents[r, c].Character = (char) - characterBuffer[characterBufferIndex].UnicodeChar; + contents[r, c].Character = (char)characterBuffer[characterBufferIndex].UnicodeChar; ConsoleColor fgColor, bgColor; WORDToColor(characterBuffer[characterBufferIndex].Attributes, out fgColor, diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs index d12f4385eaa..9de877ba46c 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs @@ -124,7 +124,7 @@ internal static int Start(string bannerText, string helpText) try { string profileDir = Platform.CacheDirectory; -#if ! UNIX +#if !UNIX if (!Directory.Exists(profileDir)) { Directory.CreateDirectory(profileDir); @@ -2870,15 +2870,13 @@ private class ConsoleHostStartupException : Exception { internal ConsoleHostStartupException() - : - base() + : base() { } internal ConsoleHostStartupException(string message) - : - base(message) + : base(message) { } @@ -2886,15 +2884,13 @@ private class ConsoleHostStartupException : Exception ConsoleHostStartupException( System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) - : - base(info, context) + : base(info, context) { } internal ConsoleHostStartupException(string message, Exception innerException) - : - base(message, innerException) + : base(message, innerException) { } } diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs index 7313a40e139..97a02cb7123 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs @@ -13,8 +13,7 @@ class ConsoleTextWriter : TextWriter { internal ConsoleTextWriter(ConsoleHostUserInterface ui) - : - base(System.Globalization.CultureInfo.CurrentCulture) + : base(System.Globalization.CultureInfo.CurrentCulture) { Dbg.Assert(ui != null, "ui needs a value"); diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs index 165d1993bef..438ea03c669 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs @@ -47,8 +47,7 @@ namespace Microsoft.PowerShell /// internal ProgressNode(Int64 sourceId, ProgressRecord record) - : - base(record.ActivityId, record.Activity, record.StatusDescription) + : base(record.ActivityId, record.Activity, record.StatusDescription) { Dbg.Assert(record.RecordType == ProgressRecordType.Processing, "should only create node for Processing records"); diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs index 0c97ba3c095..4c1fb4fa4e9 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs @@ -58,8 +58,7 @@ class WrappedSerializer : Serialization { internal WrappedSerializer(DataFormat dataFormat, string streamName, TextWriter output) - : - base(dataFormat, streamName) + : base(dataFormat, streamName) { Dbg.Assert(output != null, "output should have a value"); @@ -147,8 +146,7 @@ class WrappedDeserializer : Serialization { internal WrappedDeserializer(DataFormat dataFormat, string streamName, TextReader input) - : - base(dataFormat, streamName) + : base(dataFormat, streamName) { Dbg.Assert(input != null, "input should have a value"); diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs index 3ad6f649c87..43cab48d003 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs @@ -32,7 +32,8 @@ public class FormatTableLoadException : RuntimeException /// /// This is the default constructor. /// - public FormatTableLoadException() : base() + public FormatTableLoadException() + : base() { SetDefaultErrorRecord(); } @@ -43,7 +44,8 @@ public FormatTableLoadException() : base() /// /// A localized error message. /// - public FormatTableLoadException(string message) : base(message) + public FormatTableLoadException(string message) + : base(message) { SetDefaultErrorRecord(); } @@ -70,8 +72,8 @@ public FormatTableLoadException(string message, Exception innerException) /// /// The errors that occured /// - internal FormatTableLoadException(ConcurrentBag loadErrors) : - base(StringUtil.Format(FormatAndOutXmlLoadingStrings.FormatTableLoadErrors)) + internal FormatTableLoadException(ConcurrentBag loadErrors) + : base(StringUtil.Format(FormatAndOutXmlLoadingStrings.FormatTableLoadErrors)) { _errors = new Collection(loadErrors.ToArray()); SetDefaultErrorRecord(); diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs index b68288ff9ab..8c1c251f149 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs @@ -1122,9 +1122,9 @@ private FormatToken LoadFormatTokenFromObjectModel(CustomItemBase item, int view { frameInfoDefinition = { - leftIndentation = (int) frame.LeftIndent, - rightIndentation = (int) frame.RightIndent, - firstLine = frame.FirstLineHanging != 0 ? -(int) frame.FirstLineHanging : (int) frame.FirstLineIndent + leftIndentation = (int)frame.LeftIndent, + rightIndentation = (int)frame.RightIndent, + firstLine = frame.FirstLineHanging != 0 ? -(int)frame.FirstLineHanging : (int)frame.FirstLineIndent } }; diff --git a/src/System.Management.Automation/engine/EventManager.cs b/src/System.Management.Automation/engine/EventManager.cs index 4afde8a9913..fd30298669e 100644 --- a/src/System.Management.Automation/engine/EventManager.cs +++ b/src/System.Management.Automation/engine/EventManager.cs @@ -1895,9 +1895,17 @@ internal PSEventSubscriber(ExecutionContext context, int id, object source, /// Creates an instance of the PSEventSubscriber /// class. Additionally supports an Action scriptblock. /// - internal PSEventSubscriber(ExecutionContext context, int id, object source, - string eventName, string sourceIdentifier, ScriptBlock action, bool supportEvent, bool forwardEvent, int maxTriggerCount) : - this(context, id, source, eventName, sourceIdentifier, supportEvent, forwardEvent, maxTriggerCount) + internal PSEventSubscriber( + ExecutionContext context, + int id, + object source, + string eventName, + string sourceIdentifier, + ScriptBlock action, + bool supportEvent, + bool forwardEvent, + int maxTriggerCount) + : this(context, id, source, eventName, sourceIdentifier, supportEvent, forwardEvent, maxTriggerCount) { // Create the bound scriptblock, and job. if (action != null) @@ -1924,9 +1932,17 @@ internal void RegisterJob() /// Creates an instance of the PSEventSubscriber /// class. Additionally supports an Action scriptblock. /// - internal PSEventSubscriber(ExecutionContext context, int id, object source, - string eventName, string sourceIdentifier, PSEventReceivedEventHandler handlerDelegate, bool supportEvent, bool forwardEvent, int maxTriggerCount) : - this(context, id, source, eventName, sourceIdentifier, supportEvent, forwardEvent, maxTriggerCount) + internal PSEventSubscriber( + ExecutionContext context, + int id, + object source, + string eventName, + string sourceIdentifier, + PSEventReceivedEventHandler handlerDelegate, + bool supportEvent, + bool forwardEvent, + int maxTriggerCount) + : this(context, id, source, eventName, sourceIdentifier, supportEvent, forwardEvent, maxTriggerCount) { HandlerDelegate = handlerDelegate; } @@ -2456,8 +2472,12 @@ public class PSEventJob : Job /// The name of the job /// /// - public PSEventJob(PSEventManager eventManager, PSEventSubscriber subscriber, ScriptBlock action, string name) : - base(action?.ToString(), name) + public PSEventJob( + PSEventManager eventManager, + PSEventSubscriber subscriber, + ScriptBlock action, + string name) + : base(action?.ToString(), name) { if (eventManager == null) throw new ArgumentNullException(nameof(eventManager)); diff --git a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs index 3c6e23369bc..ac99127ab29 100644 --- a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs +++ b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs @@ -18,7 +18,8 @@ public class ExtendedTypeSystemException : RuntimeException /// Initializes a new instance of ExtendedTypeSystemException with the message set /// to typeof(ExtendedTypeSystemException).FullName. /// - public ExtendedTypeSystemException() : base(typeof(ExtendedTypeSystemException).FullName) + public ExtendedTypeSystemException() + : base(typeof(ExtendedTypeSystemException).FullName) { } @@ -26,7 +27,8 @@ public ExtendedTypeSystemException() : base(typeof(ExtendedTypeSystemException). /// Initializes a new instance of ExtendedTypeSystemException setting the message. /// /// The exception's message. - public ExtendedTypeSystemException(string message) : base(message) + public ExtendedTypeSystemException(string message) + : base(message) { } @@ -35,7 +37,8 @@ public ExtendedTypeSystemException(string message) : base(message) /// /// The exception's message. /// The exceptions's inner exception. - public ExtendedTypeSystemException(string message, Exception innerException) : base(message, innerException) + public ExtendedTypeSystemException(string message, Exception innerException) + : base(message, innerException) { } @@ -46,9 +49,14 @@ public ExtendedTypeSystemException(string message, Exception innerException) : b /// The inner exception, null for none. /// Resource string. /// Arguments to the resource string. - internal ExtendedTypeSystemException(string errorId, Exception innerException, string resourceString, - params object[] arguments) : - base(StringUtil.Format(resourceString, arguments), innerException) + internal ExtendedTypeSystemException( + string errorId, + Exception innerException, + string resourceString, + params object[] arguments) + : base( + StringUtil.Format(resourceString, arguments), + innerException) { SetErrorId(errorId); } @@ -86,7 +94,8 @@ public class MethodException : ExtendedTypeSystemException /// Initializes a new instance of MethodException with the message set /// to typeof(MethodException).FullName. /// - public MethodException() : base(typeof(MethodException).FullName) + public MethodException() + : base(typeof(MethodException).FullName) { } @@ -94,7 +103,8 @@ public MethodException() : base(typeof(MethodException).FullName) /// Initializes a new instance of MethodException setting the message. /// /// The exception's message. - public MethodException(string message) : base(message) + public MethodException(string message) + : base(message) { } @@ -103,7 +113,8 @@ public MethodException(string message) : base(message) /// /// The exception's message. /// The exceptions's inner exception. - public MethodException(string message, Exception innerException) : base(message, innerException) + public MethodException(string message, Exception innerException) + : base(message, innerException) { } @@ -114,9 +125,12 @@ public MethodException(string message, Exception innerException) : base(message, /// The inner exception. /// Resource string. /// Arguments to the resource string. - internal MethodException(string errorId, Exception innerException, - string resourceString, params object[] arguments) : - base(errorId, innerException, resourceString, arguments) + internal MethodException( + string errorId, + Exception innerException, + string resourceString, + params object[] arguments) + : base(errorId, innerException, resourceString, arguments) { } @@ -151,7 +165,8 @@ public class MethodInvocationException : MethodException /// Initializes a new instance of MethodInvocationException with the message set /// to typeof(MethodInvocationException).FullName. /// - public MethodInvocationException() : base(typeof(MethodInvocationException).FullName) + public MethodInvocationException() + : base(typeof(MethodInvocationException).FullName) { } @@ -159,7 +174,8 @@ public MethodInvocationException() : base(typeof(MethodInvocationException).Full /// Initializes a new instance of MethodInvocationException setting the message. /// /// The exception's message. - public MethodInvocationException(string message) : base(message) + public MethodInvocationException(string message) + : base(message) { } @@ -168,7 +184,8 @@ public MethodInvocationException(string message) : base(message) /// /// The exception's message. /// The exceptions's inner exception. - public MethodInvocationException(string message, Exception innerException) : base(message, innerException) + public MethodInvocationException(string message, Exception innerException) + : base(message, innerException) { } @@ -179,9 +196,12 @@ public MethodInvocationException(string message, Exception innerException) : bas /// The inner exception. /// Resource string. /// Arguments to the resource string. - internal MethodInvocationException(string errorId, Exception innerException, - string resourceString, params object[] arguments) : - base(errorId, innerException, resourceString, arguments) + internal MethodInvocationException( + string errorId, + Exception innerException, + string resourceString, + params object[] arguments) + : base(errorId, innerException, resourceString, arguments) { } @@ -192,7 +212,7 @@ internal MethodInvocationException(string errorId, Exception innerException, /// Serialization information. /// Streaming context. protected MethodInvocationException(SerializationInfo info, StreamingContext context) - : base(info, context) + : base(info, context) { } #endregion Serialization @@ -214,7 +234,8 @@ public class GetValueException : ExtendedTypeSystemException /// Initializes a new instance of GetValueException with the message set /// to typeof(GetValueException).FullName. /// - public GetValueException() : base(typeof(GetValueException).FullName) + public GetValueException() + : base(typeof(GetValueException).FullName) { } @@ -222,7 +243,8 @@ public GetValueException() : base(typeof(GetValueException).FullName) /// Initializes a new instance of GetValueException setting the message. /// /// The exception's message. - public GetValueException(string message) : base(message) + public GetValueException(string message) + : base(message) { } @@ -231,7 +253,8 @@ public GetValueException(string message) : base(message) /// /// The exception's message. /// The exceptions's inner exception. - public GetValueException(string message, Exception innerException) : base(message, innerException) + public GetValueException(string message, Exception innerException) + : base(message, innerException) { } @@ -242,9 +265,12 @@ public GetValueException(string message, Exception innerException) : base(messag /// The inner exception. /// Resource string. /// Arguments to the resource string. - internal GetValueException(string errorId, Exception innerException, - string resourceString, params object[] arguments) : - base(errorId, innerException, resourceString, arguments) + internal GetValueException( + string errorId, + Exception innerException, + string resourceString, + params object[] arguments) + : base(errorId, innerException, resourceString, arguments) { } @@ -255,7 +281,7 @@ internal GetValueException(string errorId, Exception innerException, /// Serialization information. /// Streaming context. protected GetValueException(SerializationInfo info, StreamingContext context) - : base(info, context) + : base(info, context) { } #endregion Serialization @@ -306,9 +332,12 @@ public PropertyNotFoundException(string message, Exception innerException) /// The inner exception. /// Resource string. /// Arguments to the resource string. - internal PropertyNotFoundException(string errorId, Exception innerException, - string resourceString, params object[] arguments) : - base(errorId, innerException, resourceString, arguments) + internal PropertyNotFoundException( + string errorId, + Exception innerException, + string resourceString, + params object[] arguments) + : base(errorId, innerException, resourceString, arguments) { } @@ -341,7 +370,8 @@ public class GetValueInvocationException : GetValueException /// Initializes a new instance of GetValueInvocationException with the message set /// to typeof(GetValueInvocationException).FullName. /// - public GetValueInvocationException() : base(typeof(GetValueInvocationException).FullName) + public GetValueInvocationException() + : base(typeof(GetValueInvocationException).FullName) { } @@ -349,7 +379,8 @@ public GetValueInvocationException() : base(typeof(GetValueInvocationException). /// Initializes a new instance of GetValueInvocationException setting the message. /// /// The exception's message. - public GetValueInvocationException(string message) : base(message) + public GetValueInvocationException(string message) + : base(message) { } @@ -358,7 +389,8 @@ public GetValueInvocationException(string message) : base(message) /// /// The exception's message. /// The exceptions's inner exception. - public GetValueInvocationException(string message, Exception innerException) : base(message, innerException) + public GetValueInvocationException(string message, Exception innerException) + : base(message, innerException) { } @@ -369,9 +401,12 @@ public GetValueInvocationException(string message, Exception innerException) : b /// The inner exception. /// Resource string. /// Arguments to the resource string. - internal GetValueInvocationException(string errorId, Exception innerException, - string resourceString, params object[] arguments) : - base(errorId, innerException, resourceString, arguments) + internal GetValueInvocationException( + string errorId, + Exception innerException, + string resourceString, + params object[] arguments) + : base(errorId, innerException, resourceString, arguments) { } @@ -382,7 +417,7 @@ internal GetValueInvocationException(string errorId, Exception innerException, /// Serialization information. /// Streaming context. protected GetValueInvocationException(SerializationInfo info, StreamingContext context) - : base(info, context) + : base(info, context) { } #endregion Serialization @@ -402,7 +437,8 @@ public class SetValueException : ExtendedTypeSystemException /// Initializes a new instance of SetValueException with the message set /// to typeof(SetValueException).FullName. /// - public SetValueException() : base(typeof(SetValueException).FullName) + public SetValueException() + : base(typeof(SetValueException).FullName) { } @@ -410,7 +446,8 @@ public SetValueException() : base(typeof(SetValueException).FullName) /// Initializes a new instance of SetValueException setting the message. /// /// The exception's message. - public SetValueException(string message) : base(message) + public SetValueException(string message) + : base(message) { } @@ -419,7 +456,8 @@ public SetValueException(string message) : base(message) /// /// The exception's message. /// The exceptions's inner exception. - public SetValueException(string message, Exception innerException) : base(message, innerException) + public SetValueException(string message, Exception innerException) + : base(message, innerException) { } @@ -430,9 +468,12 @@ public SetValueException(string message, Exception innerException) : base(messag /// The inner exception. /// Resource string. /// Arguments to the resource string. - internal SetValueException(string errorId, Exception innerException, - string resourceString, params object[] arguments) : - base(errorId, innerException, resourceString, arguments) + internal SetValueException( + string errorId, + Exception innerException, + string resourceString, + params object[] arguments) + : base(errorId, innerException, resourceString, arguments) { } @@ -443,7 +484,7 @@ internal SetValueException(string errorId, Exception innerException, /// Serialization information. /// Streaming context. protected SetValueException(SerializationInfo info, StreamingContext context) - : base(info, context) + : base(info, context) { } #endregion Serialization @@ -463,7 +504,8 @@ public class SetValueInvocationException : SetValueException /// Initializes a new instance of SetValueInvocationException with the message set /// to typeof(SetValueInvocationException).FullName. /// - public SetValueInvocationException() : base(typeof(SetValueInvocationException).FullName) + public SetValueInvocationException() + : base(typeof(SetValueInvocationException).FullName) { } @@ -471,7 +513,8 @@ public SetValueInvocationException() : base(typeof(SetValueInvocationException). /// Initializes a new instance of SetValueInvocationException setting the message. /// /// The exception's message. - public SetValueInvocationException(string message) : base(message) + public SetValueInvocationException(string message) + : base(message) { } @@ -480,7 +523,8 @@ public SetValueInvocationException(string message) : base(message) /// /// The exception's message. /// The exceptions's inner exception. - public SetValueInvocationException(string message, Exception innerException) : base(message, innerException) + public SetValueInvocationException(string message, Exception innerException) + : base(message, innerException) { } @@ -491,9 +535,12 @@ public SetValueInvocationException(string message, Exception innerException) : b /// The inner exception. /// Resource string. /// Arguments to the resource string. - internal SetValueInvocationException(string errorId, Exception innerException, - string resourceString, params object[] arguments) : - base(errorId, innerException, resourceString, arguments) + internal SetValueInvocationException( + string errorId, + Exception innerException, + string resourceString, + params object[] arguments) + : base(errorId, innerException, resourceString, arguments) { } @@ -504,7 +551,7 @@ internal SetValueInvocationException(string errorId, Exception innerException, /// Serialization information. /// Streaming context. protected SetValueInvocationException(SerializationInfo info, StreamingContext context) - : base(info, context) + : base(info, context) { } #endregion Serialization @@ -542,7 +589,8 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont /// /// Serialization information. /// Streaming context. - protected PSInvalidCastException(SerializationInfo info, StreamingContext context) : base(info, context) + protected PSInvalidCastException(SerializationInfo info, StreamingContext context) + : base(info, context) { _errorId = info.GetString("ErrorId"); } @@ -553,14 +601,16 @@ protected PSInvalidCastException(SerializationInfo info, StreamingContext contex /// Initializes a new instance of PSInvalidCastException with the message set /// to typeof(PSInvalidCastException).FullName. /// - public PSInvalidCastException() : base(typeof(PSInvalidCastException).FullName) + public PSInvalidCastException() + : base(typeof(PSInvalidCastException).FullName) { } /// /// Initializes a new instance of PSInvalidCastException setting the message. /// /// The exception's message. - public PSInvalidCastException(string message) : base(message) + public PSInvalidCastException(string message) + : base(message) { } /// @@ -568,7 +618,8 @@ public PSInvalidCastException(string message) : base(message) /// /// The exception's message. /// The exceptions's inner exception. - public PSInvalidCastException(string message, Exception innerException) : base(message, innerException) + public PSInvalidCastException(string message, Exception innerException) + : base(message, innerException) { } @@ -578,8 +629,14 @@ internal PSInvalidCastException(string errorId, string message, Exception innerE _errorId = errorId; } - internal PSInvalidCastException(string errorId, Exception innerException, string resourceString, params object[] arguments) - : this(errorId, StringUtil.Format(resourceString, arguments), innerException) + internal PSInvalidCastException( + string errorId, + Exception innerException, + string resourceString, + params object[] arguments) + : this( + errorId, StringUtil.Format(resourceString, arguments), + innerException) { } diff --git a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs index bf2e76501cc..30036e035e2 100644 --- a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs +++ b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs @@ -662,8 +662,7 @@ private static string QuoteModules(IEnumerable moduleSpecs, StreamWriter streamW continue; } - ModuleSpecification moduleSpecification = (ModuleSpecification) - LanguagePrimitives.ConvertTo( + ModuleSpecification moduleSpecification = (ModuleSpecification)LanguagePrimitives.ConvertTo( spec, typeof(ModuleSpecification), CultureInfo.InvariantCulture); diff --git a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs index 2a686578e48..b8a89b9b31f 100644 --- a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs @@ -1204,8 +1204,7 @@ internal void RemoveDrive( else { PSInvalidOperationException e = - (PSInvalidOperationException) - PSTraceSource.NewInvalidOperationException( + (PSInvalidOperationException)PSTraceSource.NewInvalidOperationException( SessionStateStrings.DriveRemovalPreventedByProvider, drive.Name, drive.Provider); diff --git a/src/System.Management.Automation/engine/interpreter/InstructionList.cs b/src/System.Management.Automation/engine/interpreter/InstructionList.cs index 972c3f8635c..3c810d186e0 100644 --- a/src/System.Management.Automation/engine/interpreter/InstructionList.cs +++ b/src/System.Management.Automation/engine/interpreter/InstructionList.cs @@ -1086,9 +1086,9 @@ internal static Instruction CreateDynamicInstruction(Type delegateType, CallSite return new DynamicInstructionN(delegateType, CallSite.Create(delegateType, binder)); } - factory = - (Func) - instructionType.GetMethod("Factory").CreateDelegate(typeof(Func)); + factory = (Func)instructionType + .GetMethod("Factory") + .CreateDelegate(typeof(Func)); s_factories[delegateType] = factory; } diff --git a/src/System.Management.Automation/engine/parser/Position.cs b/src/System.Management.Automation/engine/parser/Position.cs index 5e967e432b6..54f4c3eccbe 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -646,8 +646,8 @@ public ScriptPosition( int scriptLineNumber, int offsetInLine, string line, - string fullScript) : - this(scriptName, scriptLineNumber, offsetInLine, line) + string fullScript) + : this(scriptName, scriptLineNumber, offsetInLine, line) { _fullScript = fullScript; } diff --git a/src/System.Management.Automation/engine/remoting/client/Job.cs b/src/System.Management.Automation/engine/remoting/client/Job.cs index 8e876902c26..2e6614fa376 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job.cs @@ -1742,8 +1742,7 @@ internal class PSRemotingJob : Job [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal PSRemotingJob(string[] computerNames, List computerNameHelpers, string remoteCommand, string name) - : - this(computerNames, computerNameHelpers, remoteCommand, 0, name) + : this(computerNames, computerNameHelpers, remoteCommand, 0, name) { } /// @@ -1760,8 +1759,7 @@ internal PSRemotingJob(string[] computerNames, /// internal PSRemotingJob(PSSession[] remoteRunspaceInfos, List runspaceHelpers, string remoteCommand, string name) - : - this(remoteRunspaceInfos, runspaceHelpers, remoteCommand, 0, name) + : this(remoteRunspaceInfos, runspaceHelpers, remoteCommand, 0, name) { } /// diff --git a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs index 7c0771d94b3..0de48ff6dfc 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs @@ -32,7 +32,8 @@ public OriginInfo OriginInfo /// /// The error record that is wrapped. /// Origin information. - public RemotingErrorRecord(ErrorRecord errorRecord, OriginInfo originInfo) : this(errorRecord, originInfo, null) { } + public RemotingErrorRecord(ErrorRecord errorRecord, OriginInfo originInfo) + : this(errorRecord, originInfo, null) { } /// /// Constructor that is used to wrap an error record. @@ -40,8 +41,11 @@ public RemotingErrorRecord(ErrorRecord errorRecord, OriginInfo originInfo) : thi /// /// /// - private RemotingErrorRecord(ErrorRecord errorRecord, OriginInfo originInfo, Exception replaceParentContainsErrorRecordException) : - base(errorRecord, replaceParentContainsErrorRecordException) + private RemotingErrorRecord( + ErrorRecord errorRecord, + OriginInfo originInfo, + Exception replaceParentContainsErrorRecordException) + : base(errorRecord, replaceParentContainsErrorRecordException) { if (errorRecord != null) { @@ -123,8 +127,11 @@ public OriginInfo OriginInfo /// /// The progress record that is wrapped. /// Origin information. - public RemotingProgressRecord(ProgressRecord progressRecord, OriginInfo originInfo) : - base(Validate(progressRecord).ActivityId, Validate(progressRecord).Activity, Validate(progressRecord).StatusDescription) + public RemotingProgressRecord(ProgressRecord progressRecord, OriginInfo originInfo) + : base( + Validate(progressRecord).ActivityId, + Validate(progressRecord).Activity, + Validate(progressRecord).StatusDescription) { _originInfo = originInfo; if (progressRecord != null) @@ -169,7 +176,8 @@ public OriginInfo OriginInfo /// /// The warning message that is wrapped. /// The origin information. - public RemotingWarningRecord(string message, OriginInfo originInfo) : base(message) + public RemotingWarningRecord(string message, OriginInfo originInfo) + : base(message) { _originInfo = originInfo; } @@ -210,7 +218,8 @@ public OriginInfo OriginInfo /// /// The debug message that is wrapped. /// The origin information. - public RemotingDebugRecord(string message, OriginInfo originInfo) : base(message) + public RemotingDebugRecord(string message, OriginInfo originInfo) + : base(message) { _originInfo = originInfo; } @@ -238,7 +247,8 @@ public OriginInfo OriginInfo /// /// The verbose message that is wrapped. /// The origin information. - public RemotingVerboseRecord(string message, OriginInfo originInfo) : base(message) + public RemotingVerboseRecord(string message, OriginInfo originInfo) + : base(message) { _originInfo = originInfo; } diff --git a/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs b/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs index ede18c5a8b7..c791d728809 100644 --- a/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs +++ b/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs @@ -161,8 +161,12 @@ internal RemotePipeline(RemoteRunspace runspace) /// Pipeline to clone from. /// This constructor is private because this will /// only be called from the copy method - private RemotePipeline(RemotePipeline pipeline) : - this((RemoteRunspace)pipeline.Runspace, null, false, pipeline.IsNested) + private RemotePipeline(RemotePipeline pipeline) + : this( + (RemoteRunspace)pipeline.Runspace, + command: null, + addToHistory: false, + pipeline.IsNested) { _isSteppable = pipeline._isSteppable; diff --git a/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs b/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs index 6f520e0ac26..7593bbcc3b0 100644 --- a/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs +++ b/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs @@ -1141,9 +1141,8 @@ private RemoteSessionNamedPipeClient() /// /// Target process object for pipe. /// AppDomain name or null for default AppDomain. - public RemoteSessionNamedPipeClient( - System.Diagnostics.Process process, string appDomainName) : - this(NamedPipeUtils.CreateProcessPipeName(process, appDomainName)) + public RemoteSessionNamedPipeClient(System.Diagnostics.Process process, string appDomainName) + : this(NamedPipeUtils.CreateProcessPipeName(process, appDomainName)) { } /// @@ -1151,9 +1150,8 @@ public RemoteSessionNamedPipeClient( /// /// Target process Id for pipe. /// AppDomain name or null for default AppDomain. - public RemoteSessionNamedPipeClient( - int procId, string appDomainName) : - this(NamedPipeUtils.CreateProcessPipeName(procId, appDomainName)) + public RemoteSessionNamedPipeClient(int procId, string appDomainName) + : this(NamedPipeUtils.CreateProcessPipeName(procId, appDomainName)) { } /// diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index 9debc89ce76..54dfd640049 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -829,8 +829,21 @@ public WSManConnectionInfo(string scheme, string computerName, int port, string /// max server life timeout and open timeout are /// default in this case [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", Scope = "member", Target = "System.Management.Automation.Runspaces.WSManConnectionInfo.#.ctor(System.String,System.String,System.Int32,System.String,System.String,System.Management.Automation.PSCredential)", MessageId = "4#")] - public WSManConnectionInfo(string scheme, string computerName, int port, string appName, string shellUri, PSCredential credential) : - this(scheme, computerName, port, appName, shellUri, credential, DefaultOpenTimeout) + public WSManConnectionInfo( + string scheme, + string computerName, + int port, + string appName, + string shellUri, + PSCredential credential) + : this( + scheme, + computerName, + port, + appName, + shellUri, + credential, + DefaultOpenTimeout) { } @@ -844,9 +857,20 @@ public WSManConnectionInfo(string scheme, string computerName, int port, string /// /// [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "4#")] - public WSManConnectionInfo(bool useSsl, string computerName, int port, string appName, string shellUri, - PSCredential credential) : - this(useSsl ? DefaultSslScheme : DefaultScheme, computerName, port, appName, shellUri, credential) + public WSManConnectionInfo( + bool useSsl, + string computerName, + int port, + string appName, + string shellUri, + PSCredential credential) + : this( + useSsl ? DefaultSslScheme : DefaultScheme, + computerName, + port, + appName, + shellUri, + credential) { } @@ -860,8 +884,22 @@ public WSManConnectionInfo(bool useSsl, string computerName, int port, string ap /// /// [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "4#")] - public WSManConnectionInfo(bool useSsl, string computerName, int port, string appName, string shellUri, PSCredential credential, int openTimeout) : - this(useSsl ? DefaultSslScheme : DefaultScheme, computerName, port, appName, shellUri, credential, openTimeout) + public WSManConnectionInfo( + bool useSsl, + string computerName, + int port, + string appName, + string shellUri, + PSCredential credential, + int openTimeout) + : this( + useSsl ? DefaultSslScheme : DefaultScheme, + computerName, + port, + appName, + shellUri, + credential, + openTimeout) { } @@ -1700,9 +1738,8 @@ public NamedPipeConnectionInfo() /// Initializes a new instance of the class. /// /// Process Id to connect to. - public NamedPipeConnectionInfo( - int processId) : - this(processId, string.Empty, _defaultOpenTimeout) + public NamedPipeConnectionInfo(int processId) + : this(processId, string.Empty, _defaultOpenTimeout) { } /// @@ -1710,10 +1747,8 @@ public NamedPipeConnectionInfo( /// /// Process Id to connect to. /// Application domain name to connect to, or default AppDomain if blank. - public NamedPipeConnectionInfo( - int processId, - string appDomainName) : - this(processId, appDomainName, _defaultOpenTimeout) + public NamedPipeConnectionInfo(int processId, string appDomainName) + : this(processId, appDomainName, _defaultOpenTimeout) { } /// @@ -1736,9 +1771,8 @@ public NamedPipeConnectionInfo( /// Initializes a new instance of the class. /// /// Pipe name to connect to. - public NamedPipeConnectionInfo( - string customPipeName) : - this(customPipeName, _defaultOpenTimeout) + public NamedPipeConnectionInfo(string customPipeName) + : this(customPipeName, _defaultOpenTimeout) { } /// @@ -2288,7 +2322,7 @@ private static string[] ParseArgv(ProcessStartInfo psi) var argsToParse = String.Join(" ", psi.ArgumentList).Trim(); var argsLength = argsToParse.Length; - for (int i=0; i /// /// - public PSStreamObject(PSStreamObjectType objectType, object value) : - this(objectType, value, Guid.Empty) + public PSStreamObject(PSStreamObjectType objectType, object value) + : this(objectType, value, Guid.Empty) { } diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs index 20db6a1dd1d..99b2d4848bd 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs @@ -558,9 +558,12 @@ static WSManClientSessionTransportManager() /// /// 1. Create Session failed with a non-zero error code. /// - internal WSManClientSessionTransportManager(Guid runspacePoolInstanceId, + internal WSManClientSessionTransportManager( + Guid runspacePoolInstanceId, WSManConnectionInfo connectionInfo, - PSRemotingCryptoHelper cryptoHelper, string sessionName) : base(runspacePoolInstanceId, cryptoHelper) + PSRemotingCryptoHelper cryptoHelper, + string sessionName) + : base(runspacePoolInstanceId, cryptoHelper) { // Initialize WSMan instance WSManAPIData = new WSManAPIDataCommon(); @@ -2912,12 +2915,13 @@ static WSManClientCommandTransportManager() /// Session transport manager creating this command transport manager instance. /// Used by Command TM to apply session specific properties /// - internal WSManClientCommandTransportManager(WSManConnectionInfo connectionInfo, + internal WSManClientCommandTransportManager( + WSManConnectionInfo connectionInfo, IntPtr wsManShellOperationHandle, ClientRemotePowerShell shell, bool noInput, - WSManClientSessionTransportManager sessnTM) : - base(shell, sessnTM.CryptoHelper, sessnTM) + WSManClientSessionTransportManager sessnTM) + : base(shell, sessnTM.CryptoHelper, sessnTM) { Dbg.Assert(wsManShellOperationHandle != IntPtr.Zero, "Shell operation handle cannot be IntPtr.Zero."); Dbg.Assert(connectionInfo != null, "connectionInfo cannot be null"); diff --git a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs index 97625a9e46a..eb482834553 100644 --- a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs +++ b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs @@ -535,8 +535,8 @@ public partial class ScriptBlock : ISerializable { private readonly CompiledScriptBlockData _scriptBlockData; - internal ScriptBlock(IParameterMetadataProvider ast, bool isFilter) : - this(new CompiledScriptBlockData(ast, isFilter)) + internal ScriptBlock(IParameterMetadataProvider ast, bool isFilter) + : this(new CompiledScriptBlockData(ast, isFilter)) { } diff --git a/src/System.Management.Automation/help/HelpCategoryInvalidException.cs b/src/System.Management.Automation/help/HelpCategoryInvalidException.cs index 2ebe763d45a..d9ccee7bae6 100644 --- a/src/System.Management.Automation/help/HelpCategoryInvalidException.cs +++ b/src/System.Management.Automation/help/HelpCategoryInvalidException.cs @@ -23,7 +23,8 @@ public class HelpCategoryInvalidException : ArgumentException, IContainsErrorRec /// Initializes a new instance of the HelpCategoryInvalidException class. /// /// The name of help category that is invalid. - public HelpCategoryInvalidException(string helpCategory) : base() + public HelpCategoryInvalidException(string helpCategory) + : base() { _helpCategory = helpCategory; CreateErrorRecord(); @@ -32,7 +33,8 @@ public HelpCategoryInvalidException(string helpCategory) : base() /// /// Initializes a new instance of the HelpCategoryInvalidException class. /// - public HelpCategoryInvalidException() : base() + public HelpCategoryInvalidException() + : base() { CreateErrorRecord(); } @@ -42,8 +44,10 @@ public HelpCategoryInvalidException() : base() /// /// The name of help category that is invalid. /// The inner exception of this exception. - public HelpCategoryInvalidException(string helpCategory, Exception innerException) : - base((innerException != null) ? innerException.Message : string.Empty, innerException) + public HelpCategoryInvalidException(string helpCategory, Exception innerException) + : base( + (innerException != null) ? innerException.Message : string.Empty, + innerException) { _helpCategory = helpCategory; CreateErrorRecord(); diff --git a/src/System.Management.Automation/help/HelpNotFoundException.cs b/src/System.Management.Automation/help/HelpNotFoundException.cs index 0c546db3620..6008b4afbc1 100644 --- a/src/System.Management.Automation/help/HelpNotFoundException.cs +++ b/src/System.Management.Automation/help/HelpNotFoundException.cs @@ -22,7 +22,8 @@ public class HelpNotFoundException : SystemException, IContainsErrorRecord /// Initializes a new instance of the HelpNotFoundException class with the give help topic. /// /// The help topic for which help is not found. - public HelpNotFoundException(string helpTopic) : base() + public HelpNotFoundException(string helpTopic) + : base() { _helpTopic = helpTopic; CreateErrorRecord(); @@ -31,7 +32,8 @@ public HelpNotFoundException(string helpTopic) : base() /// /// Initializes a new instance of the HelpNotFoundException class. /// - public HelpNotFoundException() : base() + public HelpNotFoundException() + : base() { CreateErrorRecord(); } @@ -42,8 +44,10 @@ public HelpNotFoundException() : base() /// /// The help topic for which help is not found. /// The inner exception. - public HelpNotFoundException(string helpTopic, Exception innerException) : - base((innerException != null) ? innerException.Message : string.Empty, innerException) + public HelpNotFoundException(string helpTopic, Exception innerException) + : base( + (innerException != null) ? innerException.Message : string.Empty, + innerException) { _helpTopic = helpTopic; CreateErrorRecord(); diff --git a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs index 3c627542b4b..f5d299ecfd6 100644 --- a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs +++ b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs @@ -109,10 +109,26 @@ internal class FileSystemContentReaderWriter : IContentReader, IContentWriter /// Indicates raw stream. /// public FileSystemContentReaderWriter( - string path, FileMode mode, FileAccess access, - FileShare share, Encoding encoding, bool usingByteEncoding, - bool waitForChanges, CmdletProvider provider, bool isRawStream) : - this(path, null, mode, access, share, encoding, usingByteEncoding, waitForChanges, provider, isRawStream) + string path, + FileMode mode, + FileAccess access, + FileShare share, + Encoding encoding, + bool usingByteEncoding, + bool waitForChanges, + CmdletProvider provider, + bool isRawStream) + : this( + path, + streamName: null, + mode, + access, + share, + encoding, + usingByteEncoding, + waitForChanges, + provider, + isRawStream) { } diff --git a/src/System.Management.Automation/namespaces/NavigationProviderBase.cs b/src/System.Management.Automation/namespaces/NavigationProviderBase.cs index 4cb2927f179..da8a16869d1 100644 --- a/src/System.Management.Automation/namespaces/NavigationProviderBase.cs +++ b/src/System.Management.Automation/namespaces/NavigationProviderBase.cs @@ -1036,8 +1036,7 @@ private static Stack NormalizeThePath( if (!allowNonExistingPaths) { PSArgumentException e = - (PSArgumentException) - PSTraceSource.NewArgumentException( + (PSArgumentException)PSTraceSource.NewArgumentException( nameof(path), SessionStateStrings.NormalizeRelativePathOutsideBase, path, diff --git a/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs b/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs index e6050a44d5a..3f0f52c942e 100644 --- a/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs +++ b/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs @@ -708,8 +708,7 @@ protected override void NewItem(string path, string type, object newItem) if (ItemExists(path) && !Force) { PSArgumentException e = - (PSArgumentException) - PSTraceSource.NewArgumentException( + (PSArgumentException)PSTraceSource.NewArgumentException( nameof(path), SessionStateStrings.NewItemAlreadyExists, path); @@ -838,8 +837,7 @@ protected override void CopyItem(string path, string copyPath, bool recurse) else { PSArgumentException e = - (PSArgumentException) - PSTraceSource.NewArgumentException( + (PSArgumentException)PSTraceSource.NewArgumentException( nameof(path), SessionStateStrings.CopyItemDoesntExist, path); @@ -897,8 +895,7 @@ protected override void RenameItem(string name, string newName) if (ItemExists(newName) && !Force) { PSArgumentException e = - (PSArgumentException) - PSTraceSource.NewArgumentException( + (PSArgumentException)PSTraceSource.NewArgumentException( nameof(newName), SessionStateStrings.NewItemAlreadyExists, newName); @@ -984,8 +981,7 @@ protected override void RenameItem(string name, string newName) else { PSArgumentException e = - (PSArgumentException) - PSTraceSource.NewArgumentException( + (PSArgumentException)PSTraceSource.NewArgumentException( nameof(name), SessionStateStrings.RenameItemDoesntExist, name); diff --git a/src/System.Management.Automation/security/Authenticode.cs b/src/System.Management.Automation/security/Authenticode.cs index 0abdafa956c..70b6778c37e 100644 --- a/src/System.Management.Automation/security/Authenticode.cs +++ b/src/System.Management.Automation/security/Authenticode.cs @@ -543,7 +543,6 @@ private static X509Certificate2 GetCertFromChain(IntPtr pSigner) if (pCert != IntPtr.Zero) { NativeMethods.CRYPT_PROVIDER_CERT provCert = - (NativeMethods.CRYPT_PROVIDER_CERT) Marshal.PtrToStructure(pCert); signerCert = new X509Certificate2(provCert.pCert); } @@ -618,7 +617,6 @@ private static bool TryGetProviderSigner(IntPtr wvtStateData, out IntPtr pProvSi if (pProvSigner != IntPtr.Zero) { NativeMethods.CRYPT_PROVIDER_SGNR provSigner = - (NativeMethods.CRYPT_PROVIDER_SGNR) Marshal.PtrToStructure(pProvSigner); if (provSigner.csCounterSigners == 1) { diff --git a/src/System.Management.Automation/security/SecuritySupport.cs b/src/System.Management.Automation/security/SecuritySupport.cs index 809c13efb3f..eb77f2b2cb6 100644 --- a/src/System.Management.Automation/security/SecuritySupport.cs +++ b/src/System.Management.Automation/security/SecuritySupport.cs @@ -704,7 +704,6 @@ internal static Collection GetCertEKU(X509Certificate2 cert) out structSize)) { Security.NativeMethods.CERT_ENHKEY_USAGE ekuStruct = - (Security.NativeMethods.CERT_ENHKEY_USAGE) Marshal.PtrToStructure(ekuBuffer); IntPtr ep = ekuStruct.rgpszUsageIdentifier; IntPtr ekuptr; diff --git a/src/System.Management.Automation/utils/CryptoUtils.cs b/src/System.Management.Automation/utils/CryptoUtils.cs index 96877437da2..e121dd62b6d 100644 --- a/src/System.Management.Automation/utils/CryptoUtils.cs +++ b/src/System.Management.Automation/utils/CryptoUtils.cs @@ -302,7 +302,8 @@ internal uint ErrorCode /// /// Default constructor. /// - public PSCryptoException() : this(0, new StringBuilder(string.Empty)) { } + public PSCryptoException() + : this(0, new StringBuilder(string.Empty)) { } /// /// Constructor that will be used from within CryptoUtils. @@ -320,7 +321,8 @@ public PSCryptoException(uint errorCode, StringBuilder message) /// Constructor with just message but no inner exception. /// /// Error message associated with this failure. - public PSCryptoException(string message) : this(message, null) { } + public PSCryptoException(string message) + : this(message, null) { } /// /// Constructor with inner exception. @@ -329,8 +331,8 @@ public PSCryptoException(string message) : this(message, null) { } /// Inner exception. /// This constructor is currently not called /// explicitly from crypto utils - public PSCryptoException(string message, Exception innerException) : - base(message, innerException) + public PSCryptoException(string message, Exception innerException) + : base(message, innerException) { _errorCode = unchecked((uint)-1); } @@ -343,8 +345,7 @@ public PSCryptoException(string message, Exception innerException) : /// Currently no custom type-specific serialization logic is /// implemented protected PSCryptoException(SerializationInfo info, StreamingContext context) - : - base(info, context) + : base(info, context) { _errorCode = unchecked(0xFFFFFFF); Dbg.Assert(false, "type-specific serialization logic not implemented and so this constructor should not be called"); diff --git a/src/System.Management.Automation/utils/HostInterfacesExceptions.cs b/src/System.Management.Automation/utils/HostInterfacesExceptions.cs index c70a007d0f1..91e742fa3c5 100644 --- a/src/System.Management.Automation/utils/HostInterfacesExceptions.cs +++ b/src/System.Management.Automation/utils/HostInterfacesExceptions.cs @@ -19,8 +19,8 @@ class HostException : RuntimeException /// Initializes a new instance of the HostException class. /// public - HostException() : base( - StringUtil.Format(HostInterfaceExceptionsStrings.DefaultCtorMessageTemplate, typeof(HostException).FullName)) + HostException() + : base(StringUtil.Format(HostInterfaceExceptionsStrings.DefaultCtorMessageTemplate, typeof(HostException).FullName)) { SetDefaultErrorRecord(); } @@ -32,7 +32,8 @@ class HostException : RuntimeException /// The error message that explains the reason for the exception. /// public - HostException(string message) : base(message) + HostException(string message) + : base(message) { SetDefaultErrorRecord(); } @@ -79,8 +80,12 @@ class HostException : RuntimeException /// Intentionally public, third-party hosts can call this /// public - HostException(string message, Exception innerException, string errorId, ErrorCategory errorCategory) : - base(message, innerException) + HostException( + string message, + Exception innerException, + string errorId, + ErrorCategory errorCategory) + : base(message, innerException) { SetErrorId(errorId); SetErrorCategory(errorCategory); @@ -125,7 +130,8 @@ class PromptingException : HostException /// Initializes a new instance of the PromptingException class. /// public - PromptingException() : base(StringUtil.Format(HostInterfaceExceptionsStrings.DefaultCtorMessageTemplate, typeof(PromptingException).FullName)) + PromptingException() + : base(StringUtil.Format(HostInterfaceExceptionsStrings.DefaultCtorMessageTemplate, typeof(PromptingException).FullName)) { SetDefaultErrorRecord(); } @@ -137,7 +143,8 @@ class PromptingException : HostException /// The error message that explains the reason for the exception. /// public - PromptingException(string message) : base(message) + PromptingException(string message) + : base(message) { SetDefaultErrorRecord(); } @@ -184,8 +191,12 @@ class PromptingException : HostException /// Intentionally public, third-party hosts can call this /// public - PromptingException(string message, Exception innerException, string errorId, ErrorCategory errorCategory) : - base(message, innerException, errorId, errorCategory) + PromptingException( + string message, + Exception innerException, + string errorId, + ErrorCategory errorCategory) + : base(message, innerException, errorId, errorCategory) { } diff --git a/src/System.Management.Automation/utils/MetadataExceptions.cs b/src/System.Management.Automation/utils/MetadataExceptions.cs index ebdbddc3325..53f2328fc3d 100644 --- a/src/System.Management.Automation/utils/MetadataExceptions.cs +++ b/src/System.Management.Automation/utils/MetadataExceptions.cs @@ -54,8 +54,14 @@ public MetadataException(string message, Exception innerException) : base(messag SetErrorCategory(ErrorCategory.MetadataError); } - internal MetadataException(string errorId, Exception innerException, string resourceStr, params object[] arguments) : - base(StringUtil.Format(resourceStr, arguments), innerException) + internal MetadataException( + string errorId, + Exception innerException, + string resourceStr, + params object[] arguments) + : base( + StringUtil.Format(resourceStr, arguments), + innerException) { SetErrorCategory(ErrorCategory.MetadataError); SetErrorId(errorId); @@ -121,8 +127,12 @@ public ValidationMetadataException(string message) : this(message, false) { } /// The exceptions's inner exception. public ValidationMetadataException(string message, Exception innerException) : base(message, innerException) { } - internal ValidationMetadataException(string errorId, Exception innerException, string resourceStr, params object[] arguments) : - base(errorId, innerException, resourceStr, arguments) + internal ValidationMetadataException( + string errorId, + Exception innerException, + string resourceStr, + params object[] arguments) + : base(errorId, innerException, resourceStr, arguments) { } @@ -167,26 +177,37 @@ public class ArgumentTransformationMetadataException : MetadataException /// /// Serialization information. /// Streaming context. - protected ArgumentTransformationMetadataException(SerializationInfo info, StreamingContext context) : base(info, context) { } + protected ArgumentTransformationMetadataException(SerializationInfo info, StreamingContext context) + : base(info, context) { } + /// /// Initializes a new instance of ArgumentTransformationMetadataException with the message set /// to typeof(ArgumentTransformationMetadataException).FullName. /// - public ArgumentTransformationMetadataException() : base(typeof(ArgumentTransformationMetadataException).FullName) { } + public ArgumentTransformationMetadataException() + : base(typeof(ArgumentTransformationMetadataException).FullName) { } + /// /// Initializes a new instance of ArgumentTransformationMetadataException setting the message. /// /// The exception's message. - public ArgumentTransformationMetadataException(string message) : base(message) { } + public ArgumentTransformationMetadataException(string message) + : base(message) { } + /// /// Initializes a new instance of ArgumentTransformationMetadataException setting the message and innerException. /// /// The exception's message. /// The exceptions's inner exception. - public ArgumentTransformationMetadataException(string message, Exception innerException) : base(message, innerException) { } + public ArgumentTransformationMetadataException(string message, Exception innerException) + : base(message, innerException) { } - internal ArgumentTransformationMetadataException(string errorId, Exception innerException, string resourceStr, params object[] arguments) : - base(errorId, innerException, resourceStr, arguments) + internal ArgumentTransformationMetadataException( + string errorId, + Exception innerException, + string resourceStr, + params object[] arguments) + : base(errorId, innerException, resourceStr, arguments) { } } @@ -204,26 +225,37 @@ public class ParsingMetadataException : MetadataException /// /// Serialization information. /// Streaming context. - protected ParsingMetadataException(SerializationInfo info, StreamingContext context) : base(info, context) { } + protected ParsingMetadataException(SerializationInfo info, StreamingContext context) + : base(info, context) { } + /// /// Initializes a new instance of ParsingMetadataException with the message set /// to typeof(ParsingMetadataException).FullName. /// - public ParsingMetadataException() : base(typeof(ParsingMetadataException).FullName) { } + public ParsingMetadataException() + : base(typeof(ParsingMetadataException).FullName) { } + /// /// Initializes a new instance of ParsingMetadataException setting the message. /// /// The exception's message. - public ParsingMetadataException(string message) : base(message) { } + public ParsingMetadataException(string message) + : base(message) { } + /// /// Initializes a new instance of ParsingMetadataException setting the message and innerException. /// /// The exception's message. /// The exceptions's inner exception. - public ParsingMetadataException(string message, Exception innerException) : base(message, innerException) { } + public ParsingMetadataException(string message, Exception innerException) + : base(message, innerException) { } - internal ParsingMetadataException(string errorId, Exception innerException, string resourceStr, params object[] arguments) : - base(errorId, innerException, resourceStr, arguments) + internal ParsingMetadataException( + string errorId, + Exception innerException, + string resourceStr, + params object[] arguments) + : base(errorId, innerException, resourceStr, arguments) { } } diff --git a/src/System.Management.Automation/utils/StructuredTraceSource.cs b/src/System.Management.Automation/utils/StructuredTraceSource.cs index 47b6e1b4e1d..1d6ddc30d2d 100644 --- a/src/System.Management.Automation/utils/StructuredTraceSource.cs +++ b/src/System.Management.Automation/utils/StructuredTraceSource.cs @@ -542,16 +542,14 @@ internal IDisposable TraceMethod( string methodName = GetCallingMethodNameAndParameters(1); // Create the method tracer object - return - (IDisposable) - new ScopeTracer( - this, - PSTraceSourceOptions.Method, - methodOutputFormatter, - methodLeavingFormatter, - methodName, - format, - args); + return (IDisposable)new ScopeTracer( + this, + PSTraceSourceOptions.Method, + methodOutputFormatter, + methodLeavingFormatter, + methodName, + format, + args); } catch { @@ -591,15 +589,13 @@ internal IDisposable TraceEventHandlers() string methodName = GetCallingMethodNameAndParameters(1); // Create the scope tracer object - return - (IDisposable) - new ScopeTracer( - this, - PSTraceSourceOptions.Events, - eventHandlerOutputFormatter, - eventHandlerLeavingFormatter, - methodName, - string.Empty); + return (IDisposable)new ScopeTracer( + this, + PSTraceSourceOptions.Events, + eventHandlerOutputFormatter, + eventHandlerLeavingFormatter, + methodName, + string.Empty); } catch { @@ -643,16 +639,14 @@ internal IDisposable TraceEventHandlers( string methodName = GetCallingMethodNameAndParameters(1); // Create the scope tracer object - return - (IDisposable) - new ScopeTracer( - this, - PSTraceSourceOptions.Events, - eventHandlerOutputFormatter, - eventHandlerLeavingFormatter, - methodName, - format, - args); + return (IDisposable)new ScopeTracer( + this, + PSTraceSourceOptions.Events, + eventHandlerOutputFormatter, + eventHandlerLeavingFormatter, + methodName, + format, + args); } catch { @@ -707,14 +701,12 @@ internal IDisposable TraceLock(string lockName) { try { - return - (IDisposable) - new ScopeTracer( - this, - PSTraceSourceOptions.Lock, - lockEnterFormatter, - lockLeavingFormatter, - lockName); + return (IDisposable)new ScopeTracer( + this, + PSTraceSourceOptions.Lock, + lockEnterFormatter, + lockLeavingFormatter, + lockName); } catch { diff --git a/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs b/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs index 2dc3a70c34e..011d7577239 100755 --- a/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs @@ -19,7 +19,7 @@ internal class PSSysLogProvider : LogProvider private static readonly SysLogProvider s_provider; // by default, do not include channel bits - internal const PSKeyword DefaultKeywords = (PSKeyword) (0x00FFFFFFFFFFFFFF); + internal const PSKeyword DefaultKeywords = (PSKeyword)(0x00FFFFFFFFFFFFFF); // the default enabled channel(s) internal const PSChannel DefaultChannels = PSChannel.Operational; diff --git a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs index b11481f4c1d..27d0e133fd5 100755 --- a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs @@ -103,16 +103,16 @@ public SysLogProvider(string applicationId, PSLevel level, PSKeyword keywords, P _nativeSyslogIdent = Marshal.StringToHGlobalAnsi(applicationId); NativeMethods.OpenLog(_nativeSyslogIdent, _facility); _keywordFilter = (ulong)keywords; - _levelFilter = (byte) level; - _channelFilter = (byte) channels; - if ((_channelFilter & (ulong) PSChannel.Operational) != 0) + _levelFilter = (byte)level; + _channelFilter = (byte)channels; + if ((_channelFilter & (ulong)PSChannel.Operational) != 0) { - _keywordFilter |= (ulong) PSKeyword.UseAlwaysOperational; + _keywordFilter |= (ulong)PSKeyword.UseAlwaysOperational; } - if ((_channelFilter & (ulong) PSChannel.Analytic) != 0) + if ((_channelFilter & (ulong)PSChannel.Analytic) != 0) { - _keywordFilter |= (ulong) PSKeyword.UseAlwaysAnalytic; + _keywordFilter |= (ulong)PSKeyword.UseAlwaysAnalytic; } } @@ -177,8 +177,8 @@ private static Guid Activity /// True if the specified level and keywords are enabled for logging. internal bool IsEnabled(PSLevel level, PSKeyword keywords) { - return ( ((ulong) keywords & _keywordFilter) != 0 && - ((int) level <= _levelFilter) ); + return ((ulong)keywords & _keywordFilter) != 0 + && ((int)level <= _levelFilter); } // NOTE: There are a number of places where PowerShell code sends analytic events @@ -188,8 +188,8 @@ internal bool IsEnabled(PSLevel level, PSKeyword keywords) // filtering is performed to suppress analytic events. private bool ShouldLog(PSLevel level, PSKeyword keywords, PSChannel channel) { - return ((_channelFilter & (ulong)channel) != 0 && - IsEnabled(level, keywords)); + return (_channelFilter & (ulong)channel) != 0 + && IsEnabled(level, keywords); } #region resource manager @@ -251,7 +251,7 @@ private static string GetResourceString(string resourceName) private static void GetEventMessage(StringBuilder sb, PSEventId eventId, params object[] args ) { int parameterCount; - string resourceName = EventResource.GetMessage((int) eventId, out parameterCount); + string resourceName = EventResource.GetMessage((int)eventId, out parameterCount); if (resourceName == null) { @@ -347,7 +347,7 @@ public void Log(PSEventId eventId, PSChannel channel, PSTask task, PSOpcode opco GetEventMessage(sb, eventId, args); NativeMethods.SysLogPriority priority; - if ((int) level <= _levels.Length) + if ((int)level <= _levels.Length) { priority = _levels[(int)level]; } @@ -443,97 +443,97 @@ internal enum SysLogPriority : uint /// /// Kernel messages. /// - Kernel = (0<<3), + Kernel = (0 << 3), /// /// Random user-level messages. /// - User = (1<<3), + User = (1 << 3), /// /// Mail system. /// - Mail = (2<<3), + Mail = (2 << 3), /// /// System daemons. /// - Daemon = (3<<3), + Daemon = (3 << 3), /// /// Authorization messages. /// - Authorization = (4<<3), + Authorization = (4 << 3), /// /// Messages generated internally by syslogd. /// - Syslog = (5<<3), + Syslog = (5 << 3), /// /// Line printer subsystem. /// - Lpr = (6<<3), + Lpr = (6 << 3), /// /// Network news subsystem. /// - News = (7<<3), + News = (7 << 3), /// /// UUCP subsystem. /// - Uucp = (8<<3), + Uucp = (8 << 3), /// /// Clock daemon. /// - Cron = (9<<3), + Cron = (9 << 3), /// /// Security/authorization messages (private) /// - Authpriv = (10<<3), + Authpriv = (10 << 3), /// /// FTP daemon. /// - Ftp = (11<<3), + Ftp = (11 << 3), // Reserved for system use /// /// Reserved for local use. /// - Local0 = (16<<3), + Local0 = (16 << 3), /// /// Reserved for local use. /// - Local1 = (17<<3), + Local1 = (17 << 3), /// /// Reserved for local use. /// - Local2 = (18<<3), + Local2 = (18 << 3), /// /// Reserved for local use. /// - Local3 = (19<<3), + Local3 = (19 << 3), /// /// Reserved for local use. /// - Local4 = (20<<3), + Local4 = (20 << 3), /// /// Reserved for local use. /// - Local5 = (21<<3), + Local5 = (21 << 3), /// /// Reserved for local use. /// - Local6 = (22<<3), + Local6 = (22 << 3), /// /// Reserved for local use. /// - Local7 = (23<<3), + Local7 = (23 << 3), } } } diff --git a/src/powershell/Program.cs b/src/powershell/Program.cs index c885fa7fd2e..d9dfa2f80bd 100644 --- a/src/powershell/Program.cs +++ b/src/powershell/Program.cs @@ -266,8 +266,8 @@ private static bool IsParam( // Check arg chars in order and allow prefixes for (int i = 1; i < arg.Length; i++) { - if (arg[i] != paramToCheck[i-1] - && arg[i] != paramToCheckUpper[i-1]) + if (arg[i] != paramToCheck[i - 1] + && arg[i] != paramToCheckUpper[i - 1]) { return false; } diff --git a/test/tools/TestExe/TestExe.cs b/test/tools/TestExe/TestExe.cs index 0eac8074de0..d31f61be763 100644 --- a/test/tools/TestExe/TestExe.cs +++ b/test/tools/TestExe/TestExe.cs @@ -48,7 +48,7 @@ private static void EchoArgs(string[] args) { for (int i = 1; i < args.Length; i++) { - Console.WriteLine("Arg {0} is <{1}>", i-1, args[i]); + Console.WriteLine("Arg {0} is <{1}>", i - 1, args[i]); } } diff --git a/test/tools/WebListener/Controllers/ResponseController.cs b/test/tools/WebListener/Controllers/ResponseController.cs index 6347abc98e6..903b3426b74 100644 --- a/test/tools/WebListener/Controllers/ResponseController.cs +++ b/test/tools/WebListener/Controllers/ResponseController.cs @@ -84,7 +84,7 @@ public string Index() // Content-Type must be applied right before it is sent to the client or MVC will overwrite. Response.OnStarting(state => { - var httpContext = (HttpContext) state; + var httpContext = (HttpContext)state; httpContext.Response.ContentType = contentType; return Task.FromResult(0); }, HttpContext); diff --git a/test/tools/WebListener/Controllers/ResponseHeadersController.cs b/test/tools/WebListener/Controllers/ResponseHeadersController.cs index ab6c7547571..d5bffaefb70 100644 --- a/test/tools/WebListener/Controllers/ResponseHeadersController.cs +++ b/test/tools/WebListener/Controllers/ResponseHeadersController.cs @@ -31,7 +31,7 @@ public string Index() string contentType = Request.Query[key]; Response.OnStarting(state => { - var httpContext = (HttpContext) state; + var httpContext = (HttpContext)state; httpContext.Response.ContentType = contentType; return Task.FromResult(0); }, HttpContext);