Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ internal class AsyncResultCompleteEventArgs : AsyncResultEventArgsBase
/// <param name="cancellationDisposable"></param>
public AsyncResultCompleteEventArgs(
CimSession session,
IObservable<object> observable) :
base(session, observable, AsyncResultType.Completion)
IObservable<object> observable)
: base(session, observable, AsyncResultType.Completion)
{
}
}
Expand All @@ -137,8 +137,8 @@ internal class AsyncResultObjectEventArgs : AsyncResultEventArgsBase
public AsyncResultObjectEventArgs(
CimSession session,
IObservable<object> observable,
object resultObject) :
base(session, observable, AsyncResultType.Result)
object resultObject)
: base(session, observable, AsyncResultType.Result)
{
this.resultObject = resultObject;
}
Expand All @@ -162,8 +162,8 @@ internal class AsyncResultErrorEventArgs : AsyncResultEventArgsBase
public AsyncResultErrorEventArgs(
CimSession session,
IObservable<object> observable,
Exception error) :
base(session, observable, AsyncResultType.Exception)
Exception error)
: base(session, observable, AsyncResultType.Exception)
{
this.error = error;
}
Expand All @@ -179,8 +179,8 @@ public AsyncResultErrorEventArgs(
CimSession session,
IObservable<object> observable,
Exception error,
CimResultContext cimResultContext) :
base(session, observable, AsyncResultType.Exception, cimResultContext)
CimResultContext cimResultContext)
: base(session, observable, AsyncResultType.Exception, cimResultContext)
{
this.error = error;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ public SwitchParameter Continuous
FrenchCultureId, new List<Tuple<char, char>>()
{
// 'APOSTROPHE' to 'RIGHT SINGLE QUOTATION MARK'
new Tuple<char, char>((char) 0x0027, (char) 0x2019),
new Tuple<char, char>((char)0x0027, (char)0x2019),
// 'MODIFIER LETTER APOSTROPHE' to 'RIGHT SINGLE QUOTATION MARK'
new Tuple<char, char>((char) 0x02BC, (char) 0x2019),
new Tuple<char, char>((char)0x02BC, (char)0x2019),
// 'HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT' to 'RIGHT SINGLE QUOTATION MARK'
new Tuple<char, char>((char) 0x275C, (char) 0x2019),
new Tuple<char, char>((char)0x275C, (char)0x2019),
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -2637,8 +2636,7 @@ protected override void ProcessRecord()
if (isCurrentLocationOrAncestor)
{
PSInvalidOperationException invalidOperation =
(PSInvalidOperationException)
PSTraceSource.NewInvalidOperationException(
(PSInvalidOperationException)PSTraceSource.NewInvalidOperationException(
NavigationResources.RemoveItemInUse,
resolvedPath.Path);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 5 additions & 9 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -2870,31 +2870,27 @@ private class ConsoleHostStartupException : Exception
{
internal
ConsoleHostStartupException()
:
base()
: base()
{
}

internal
ConsoleHostStartupException(string message)
:
base(message)
: base(message)
{
}

protected
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)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ namespace Microsoft.PowerShell
/// </summary>
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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public class FormatTableLoadException : RuntimeException
/// <summary>
/// This is the default constructor.
/// </summary>
public FormatTableLoadException() : base()
public FormatTableLoadException()
: base()
{
SetDefaultErrorRecord();
}
Expand All @@ -43,7 +44,8 @@ public FormatTableLoadException() : base()
/// <param name="message">
/// A localized error message.
/// </param>
public FormatTableLoadException(string message) : base(message)
public FormatTableLoadException(string message)
: base(message)
{
SetDefaultErrorRecord();
}
Expand All @@ -70,8 +72,8 @@ public FormatTableLoadException(string message, Exception innerException)
/// <param name="loadErrors">
/// The errors that occured
/// </param>
internal FormatTableLoadException(ConcurrentBag<string> loadErrors) :
base(StringUtil.Format(FormatAndOutXmlLoadingStrings.FormatTableLoadErrors))
internal FormatTableLoadException(ConcurrentBag<string> loadErrors)
: base(StringUtil.Format(FormatAndOutXmlLoadingStrings.FormatTableLoadErrors))
{
_errors = new Collection<string>(loadErrors.ToArray());
SetDefaultErrorRecord();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
};

Expand Down
36 changes: 28 additions & 8 deletions src/System.Management.Automation/engine/EventManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1895,9 +1895,17 @@ internal PSEventSubscriber(ExecutionContext context, int id, object source,
/// Creates an instance of the PSEventSubscriber
/// class. Additionally supports an Action scriptblock.
/// </summary>
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)
Expand All @@ -1924,9 +1932,17 @@ internal void RegisterJob()
/// Creates an instance of the PSEventSubscriber
/// class. Additionally supports an Action scriptblock.
/// </summary>
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;
}
Expand Down Expand Up @@ -2456,8 +2472,12 @@ public class PSEventJob : Job
/// The name of the job
/// </param>
/// </summary>
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));
Expand Down
Loading