From f95dae55f797ea697b88d7412e763c4fb17dea98 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 8 Jan 2019 00:40:07 +0500 Subject: [PATCH] Style: Use the type aliases 'char' and 'bool' instead of 'Char' and 'Boolean' (#8572) --- .../commands/management/GetWMIObjectCommand.cs | 2 +- .../management/RegisterWMIEventCommand.cs | 2 +- .../commands/management/TestConnectionCommand.cs | 2 +- .../commands/utility/ReadConsoleCmdlet.cs | 2 +- .../WebCmdlet/Common/WebResponseObject.Common.cs | 2 +- .../commands/utility/WriteConsoleCmdlet.cs | 2 +- .../host/msh/ConsoleControl.cs | 2 +- .../host/msh/ConsoleHostUserInterface.cs | 4 ++-- .../host/msh/ConsoleHostUserInterfacePrompt.cs | 6 +++--- .../host/msh/ConsoleTextWriter.cs | 4 ++-- .../DotNetCode/Eventing/EventProvider.cs | 4 ++-- .../LocalAccounts/Extensions.cs | 2 +- src/Microsoft.WSMan.Management/WSManInstance.cs | 2 +- .../engine/ComInterop/Variant.cs | 2 +- .../engine/LanguagePrimitives.cs | 2 +- .../engine/SessionStateDriveAPIs.cs | 2 +- .../engine/interpreter/EqualInstruction.cs | 4 ++-- .../engine/interpreter/GreaterThanInstruction.cs | 4 ++-- .../engine/interpreter/LessThanInstruction.cs | 4 ++-- .../engine/interpreter/NotEqualInstruction.cs | 4 ++-- .../interpreter/NumericConvertInstruction.cs | 2 +- .../engine/lang/parserutils.cs | 2 +- .../engine/parser/DebugViewWriter.cs | 2 +- .../engine/parser/tokenizer.cs | 4 ++-- .../engine/serialization.cs | 16 ++++++++-------- .../namespaces/FileSystemProvider.cs | 10 +++++----- 26 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs index cd30d9dacb..56bd9fb2bc 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs @@ -146,7 +146,7 @@ namespace Microsoft.PowerShell.Commands StringBuilder newClassName = new StringBuilder(); for (int i = 0; i < filterClass.Length; i++) { - if (Char.IsLetterOrDigit(filterClass[i]) || + if (char.IsLetterOrDigit(filterClass[i]) || filterClass[i].Equals('[') || filterClass[i].Equals(']') || filterClass[i].Equals('*') || filterClass[i].Equals('?') || filterClass[i].Equals('-')) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs index 5ae645e0e6..5ca1e21bc2 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs @@ -108,7 +108,7 @@ namespace Microsoft.PowerShell.Commands // Validate class format for (int i = 0; i < this.Class.Length; i++) { - if (Char.IsLetterOrDigit(this.Class[i]) || this.Class[i].Equals('_')) + if (char.IsLetterOrDigit(this.Class[i]) || this.Class[i].Equals('_')) { continue; } diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs index 6ea94ab69e..19974c8891 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs @@ -19,7 +19,7 @@ namespace Microsoft.PowerShell.Commands [Cmdlet(VerbsDiagnostic.Test, "Connection", DefaultParameterSetName = ParameterSetPingCount, HelpUri = "https://go.microsoft.com/fwlink/?LinkID=135266")] [OutputType(typeof(PingReport), ParameterSetName = new string[] { ParameterSetPingCount })] [OutputType(typeof(PingReply), ParameterSetName = new string[] { ParameterSetPingContinues, ParameterSetDetectionOfMTUSize })] - [OutputType(typeof(Boolean), ParameterSetName = new string[] { ParameterSetPingCount, ParameterSetPingContinues, ParameterSetConnectionByTCPPort })] + [OutputType(typeof(bool), ParameterSetName = new string[] { ParameterSetPingCount, ParameterSetPingContinues, ParameterSetConnectionByTCPPort })] [OutputType(typeof(Int32), ParameterSetName = new string[] { ParameterSetDetectionOfMTUSize })] [OutputType(typeof(TraceRouteReply), ParameterSetName = new string[] { ParameterSetTraceRoute })] public class TestConnectionCommand : PSCmdlet diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs index 79971a5b50..49af92fffd 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs @@ -161,6 +161,6 @@ namespace Microsoft.PowerShell.Commands #endregion Cmdlet Overrides private object _prompt = null; - private Boolean _safe = false; + private bool _safe = false; } } diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs index c774d1178c..6eaa4775d7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs @@ -75,7 +75,7 @@ namespace Microsoft.PowerShell.Commands private bool IsPrintable(char c) { - return (Char.IsLetterOrDigit(c) || Char.IsPunctuation(c) || Char.IsSeparator(c) || Char.IsSymbol(c) || Char.IsWhiteSpace(c)); + return (char.IsLetterOrDigit(c) || char.IsPunctuation(c) || char.IsSeparator(c) || char.IsSymbol(c) || char.IsWhiteSpace(c)); } /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs index eb9318f430..b44ae5e1bc 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs @@ -121,6 +121,6 @@ namespace Microsoft.PowerShell.Commands this.WriteInformation(informationMessage, new string[] { "PSHOST" }); } - private Boolean _notAppendNewline = false; + private bool _notAppendNewline = false; } } diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs index 177fc5d810..b54d5b7463 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs @@ -2978,7 +2978,7 @@ namespace Microsoft.PowerShell internal static extern bool FillConsoleOutputCharacter ( NakedWin32Handle consoleOutput, - Char character, + char character, DWORD length, COORD writeCoord, out DWORD numberOfCharsWritten diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index b0e45fa235..e62ba88848 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -353,7 +353,7 @@ namespace Microsoft.PowerShell } } #if UNIX - else if (Char.IsControl(keyInfo.KeyChar)) + else if (char.IsControl(keyInfo.KeyChar)) { // blacklist control characters continue; @@ -1668,7 +1668,7 @@ namespace Microsoft.PowerShell continue; } - if (Char.IsControl(keyInfo.KeyChar)) + if (char.IsControl(keyInfo.KeyChar)) { // blacklist control characters continue; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs index 6f8ff15bb6..b82e09a8ab 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs @@ -111,7 +111,7 @@ namespace Microsoft.PowerShell { Dictionary results = new Dictionary(); - Boolean cancelInput = false; + bool cancelInput = false; if (!string.IsNullOrEmpty(caption)) { @@ -208,7 +208,7 @@ namespace Microsoft.PowerShell { fieldPromptList.Append( string.Format(CultureInfo.InvariantCulture, "{0}]: ", inputList.Count)); - Boolean inputListEnd = false; + bool inputListEnd = false; object convertedObj = null; string inputString = PromptForSingleItem(elementType, fieldPromptList.ToString(), fieldPrompt, caption, message, desc, fieldEchoOnPrompt, true, out inputListEnd, out cancelInput, out convertedObj); @@ -244,7 +244,7 @@ namespace Microsoft.PowerShell fieldPrompt); // field is not a list object convertedObj = null; - Boolean dummy = false; + bool dummy = false; PromptForSingleItem(fieldType, printFieldPrompt, fieldPrompt, caption, message, desc, fieldEchoOnPrompt, false, out dummy, out cancelInput, out convertedObj); diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs index cc4cebebc3..78f4389701 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs @@ -58,14 +58,14 @@ namespace Microsoft.PowerShell public override void - Write(Char c) + Write(char c) { this.Write(new String(c, 1)); } public override void - Write(Char[] a) + Write(char[] a) { this.Write(new String(a)); } diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs index 61fcc992fe..af302e3c2e 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs @@ -406,9 +406,9 @@ namespace System.Diagnostics.Eventing } else if (data is Boolean) { - dataDescriptor->Size = (uint)sizeof(Boolean); + dataDescriptor->Size = (uint)sizeof(bool); Boolean* booleanptr = (Boolean*)dataBuffer; - *booleanptr = (Boolean)data; + *booleanptr = (bool)data; dataDescriptor->DataPointer = (ulong)booleanptr; } else diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs index b811cb3df1..d492336bd6 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs @@ -33,7 +33,7 @@ namespace System.Management.Automation.SecurityAccountsManager.Extensions bool allowSidConstants = false) { if (!allowSidConstants) - if (!(s.Length > 2 && s.StartsWith("S-", StringComparison.Ordinal) && Char.IsDigit(s[2]))) + if (!(s.Length > 2 && s.StartsWith("S-", StringComparison.Ordinal) && char.IsDigit(s[2]))) return null; SecurityIdentifier sid = null; diff --git a/src/Microsoft.WSMan.Management/WSManInstance.cs b/src/Microsoft.WSMan.Management/WSManInstance.cs index 7ab216e571..0691403075 100644 --- a/src/Microsoft.WSMan.Management/WSManInstance.cs +++ b/src/Microsoft.WSMan.Management/WSManInstance.cs @@ -401,7 +401,7 @@ namespace Microsoft.WSMan.Management { string name; string value; - string[] Split = filter.Trim().Split(new Char[] { '=', ';' }); + string[] Split = filter.Trim().Split(new char[] { '=', ';' }); if ((Split.Length)%2 != 0) { // mismatched property name/value pair diff --git a/src/System.Management.Automation/engine/ComInterop/Variant.cs b/src/System.Management.Automation/engine/ComInterop/Variant.cs index 84c4eb5b62..90b030e009 100644 --- a/src/System.Management.Automation/engine/ComInterop/Variant.cs +++ b/src/System.Management.Automation/engine/ComInterop/Variant.cs @@ -574,7 +574,7 @@ namespace System.Management.Automation.ComInterop } // VT_BOOL - public Boolean AsBool + public bool AsBool { get { diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index 8c3a41a952..253cfd4a69 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -2123,7 +2123,7 @@ namespace System.Management.Automation sourceValue, ObjectToTypeNameString(sourceValue), destinationType); } - if (Char.IsDigit(sourceValueString[0]) || sourceValueString[0] == '+' || sourceValueString[0] == '-') + if (char.IsDigit(sourceValueString[0]) || sourceValueString[0] == '+' || sourceValueString[0] == '-') { Type underlyingType = Enum.GetUnderlyingType(destinationType); try diff --git a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs index 6333c79dd4..b2eed9aeb5 100644 --- a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs @@ -916,7 +916,7 @@ namespace System.Management.Automation { char driveChar = Convert.ToChar(drive.Name, CultureInfo.InvariantCulture); - if (Char.ToUpperInvariant(driveChar) >= 'A' && Char.ToUpperInvariant(driveChar) <= 'Z') + if (char.ToUpperInvariant(driveChar) >= 'A' && char.ToUpperInvariant(driveChar) <= 'Z') { DriveInfo systemDriveInfo = new DriveInfo(drive.Name); diff --git a/src/System.Management.Automation/engine/interpreter/EqualInstruction.cs b/src/System.Management.Automation/engine/interpreter/EqualInstruction.cs index 7c4283d04f..68c9ef1dc9 100644 --- a/src/System.Management.Automation/engine/interpreter/EqualInstruction.cs +++ b/src/System.Management.Automation/engine/interpreter/EqualInstruction.cs @@ -34,7 +34,7 @@ namespace System.Management.Automation.Interpreter { public override int Run(InterpretedFrame frame) { - frame.Push(((Boolean)frame.Pop()) == ((Boolean)frame.Pop())); + frame.Push(((bool)frame.Pop()) == ((bool)frame.Pop())); return +1; } } @@ -61,7 +61,7 @@ namespace System.Management.Automation.Interpreter { public override int Run(InterpretedFrame frame) { - frame.Push(((Char)frame.Pop()) == ((Char)frame.Pop())); + frame.Push(((char)frame.Pop()) == ((char)frame.Pop())); return +1; } } diff --git a/src/System.Management.Automation/engine/interpreter/GreaterThanInstruction.cs b/src/System.Management.Automation/engine/interpreter/GreaterThanInstruction.cs index 38a2f9319d..f5e433b8e8 100644 --- a/src/System.Management.Automation/engine/interpreter/GreaterThanInstruction.cs +++ b/src/System.Management.Automation/engine/interpreter/GreaterThanInstruction.cs @@ -53,8 +53,8 @@ namespace System.Management.Automation.Interpreter { public override int Run(InterpretedFrame frame) { - Char right = (Char)frame.Pop(); - frame.Push(((Char)frame.Pop()) > right); + char right = (char)frame.Pop(); + frame.Push(((char)frame.Pop()) > right); return +1; } } diff --git a/src/System.Management.Automation/engine/interpreter/LessThanInstruction.cs b/src/System.Management.Automation/engine/interpreter/LessThanInstruction.cs index 1d5d263eb1..971b2f7904 100644 --- a/src/System.Management.Automation/engine/interpreter/LessThanInstruction.cs +++ b/src/System.Management.Automation/engine/interpreter/LessThanInstruction.cs @@ -53,8 +53,8 @@ namespace System.Management.Automation.Interpreter { public override int Run(InterpretedFrame frame) { - Char right = (Char)frame.Pop(); - frame.Push(((Char)frame.Pop()) < right); + char right = (char)frame.Pop(); + frame.Push(((char)frame.Pop()) < right); return +1; } } diff --git a/src/System.Management.Automation/engine/interpreter/NotEqualInstruction.cs b/src/System.Management.Automation/engine/interpreter/NotEqualInstruction.cs index 4100b8f8cb..d2dc09e8fc 100644 --- a/src/System.Management.Automation/engine/interpreter/NotEqualInstruction.cs +++ b/src/System.Management.Automation/engine/interpreter/NotEqualInstruction.cs @@ -34,7 +34,7 @@ namespace System.Management.Automation.Interpreter { public override int Run(InterpretedFrame frame) { - frame.Push(((Boolean)frame.Pop()) != ((Boolean)frame.Pop())); + frame.Push(((bool)frame.Pop()) != ((bool)frame.Pop())); return +1; } } @@ -61,7 +61,7 @@ namespace System.Management.Automation.Interpreter { public override int Run(InterpretedFrame frame) { - frame.Push(((Char)frame.Pop()) != ((Char)frame.Pop())); + frame.Push(((char)frame.Pop()) != ((char)frame.Pop())); return +1; } } diff --git a/src/System.Management.Automation/engine/interpreter/NumericConvertInstruction.cs b/src/System.Management.Automation/engine/interpreter/NumericConvertInstruction.cs index eb37e13413..406d78e052 100644 --- a/src/System.Management.Automation/engine/interpreter/NumericConvertInstruction.cs +++ b/src/System.Management.Automation/engine/interpreter/NumericConvertInstruction.cs @@ -181,7 +181,7 @@ namespace System.Management.Automation.Interpreter case TypeCode.Byte: return ConvertInt32((Byte)obj); case TypeCode.SByte: return ConvertInt32((SByte)obj); case TypeCode.Int16: return ConvertInt32((Int16)obj); - case TypeCode.Char: return ConvertInt32((Char)obj); + case TypeCode.Char: return ConvertInt32((char)obj); case TypeCode.Int32: return ConvertInt32((Int32)obj); case TypeCode.Int64: return ConvertInt64((Int64)obj); case TypeCode.UInt16: return ConvertInt32((UInt16)obj); diff --git a/src/System.Management.Automation/engine/lang/parserutils.cs b/src/System.Management.Automation/engine/lang/parserutils.cs index 75f4e36310..9b3c8bad1b 100644 --- a/src/System.Management.Automation/engine/lang/parserutils.cs +++ b/src/System.Management.Automation/engine/lang/parserutils.cs @@ -888,7 +888,7 @@ namespace System.Management.Automation private static object AsChar(object obj) { if (obj is char) return obj; - if (obj is string str && str.Length == 1 && !Char.IsDigit(str, 0)) return str[0]; + if (obj is string str && str.Length == 1 && !char.IsDigit(str, 0)) return str[0]; return null; } diff --git a/src/System.Management.Automation/engine/parser/DebugViewWriter.cs b/src/System.Management.Automation/engine/parser/DebugViewWriter.cs index b3baa0a0df..b02265507a 100644 --- a/src/System.Management.Automation/engine/parser/DebugViewWriter.cs +++ b/src/System.Management.Automation/engine/parser/DebugViewWriter.cs @@ -1196,7 +1196,7 @@ namespace System.Management.Automation.Language { /// private static bool ContainsWhiteSpace(string name) { foreach (char c in name) { - if (Char.IsWhiteSpace(c)) { + if (char.IsWhiteSpace(c)) { return true; } } diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index fbbbce8892..1c1bb06e6c 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -1421,7 +1421,7 @@ namespace System.Management.Automation.Language string hexStr = GetStringAndRelease(sb); uint unicodeValue = uint.Parse(hexStr, NumberStyles.AllowHexSpecifier, NumberFormatInfo.InvariantInfo); - if (unicodeValue <= Char.MaxValue) + if (unicodeValue <= char.MaxValue) { return ((char)unicodeValue); } @@ -2976,7 +2976,7 @@ namespace System.Management.Automation.Language break; default: - if (Char.IsLetterOrDigit(c)) + if (char.IsLetterOrDigit(c)) { sb.Append(c); } diff --git a/src/System.Management.Automation/engine/serialization.cs b/src/System.Management.Automation/engine/serialization.cs index e7d737e0f5..f1dfddb88d 100644 --- a/src/System.Management.Automation/engine/serialization.cs +++ b/src/System.Management.Automation/engine/serialization.cs @@ -2602,7 +2602,7 @@ namespace System.Management.Automation Dbg.Assert(entry != null, "caller should have validated the information"); // Char is defined as unsigned short in schema - WriteRawString(serializer, streamName, property, XmlConvert.ToString((UInt16)(Char)source), entry); + WriteRawString(serializer, streamName, property, XmlConvert.ToString((UInt16)(char)source), entry); } /// @@ -2619,7 +2619,7 @@ namespace System.Management.Automation Dbg.Assert(source != null, "caller should have validated the information"); Dbg.Assert(entry != null, "caller should have validated the information"); - WriteRawString(serializer, streamName, property, XmlConvert.ToString((Boolean)source), entry); + WriteRawString(serializer, streamName, property, XmlConvert.ToString((bool)source), entry); } /// @@ -3009,7 +3009,7 @@ namespace System.Management.Automation () => new HashSet { - typeof(Boolean), + typeof(bool), typeof(byte), typeof(char), typeof(DateTime), @@ -4182,7 +4182,7 @@ namespace System.Management.Automation Exception recognizedException = null; try { - return (Char)XmlConvert.ToUInt16(deserializer._reader.ReadElementContentAsString()); + return (char)XmlConvert.ToUInt16(deserializer._reader.ReadElementContentAsString()); } catch (FormatException e) { @@ -5150,7 +5150,7 @@ namespace System.Management.Automation /// private static readonly TypeSerializationInfo[] s_typeSerializationInfo = new TypeSerializationInfo[] { - new TypeSerializationInfo(typeof(Boolean), + new TypeSerializationInfo(typeof(bool), SerializationStrings.BooleanTag, SerializationStrings.BooleanTag, InternalSerializer.WriteBoolean, @@ -6116,7 +6116,7 @@ namespace System.Management.Automation /// /// The key of the element to add. /// The value of the element to add. - public void Add(string key, Boolean value) + public void Add(string key, bool value) { this.Add((object)key, (object)value); } @@ -6156,7 +6156,7 @@ namespace System.Management.Automation /// /// The key of the element to add. /// The value of the element to add. - public void Add(string key, Char value) + public void Add(string key, char value) { this.Add((object)key, (object)value); } @@ -6166,7 +6166,7 @@ namespace System.Management.Automation /// /// The key of the element to add. /// The value of the element to add. - public void Add(string key, Char[] value) + public void Add(string key, char[] value) { this.Add((object)key, (object)value); } diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 8143122394..5e32b3d8b8 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -39,8 +39,8 @@ namespace Microsoft.PowerShell.Commands [OutputType(typeof(FileInfo), ProviderCmdlet = ProviderCmdlet.GetItem)] [OutputType(typeof(FileInfo), typeof(DirectoryInfo), ProviderCmdlet = ProviderCmdlet.GetChildItem)] [OutputType(typeof(FileSecurity), typeof(DirectorySecurity), ProviderCmdlet = ProviderCmdlet.GetAcl)] - [OutputType(typeof(Boolean), typeof(string), typeof(FileInfo), typeof(DirectoryInfo), ProviderCmdlet = ProviderCmdlet.GetItem)] - [OutputType(typeof(Boolean), typeof(string), typeof(DateTime), typeof(System.IO.FileInfo), typeof(System.IO.DirectoryInfo), ProviderCmdlet = ProviderCmdlet.GetItemProperty)] + [OutputType(typeof(bool), typeof(string), typeof(FileInfo), typeof(DirectoryInfo), ProviderCmdlet = ProviderCmdlet.GetItem)] + [OutputType(typeof(bool), typeof(string), typeof(DateTime), typeof(System.IO.FileInfo), typeof(System.IO.DirectoryInfo), ProviderCmdlet = ProviderCmdlet.GetItemProperty)] [OutputType(typeof(string), typeof(System.IO.FileInfo), ProviderCmdlet = ProviderCmdlet.NewItem)] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "This coupling is required")] public sealed partial class FileSystemProvider : NavigationCmdletProvider, @@ -657,7 +657,7 @@ namespace Microsoft.PowerShell.Commands { char driveChar = Convert.ToChar(drive.Name, CultureInfo.InvariantCulture); - if (Char.ToUpperInvariant(driveChar) >= 'A' && Char.ToUpperInvariant(driveChar) <= 'Z') + if (char.ToUpperInvariant(driveChar) >= 'A' && char.ToUpperInvariant(driveChar) <= 'Z') { isSupportedDriveForPersistence = true; } @@ -7629,7 +7629,7 @@ namespace Microsoft.PowerShell.Commands public ushort Data2; public ushort Data3; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public Char[] Data4; + public char[] Data4; } [StructLayout(LayoutKind.Sequential)] @@ -7640,7 +7640,7 @@ namespace Microsoft.PowerShell.Commands public ushort Reserved; public GUID ReparseGuid; [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_REPARSE_SIZE)] - public Char[] DataBuffer; + public char[] DataBuffer; } [DllImport(PinvokeDllNames.DeviceIoControlDllName, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]