Contribute to IDE0055 (fix formatting)
authorStephen Toub <stoub@microsoft.com>
Sat, 24 Aug 2019 02:24:14 +0000 (22:24 -0400)
committerStephen Toub <stoub@microsoft.com>
Sat, 24 Aug 2019 11:47:35 +0000 (07:47 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/b49a8a9be1d53cd9e50cb68fd8540be25c65d433

351 files changed:
src/libraries/Common/src/Interop/Interop.Odbc.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx_SafeTokenHandle.cs
src/libraries/Common/src/Interop/Windows/Interop.Errors.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.COMMPROP.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommError.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfoEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommModemStatus.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetOverlappedResult.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PeekConsoleInput.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommTimeouts.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitForSingleObject.cs
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RTL_OSVERSIONINFOEX.cs
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs
src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.MSG.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.USEROBJECTFLAGS.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.WNDCLASS.cs
src/libraries/Common/src/System/Data/Common/DbConnectionOptions.Common.cs
src/libraries/Common/src/System/Diagnostics/CodeAnalysis/ExcludeFromCodeCoverageAttribute.cs
src/libraries/Common/src/System/Globalization/FormatProvider.Number.cs
src/libraries/Common/src/System/Net/Logging/NetEventSource.Common.cs
src/libraries/Common/src/System/Resources/ResourceWriter.cs
src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnWriter.cs
src/libraries/Common/src/System/Security/Cryptography/DSACng.cs
src/libraries/Common/src/System/Security/Cryptography/DSAKeyFormatHelper.cs
src/libraries/Common/src/System/Security/Cryptography/EccKeyFormatHelper.cs
src/libraries/Common/src/System/Security/Cryptography/RSAKeyFormatHelper.cs
src/libraries/Common/src/System/Text/DBCSDecoder.cs
src/libraries/Common/src/System/Text/OSEncoder.cs
src/libraries/Common/src/System/Text/OSEncoding.Windows.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/BinderEquivalence.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/BinderHelper.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpBinaryOperationBinder.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpGetIndexBinder.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpUnaryOperationBinder.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ExpressionTreeCallRewriter.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversion.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ExprOperator.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Visitors/ExpressionTreeRewriter.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/WithType.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/SymbolTable.cs
src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs
src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs
src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs
src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs
src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/NameObjectCollectionBase.cs
src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/NameValueCollection.cs
src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/OrderedDictionary.cs
src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.TreeSubSet.cs
src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Collections/CollectionServices.CollectionOfObject.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ConstraintServices.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AggregateExportProvider.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ApplicationCatalog.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ComposablePartExportProvider.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionOptions.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionScopeDefinition.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionScopeDefinitionDebuggerProxy.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionServices.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/FilteredCatalog.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ImportSourceImportDefinitionHelpers.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ScopingExtensions.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataAttributeAttribute.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewGenerator.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewProvider.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartDefinition.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/PrimitivesServices.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ExportfactoryCreator.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionParameter.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/BooleanConverter.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerOptionService.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/PropertyTabAttribute.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MarshalByValueComponent.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MemberDescriptor.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/NullableConverter.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReferenceConverter.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectEventDescriptor.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs
src/libraries/System.Composition.AttributedModel/src/System/Composition/ExportAttribute.cs
src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredPart.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/BaseConfigurationRecord.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/InternalConfigRoot.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ProtectedConfigurationSection.cs
src/libraries/System.Console/src/System/Console.cs
src/libraries/System.Console/src/System/ConsolePal.Windows.cs
src/libraries/System.Data.Common/src/System/Data/Constraint.cs
src/libraries/System.Data.Common/src/System/Data/DataTable.cs
src/libraries/System.Data.Common/src/System/Data/DataView.cs
src/libraries/System.Data.Common/src/System/Data/LinqDataView.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLBinary.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLBoolean.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLByte.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDouble.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLInt16.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLInt32.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLInt64.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLMoney.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLSingle.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLString.cs
src/libraries/System.Data.Common/src/System/Data/Selection.cs
src/libraries/System.Data.Odbc/src/System/Data/Odbc/Odbc32.cs
src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcParameterHelper.cs
src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcStatementHandle.cs
src/libraries/System.Data.OleDb/src/OleDbParameterCollectionHelper.cs
src/libraries/System.Data.OleDb/src/System/Data/Common/AdapterUtil.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/LocalDB.Windows.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIPacket.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlCommand.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlDependencyListener.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlFileStream.Windows.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlParameter.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlUtil.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/TdsParserStateObjectNative.cs
src/libraries/System.Diagnostics.PerformanceCounter/src/misc/EnvironmentHelpers.cs
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/SymbolStore/SymLanguageType.cs
src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/SymbolStore/SymLanguageVendor.cs
src/libraries/System.Diagnostics.TextWriterTraceListener/src/System/Diagnostics/ConsoleTraceListener.cs
src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/DefaultTraceListener.cs
src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceInternal.cs
src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceListener.cs
src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceSource.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/RangeRetriever.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/GlobalDebug.cs
src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/common/SearchResults.cs
src/libraries/System.DirectoryServices/src/Interop/UnsafeNativeMethods.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ADSearcher.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectorySearcher.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Bitmap.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Brushes.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Drawing2D/LinearGradientBrush.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/MetaHeader.Windows.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/Metafile.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Pen.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Printing/TriState.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Region.cs
src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/BrotliStream.cs
src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/dec/BrotliStream.Decompress.cs
src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchive.Extract.cs
src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateZLib/DeflateStream.cs
src/libraries/System.IO.Compression/src/System/IO/Compression/GZipStream.cs
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs
src/libraries/System.IO.FileSystem/src/System/IO/Directory.cs
src/libraries/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerableFactory.cs
src/libraries/System.IO.FileSystem/src/System/IO/EnumerationOptions.cs
src/libraries/System.IO.FileSystem/src/System/IO/FileSystemInfo.Windows.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/InternalRelationshipCollection.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/PackUriHelper.PackUriScheme.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/PackagePart.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipWrappingStream.cs
src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeAccessRule.cs
src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs
src/libraries/System.Json/src/System/Json/JsonValue.cs
src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LightCompiler.cs
src/libraries/System.Linq.Queryable/src/System/Linq/EnumerableQuery.cs
src/libraries/System.Linq.Queryable/src/System/Linq/EnumerableRewriter.cs
src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs
src/libraries/System.Management/src/System/Management/ManagementBaseObject.cs
src/libraries/System.Management/src/System/Management/ManagementClass.cs
src/libraries/System.Management/src/System/Management/ManagementDateTime.cs
src/libraries/System.Management/src/System/Management/ManagementEventArgs.cs
src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs
src/libraries/System.Management/src/System/Management/ManagementNamedValueCollection.cs
src/libraries/System.Management/src/System/Management/ManagementObject.cs
src/libraries/System.Management/src/System/Management/ManagementObjectCollection.cs
src/libraries/System.Management/src/System/Management/ManagementObjectSearcher.cs
src/libraries/System.Management/src/System/Management/ManagementOperationWatcher.cs
src/libraries/System.Management/src/System/Management/ManagementOptions.cs
src/libraries/System.Management/src/System/Management/ManagementPath.cs
src/libraries/System.Management/src/System/Management/ManagementQuery.cs
src/libraries/System.Management/src/System/Management/ManagementScope.cs
src/libraries/System.Management/src/System/Management/Method.cs
src/libraries/System.Management/src/System/Management/MethodSet.cs
src/libraries/System.Management/src/System/Management/Property.cs
src/libraries/System.Management/src/System/Management/PropertySet.cs
src/libraries/System.Management/src/System/Management/Qualifier.cs
src/libraries/System.Management/src/System/Management/QualifierSet.cs
src/libraries/System.Management/src/System/Management/WMIGenerator.cs
src/libraries/System.Management/src/System/Management/WmiEventSink.cs
src/libraries/System.Management/src/System/Management/wmiutil.cs
src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpAuthHelper.cs
src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs
src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestState.cs
src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpGeneralHeaders.cs
src/libraries/System.Net.Http/src/System/Net/Http/HttpRuleParser.cs
src/libraries/System.Net.Http/src/System/Net/Http/MultipartContent.cs
src/libraries/System.Net.Http/src/System/Net/Http/NetEventSource.Http.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/CancellationHelper.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpAuthenticatedConnectionHandler.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionHandler.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPoolManager.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpWindowsProxy.cs
src/libraries/System.Net.Primitives/src/System/Net/Cookie.cs
src/libraries/System.Net.Primitives/src/System/Net/CookieCollection.cs
src/libraries/System.Net.Requests/src/System/Net/WebRequest.cs
src/libraries/System.Net.Requests/src/System/Net/WebResponse.cs
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/DynamicWinsockMethods.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SafeSocketHandle.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
src/libraries/System.Net.WebClient/src/System/Net/WebClient.cs
src/libraries/System.Net.WebHeaderCollection/src/System/Net/WebHeaderCollection.cs
src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs
src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/ArrayUtilities.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Globals.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonCollectionDataContract.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonReaderDelegator.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionClassWriter.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlObjectSerializerReadContext.cs
src/libraries/System.Private.Uri/src/System/Uri.cs
src/libraries/System.Private.Uri/src/System/UriParserTemplates.cs
src/libraries/System.Private.Uri/src/System/UriSyntax.cs
src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XAttribute.cs
src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XDocument.cs
src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XElement.cs
src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XLinq.cs
src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObject.cs
src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XText.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriterAsync.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlReader.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlReaderSettings.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplAsync.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaDataType.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaGroupBase.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationWriter.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilLiteral.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlCollation.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPathConvert.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs
src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs
src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/BlobReader.cs
src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEHeaderBuilder.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/DefaultBinder.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/MetadataLoadContext.Loading.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/CustomAttributes/Ecma/EcmaCustomAttributeHelpers.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Utf8Constants.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Modules/Ecma/EcmaModule.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/RuntimeTypeInfo.GetMember.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Types/RoArrayType.cs
src/libraries/System.Reflection.TypeExtensions/src/System/Reflection/TypeExtensions.cs
src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/TypeNameComparer.cs
src/libraries/System.Resources.Writer/src/System/Resources/__FastResourceComparer.cs
src/libraries/System.Runtime.CompilerServices.VisualC/src/System/Runtime/CompilerServices/Attributes.cs
src/libraries/System.Runtime.Extensions/src/System/Context.cs
src/libraries/System.Runtime.Extensions/src/System/LoaderOptimizationAttribute.cs
src/libraries/System.Runtime.Extensions/src/System/Runtime/CompilerServices/SwitchExpressionException.cs
src/libraries/System.Runtime.Extensions/src/System/Runtime/Versioning/VersioningHelper.cs
src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/ComTypes/IDataObject.cs
src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/ComTypes/IEnumSTATDATA.cs
src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs
src/libraries/System.Runtime.Numerics/src/System/Numerics/Complex.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryUtilClasses.cs
src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/LayoutCycleException.cs
src/libraries/System.Runtime.WindowsRuntime/src/System/Threading/Tasks/TaskToAsyncInfoAdapter.cs
src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/ACL.cs
src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/ObjectSecurity.cs
src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/Rules.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CngKeyLite.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/TripleDES.cs
src/libraries/System.Security.Cryptography.Cng/src/System/Security/Cryptography/ECDsaCng.Key.cs
src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CspKeyContainerInfo.Windows.cs
src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/RNGCryptoServiceProvider.cs
src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/SHA512CryptoServiceProvider.cs
src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/AsnEncodedDataCollection.cs
src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/AsnHelpers.cs
src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/HelpersWindows.cs
src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsRecipient.cs
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Pkcs12KeyBag.cs
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Pkcs12SafeBag.cs
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Pkcs12ShroudedKeyBag.cs
src/libraries/System.Security.Cryptography.Primitives/src/System/Security/Cryptography/CipherMode.cs
src/libraries/System.Security.Cryptography.Primitives/src/System/Security/Cryptography/HashAlgorithm.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/FindPal.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.Export.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.Import.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.CustomExtensions.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/SubjectAlternativeNameBuilder.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509CertificateCollection.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Chain.cs
src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/EncryptedXml.cs
src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/KeyInfoX509Data.cs
src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/Utils.cs
src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Atom10FeedFormatter.cs
src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationFeed.cs
src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs
src/libraries/System.Text.Encoding.CodePages/src/System/Text/DecoderNLS.cs
src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncoderNLS.cs
src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingNLS.cs
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocumentOptions.cs
src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderException.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/EnumConverterOptions.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/JsonValueConverterEnum.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.AddProperty.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleNull.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.Cache.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCode.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFCD.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexReplacement.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexRunner.cs
src/libraries/System.Transactions.Local/src/System/Transactions/CommittableTransaction.cs
src/libraries/System.Transactions.Local/src/System/Transactions/TransactionException.cs
src/libraries/System.Windows.Extensions/src/System/Drawing/ImageConverter.cs
src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/SafeX509Handles.cs

index c71b3cb..848dd10 100644 (file)
@@ -130,7 +130,7 @@ internal static partial class Interop
         [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)]
         internal static extern /*SQLRETURN*/ODBC32.RetCode SQLExecDirectW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
-            /*SQLCHAR* */string   StatementText,
+            /*SQLCHAR* */string StatementText,
             /*SQLINTEGER*/int TextLength);
 
         [DllImport(Interop.Libraries.Odbc32)]
@@ -245,7 +245,7 @@ internal static partial class Interop
         [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)]
         internal static extern /*SQLRETURN*/ODBC32.RetCode SQLPrepareW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
-            /*SQLCHAR* */string   StatementText,
+            /*SQLCHAR* */string StatementText,
             /*SQLINTEGER*/int TextLength);
 
         [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)]
index afb1997..e052c74 100644 (file)
@@ -12,8 +12,7 @@ internal static partial class Interop
     internal static partial class Advapi32
     {
         [DllImport(Interop.Libraries.Advapi32, SetLastError = true)]
-         internal static extern
-        bool DuplicateTokenEx(SafeTokenHandle ExistingTokenHandle,
+        internal static extern bool DuplicateTokenEx(SafeTokenHandle ExistingTokenHandle,
             TokenAccessLevels DesiredAccess,
             IntPtr TokenAttributes,
             SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
index 7803d5d..741c783 100644 (file)
@@ -30,7 +30,7 @@ internal partial class Interop
         internal const int ERROR_INVALID_PARAMETER = 0x57;
         internal const int ERROR_BROKEN_PIPE = 0x6D;
         internal const int ERROR_SEM_TIMEOUT = 0x79;
-        internal const int ERROR_CALL_NOT_IMPLEMENTED  = 0x78;
+        internal const int ERROR_CALL_NOT_IMPLEMENTED = 0x78;
         internal const int ERROR_INSUFFICIENT_BUFFER = 0x7A;
         internal const int ERROR_INVALID_NAME = 0x7B;
         internal const int ERROR_NEGATIVE_SEEK = 0x83;
index 1a88599..597d2d0 100644 (file)
@@ -17,8 +17,8 @@ internal partial class Interop
         // https://msdn.microsoft.com/en-us/library/windows/desktop/aa363189.aspx
         internal struct COMMPROP
         {
-            public ushort  wPacketLength;
-            public ushort  wPacketVersion;
+            public ushort wPacketLength;
+            public ushort wPacketVersion;
             public int dwServiceMask;
             public int dwReserved1;
             public int dwMaxTxQueue;
@@ -29,7 +29,7 @@ internal partial class Interop
             public int dwSettableParams;
             public int dwSettableBaud;
             public ushort wSettableData;
-            public ushort  wSettableStopParity;
+            public ushort wSettableStopParity;
             public int dwCurrentTxQueue;
             public int dwCurrentRxQueue;
             public int dwProvSpec1;
index f181dcb..4b7b730 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool ClearCommBreak(
             SafeFileHandle hFile);
     }
index 6dc5e2d..0b5aa54 100644 (file)
@@ -10,7 +10,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool ClearCommError(
             SafeFileHandle hFile,
             ref int lpErrors,
index 908a921..866f85c 100644 (file)
@@ -17,7 +17,7 @@ internal partial class Interop
             internal const int CLRDTR = 6;
         }
 
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool EscapeCommFunction(
             SafeFileHandle hFile,
             int dwFunc);
index c898497..e7078e3 100644 (file)
@@ -29,10 +29,10 @@ internal partial class Interop
             if (GetCPInfoExW((uint)codePage, 0, &cpInfo) != BOOL.FALSE)
             {
                 // we don't care about the last 2 bytes as those are nulls
-                for (int i=0; i<10 && leadByteRanges[i] != 0; i+=2)
+                for (int i = 0; i < 10 && leadByteRanges[i] != 0; i += 2)
                 {
                     leadByteRanges[i] = cpInfo.LeadByte[i];
-                    leadByteRanges[i+1] = cpInfo.LeadByte[i+1];
+                    leadByteRanges[i + 1] = cpInfo.LeadByte[i + 1];
                     count++;
                 }
             }
index e7e3148..a089cd3 100644 (file)
@@ -16,7 +16,7 @@ internal partial class Interop
             internal const int MS_RLSD_ON = 0x80;
         }
 
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool GetCommModemStatus(
             SafeFileHandle hFile,
             ref int lpModemStat);
index 3edef5c..830f7de 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool GetCommProperties(
             SafeFileHandle hFile,
             ref COMMPROP lpCommProp);
index 800d09d..c573339 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool GetCommState(
             SafeFileHandle hFile,
             ref DCB lpDCB);
index f78941f..b31b6f6 100644 (file)
@@ -10,7 +10,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern unsafe bool GetOverlappedResult(
             SafeFileHandle hFile,
             NativeOverlapped* lpOverlapped,
index decaed0..ba63f0a 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint ="PeekConsoleInputW")]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "PeekConsoleInputW")]
         internal static extern bool PeekConsoleInput(IntPtr hConsoleInput, out InputRecord buffer, int numInputRecords_UseOne, out int numEventsRead);
     }
 }
index 8eaafbb..1cad74c 100644 (file)
@@ -17,7 +17,7 @@ internal partial class Interop
             internal const uint PURGE_RXCLEAR = 0x0008;  // Kill the typeahead buffer if there.
         }
 
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool PurgeComm(
             SafeFileHandle hFile,
             uint dwFlags);
index d6af43f..e57d3e0 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool SetCommBreak(
             SafeFileHandle hFile);
     }
index d3637e7..9231129 100644 (file)
@@ -16,7 +16,7 @@ internal partial class Interop
             internal const int ALL_EVENTS = 0x1fb;
         }
 
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool SetCommMask(
             SafeFileHandle hFile,
             int dwEvtMask
index 6f7ad4c..d1a82ea 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool SetCommState(
             SafeFileHandle hFile,
             ref DCB lpDCB);
index 7d19d57..3109704 100644 (file)
@@ -11,7 +11,7 @@ internal partial class Interop
     {
         internal const int MAXDWORD = -1; // This is 0xfffffff, or UInt32.MaxValue, here used as an int
 
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool SetCommTimeouts(
             SafeFileHandle hFile,
             ref COMMTIMEOUTS lpCommTimeouts);
index 24f0d0b..1e56f8e 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern bool SetupComm(
             SafeFileHandle hFile,
             int dwInQueue,
index 6966f79..69ac18b 100644 (file)
@@ -10,7 +10,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, SetLastError=true, CharSet=CharSet.Auto)]
+        [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
         internal static extern unsafe bool WaitCommEvent(
             SafeFileHandle hFile,
             int* lpEvtMask,
index f8c3d05..8bf2705 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, ExactSpelling=true, SetLastError=true)]
+        [DllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)]
         internal static extern int WaitForSingleObject(SafeWaitHandle handle, int timeout);
     }
 }
index 47a6b78..049a68c 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class NtDll
     {
-        [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
         internal unsafe struct RTL_OSVERSIONINFOEX
         {
             internal uint dwOSVersionInfoSize;
index 4a8ecdf..e3e5209 100644 (file)
@@ -8,7 +8,7 @@ internal partial class Interop
 {
     internal partial class NtDll
     {
-        [DllImport(Libraries.NtDll, ExactSpelling=true)]
+        [DllImport(Libraries.NtDll, ExactSpelling = true)]
         private static extern int RtlGetVersion(ref RTL_OSVERSIONINFOEX lpVersionInformation);
 
         internal static unsafe int RtlGetVersionEx(out RTL_OSVERSIONINFOEX osvi)
index 1231fa3..8182e41 100644 (file)
@@ -533,7 +533,7 @@ namespace System.Net.Security
         //
         private static unsafe int MustRunInitializeSecurityContext(
             ref SafeFreeCredentials inCredentials,
-            bool  isContextAbsent,
+            bool isContextAbsent,
             byte* targetName,
             Interop.SspiCli.ContextFlags inFlags,
             Interop.SspiCli.Endianness endianness,
index c5a106c..ffb80e7 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class User32
     {
-        [DllImport(Libraries.User32, CharSet=CharSet.Unicode, SetLastError=true, ExactSpelling = true)]
+        [DllImport(Libraries.User32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
         public static extern IntPtr CreateWindowExW(
             int exStyle,
             string lpszClassName,
index 7a02b0e..7fe4dc0 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class User32
     {
-        [DllImport(Libraries.User32, CharSet=CharSet.Unicode, ExactSpelling = true)]
+        [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
         public static extern bool GetClassInfoW(IntPtr hInst, string lpszClass, ref WNDCLASS wc);
     }
 }
index 7e16cbe..10a3ed9 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class User32
     {
-        [DllImport(Libraries.User32, ExactSpelling=true)]
+        [DllImport(Libraries.User32, ExactSpelling = true)]
         internal static extern IntPtr GetProcessWindowStation();
     }
 }
index 9afdf0c..85205d3 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class User32
     {
-        [DllImport(Libraries.User32, SetLastError=true, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [DllImport(Libraries.User32, SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)]
         public static extern bool GetUserObjectInformationW(IntPtr hObj, int nIndex, ref USEROBJECTFLAGS pvBuffer, int nLength, ref int lpnLengthNeeded);
     }
 }
index 871d772..cc424da 100644 (file)
@@ -10,14 +10,15 @@ internal partial class Interop
     internal partial class User32
     {
         [StructLayout(LayoutKind.Sequential)]
-        public struct MSG {
-            public IntPtr   hwnd;
-            public int      message;
-            public IntPtr   wParam;
-            public IntPtr   lParam;
-            public int      time;
-            public int      pt_x;
-            public int      pt_y;
+        public struct MSG
+        {
+            public IntPtr hwnd;
+            public int message;
+            public IntPtr wParam;
+            public IntPtr lParam;
+            public int time;
+            public int pt_x;
+            public int pt_y;
         }
     }
 }
index f52e0cd..f33a5be 100644 (file)
@@ -8,7 +8,8 @@ internal partial class Interop
 {
     internal partial class User32
     {
-        internal struct USEROBJECTFLAGS {
+        internal struct USEROBJECTFLAGS
+        {
             public int fInherit;
             public int fReserved;
             public int dwFlags;
index 72c076b..9f23c76 100644 (file)
@@ -9,7 +9,7 @@ internal partial class Interop
 {
     internal partial class User32
     {
-        [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
         internal unsafe struct WNDCLASS
         {
             public int style;
index 1bc6de9..939f62a 100644 (file)
@@ -26,40 +26,39 @@ namespace System.Data.Common
             + "))"
             + "[\\s;]*"
         ;*/
-        private const string ConnectionStringPattern =                  // may not contain embedded null except trailing last value
+        private const string ConnectionStringPattern =                      // may not contain embedded null except trailing last value
                 "([\\s;]*"                                                  // leading whitespace and extra semicolons
                 + "(?![\\s;])"                                              // key does not start with space or semicolon
                 + "(?<key>([^=\\s\\p{Cc}]|\\s+[^=\\s\\p{Cc}]|\\s+==|==)+)"  // allow any visible character for keyname except '=' which must quoted as '=='
                 + "\\s*=(?!=)\\s*"                                          // the equal sign divides the key and value parts
                 + "(?<value>"
-                + "(\"([^\"\u0000]|\"\")*\")"                              // double quoted string, " must be quoted as ""
+                + "(\"([^\"\u0000]|\"\")*\")"                               // double quoted string, " must be quoted as ""
                 + "|"
-                + "('([^'\u0000]|'')*')"                                   // single quoted string, ' must be quoted as ''
+                + "('([^'\u0000]|'')*')"                                    // single quoted string, ' must be quoted as ''
                 + "|"
-                + "((?![\"'\\s])"                                          // unquoted value must not start with " or ' or space, would also like = but too late to change
-                + "([^;\\s\\p{Cc}]|\\s+[^;\\s\\p{Cc}])*"                  // control characters must be quoted
+                + "((?![\"'\\s])"                                           // unquoted value must not start with " or ' or space, would also like = but too late to change
+                + "([^;\\s\\p{Cc}]|\\s+[^;\\s\\p{Cc}])*"                    // control characters must be quoted
                 + "(?<![\"']))"                                            // unquoted value must not stop with " or '
-                + ")(\\s*)(;|[\u0000\\s]*$)"                                // whitespace after value up to semicolon or end-of-line
-                + ")*"                                                      // repeat the key-value pair
-                + "[\\s;]*[\u0000\\s]*"                                     // trailing whitespace/semicolons (DataSourceLocator), embedded nulls are allowed only in the end
+                + ")(\\s*)(;|[\u0000\\s]*$)"                               // whitespace after value up to semicolon or end-of-line
+                + ")*"                                                     // repeat the key-value pair
+                + "[\\s;]*[\u0000\\s]*"                                    // trailing whitespace/semicolons (DataSourceLocator), embedded nulls are allowed only in the end
             ;
 
-        private const string ConnectionStringPatternOdbc =              // may not contain embedded null except trailing last value
-                "([\\s;]*"                                                  // leading whitespace and extra semicolons
-                + "(?![\\s;])"                                              // key does not start with space or semicolon
-                + "(?<key>([^=\\s\\p{Cc}]|\\s+[^=\\s\\p{Cc}])+)"            // allow any visible character for keyname except '='
-                + "\\s*=\\s*"                                               // the equal sign divides the key and value parts
+        private const string ConnectionStringPatternOdbc =                 // may not contain embedded null except trailing last value
+                "([\\s;]*"                                                 // leading whitespace and extra semicolons
+                + "(?![\\s;])"                                             // key does not start with space or semicolon
+                + "(?<key>([^=\\s\\p{Cc}]|\\s+[^=\\s\\p{Cc}])+)"           // allow any visible character for keyname except '='
+                + "\\s*=\\s*"                                              // the equal sign divides the key and value parts
                 + "(?<value>"
                 + "(\\{([^\\}\u0000]|\\}\\})*\\})"                         // quoted string, starts with { and ends with }
                 + "|"
                 + "((?![\\{\\s])"                                          // unquoted value must not start with { or space, would also like = but too late to change
-                + "([^;\\s\\p{Cc}]|\\s+[^;\\s\\p{Cc}])*"                  // control characters must be quoted
+                + "([^;\\s\\p{Cc}]|\\s+[^;\\s\\p{Cc}])*"                   // control characters must be quoted
 
-                + ")" // although the spec does not allow {}
-                // embedded within a value, the retail code does.
+                + ")" // although the spec does not allow {} embedded within a value, the retail code does.
                 + ")(\\s*)(;|[\u0000\\s]*$)"                               // whitespace after value up to semicolon or end-of-line
-                + ")*"                                                      // repeat the key-value pair
-                + "[\\s;]*[\u0000\\s]*"                                     // traling whitespace/semicolons (DataSourceLocator), embedded nulls are allowed only in the end
+                + ")*"                                                     // repeat the key-value pair
+                + "[\\s;]*[\u0000\\s]*"                                    // traling whitespace/semicolons (DataSourceLocator), embedded nulls are allowed only in the end
             ;
 
         private static readonly Regex s_connectionStringRegex = new Regex(ConnectionStringPattern, RegexOptions.ExplicitCapture | RegexOptions.Compiled);
@@ -548,47 +547,48 @@ namespace System.Data.Common
             try
             {
 #endif
-            int nextStartPosition = 0;
-            int endPosition = connectionString.Length;
-            while (nextStartPosition < endPosition)
-            {
-                int startPosition = nextStartPosition;
-
-                string keyname, keyvalue;
-                nextStartPosition = GetKeyValuePair(connectionString, startPosition, buffer, firstKey, out keyname, out keyvalue);
-                if (string.IsNullOrEmpty(keyname))
+                int nextStartPosition = 0;
+                int endPosition = connectionString.Length;
+                while (nextStartPosition < endPosition)
                 {
-                    // if (nextStartPosition != endPosition) { throw; }
-                    break;
-                }
+                    int startPosition = nextStartPosition;
+
+                    string keyname, keyvalue;
+                    nextStartPosition = GetKeyValuePair(connectionString, startPosition, buffer, firstKey, out keyname, out keyvalue);
+                    if (string.IsNullOrEmpty(keyname))
+                    {
+                        break;
+                    }
 #if DEBUG
                     DebugTraceKeyValuePair(keyname, keyvalue, synonyms);
 
                     Debug.Assert(IsKeyNameValid(keyname), "ParseFailure, invalid keyname");
                     Debug.Assert(IsValueValidInternal(keyvalue), "parse failure, invalid keyvalue");
 #endif
-                string synonym;
-                string realkeyname = null != synonyms ?
-                    (synonyms.TryGetValue(keyname, out synonym) ? synonym : null) :
-                    keyname;
-                if (!IsKeyNameValid(realkeyname))
-                {
-                    throw ADP.KeywordNotSupported(keyname);
-                }
-                if (!firstKey || !parsetable.ContainsKey(realkeyname))
-                {
-                    parsetable[realkeyname] = keyvalue; // last key-value pair wins (or first)
-                }
+                    string synonym;
+                    string realkeyname = null != synonyms ?
+                        (synonyms.TryGetValue(keyname, out synonym) ? synonym : null) :
+                        keyname;
 
-                if (null != localKeychain)
-                {
-                    localKeychain = localKeychain.Next = new NameValuePair(realkeyname, keyvalue, nextStartPosition - startPosition);
-                }
-                else if (buildChain)
-                { // first time only - don't contain modified chain from UDL file
-                    keychain = localKeychain = new NameValuePair(realkeyname, keyvalue, nextStartPosition - startPosition);
+                    if (!IsKeyNameValid(realkeyname))
+                    {
+                        throw ADP.KeywordNotSupported(keyname);
+                    }
+                    if (!firstKey || !parsetable.ContainsKey(realkeyname))
+                    {
+                        parsetable[realkeyname] = keyvalue; // last key-value pair wins (or first)
+                    }
+
+                    if (null != localKeychain)
+                    {
+                        localKeychain = localKeychain.Next = new NameValuePair(realkeyname, keyvalue, nextStartPosition - startPosition);
+                    }
+                    else if (buildChain)
+                    {
+                        // first time only - don't contain modified chain from UDL file
+                        keychain = localKeychain = new NameValuePair(realkeyname, keyvalue, nextStartPosition - startPosition);
+                    }
                 }
-            }
 #if DEBUG
             }
             catch (ArgumentException e)
index 01759b3..5cc12b4 100644 (file)
@@ -10,7 +10,7 @@ namespace System.Diagnostics.CodeAnalysis
 #else
     internal
 #endif
-    sealed class ExcludeFromCodeCoverageAttribute: Attribute
+    sealed class ExcludeFromCodeCoverageAttribute : Attribute
     {
         public ExcludeFromCodeCoverageAttribute()
         { }
index 646b950..2d4f906 100644 (file)
@@ -1600,12 +1600,12 @@ namespace System.Globalization
                                             // Handles E0, which should format the same as E-0
                                             i++;
                                         }
-                                        else if (src+1 < format.Length && pFormat[src] == '+' && pFormat[src + 1] == '0')
+                                        else if (src + 1 < format.Length && pFormat[src] == '+' && pFormat[src + 1] == '0')
                                         {
                                             // Handles E+0
                                             positiveSign = true;
                                         }
-                                        else if (src+1 < format.Length && pFormat[src] == '-' && pFormat[src + 1] == '0')
+                                        else if (src + 1 < format.Length && pFormat[src] == '-' && pFormat[src + 1] == '0')
                                         {
                                             // Handles E-0
                                             // Do nothing, this is just a place holder s.t. we don't break out of the loop.
index ee7da84..bd2ca6a 100644 (file)
@@ -411,7 +411,6 @@ namespace System.Net
 
         public static new bool IsEnabled =>
             Log.IsEnabled();
-            //true; // uncomment for debugging only
 
         [NonEvent]
         public static string IdOf(object value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance;
index 969b38b..dfab31a 100644 (file)
@@ -488,9 +488,11 @@ namespace System.Resources
             // This is a user type, or a precanned resource.  Find type
             // table index.  If not there, add new element.
             string typeName;
-            if (type == typeof(PrecannedResource)) {
+            if (type == typeof(PrecannedResource))
+            {
                 typeName = ((PrecannedResource)value).TypeName;
-                if (typeName.StartsWith("ResourceTypeCode.", StringComparison.Ordinal)) {
+                if (typeName.StartsWith("ResourceTypeCode.", StringComparison.Ordinal))
+                {
                     typeName = typeName.Substring(17);  // Remove through '.'
                     ResourceTypeCode typeCode = (ResourceTypeCode)Enum.Parse(typeof(ResourceTypeCode), typeName);
                     return typeCode;
@@ -503,7 +505,8 @@ namespace System.Resources
             }
 
             int typeIndex = types.IndexOf(typeName);
-            if (typeIndex == -1) {
+            if (typeIndex == -1)
+            {
                 typeIndex = types.Count;
                 types.Add(typeName);
             }
index 26ef55f..a8ee1dc 100644 (file)
@@ -421,7 +421,7 @@ namespace System.Security.Cryptography.Asn1
             WriteLength(-1);
         }
 
-        private void PopTag(Asn1Tag tag, UniversalTagNumber tagType, bool sortContents=false)
+        private void PopTag(Asn1Tag tag, UniversalTagNumber tagType, bool sortContents = false)
         {
             CheckDisposed();
 
index 77ea091..f9e716a 100644 (file)
@@ -45,7 +45,7 @@ namespace System.Security.Cryptography
             }
 
             public override string SignatureAlgorithm => "DSA";
-            public override string KeyExchangeAlgorithm  => null;
+            public override string KeyExchangeAlgorithm => null;
 
             // Need to override since base methods throw a "override me" exception: makes SignData/VerifyData function.
             protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) =>
index a4450e1..12a128e 100644 (file)
@@ -88,9 +88,9 @@ namespace System.Security.Cryptography
                 out key);
         }
 
-       internal static ReadOnlyMemory<byte> ReadSubjectPublicKeyInfo(
-            ReadOnlyMemory<byte> source,
-            out int bytesRead)
+        internal static ReadOnlyMemory<byte> ReadSubjectPublicKeyInfo(
+             ReadOnlyMemory<byte> source,
+             out int bytesRead)
         {
             return KeyFormatHelper.ReadSubjectPublicKeyInfo(
                 s_validOids,
index 0ec6169..dd68722 100644 (file)
@@ -31,9 +31,9 @@ namespace System.Security.Cryptography
                 out key);
         }
 
-       internal static ReadOnlyMemory<byte> ReadSubjectPublicKeyInfo(
-            ReadOnlyMemory<byte> source,
-            out int bytesRead)
+        internal static ReadOnlyMemory<byte> ReadSubjectPublicKeyInfo(
+             ReadOnlyMemory<byte> source,
+             out int bytesRead)
         {
             return KeyFormatHelper.ReadSubjectPublicKeyInfo(
                 s_validOids,
index db0b438..926cf94 100644 (file)
@@ -85,9 +85,9 @@ namespace System.Security.Cryptography
                 out key);
         }
 
-       internal static ReadOnlyMemory<byte> ReadSubjectPublicKeyInfo(
-            ReadOnlyMemory<byte> source,
-            out int bytesRead)
+        internal static ReadOnlyMemory<byte> ReadSubjectPublicKeyInfo(
+             ReadOnlyMemory<byte> source,
+             out int bytesRead)
         {
             return KeyFormatHelper.ReadSubjectPublicKeyInfo(
                 s_validOids,
index 1d67fce..01268b8 100644 (file)
@@ -83,7 +83,7 @@ namespace System.Text
                 index++;
             }
 
-            int result = OSEncoding.MultiByteToWideChar(_encoding.CodePage, pTempBuffer, index+1, chars, charCount);
+            int result = OSEncoding.MultiByteToWideChar(_encoding.CodePage, pTempBuffer, index + 1, chars, charCount);
 
             if (count - index > 0)
                 result += OSEncoding.MultiByteToWideChar(
@@ -170,7 +170,7 @@ namespace System.Text
             if (charCount == 0)
                 return 0;
 
-            byte lastByte = byteCount > 0 && !flush && IsLastByteALeadByte(bytes, byteCount) ? bytes[byteCount - 1] : (byte) 0;
+            byte lastByte = byteCount > 0 && !flush && IsLastByteALeadByte(bytes, byteCount) ? bytes[byteCount - 1] : (byte)0;
 
             if (lastByte != 0)
                 byteCount--;
@@ -183,7 +183,7 @@ namespace System.Text
                     return 0;
                 }
 
-                int result =  OSEncoding.MultiByteToWideChar(_encoding.CodePage, bytes, byteCount, chars, charCount);
+                int result = OSEncoding.MultiByteToWideChar(_encoding.CodePage, bytes, byteCount, chars, charCount);
                 _leftOverLeadByte = lastByte;
                 return result;
             }
index 092e99d..4a56ccb 100644 (file)
@@ -62,7 +62,7 @@ namespace System.Text
                 index++;
             }
 
-            int result = OSEncoding.WideCharToMultiByte(_encoding.CodePage, pTempBuffer, index+1, bytes, byteCount);
+            int result = OSEncoding.WideCharToMultiByte(_encoding.CodePage, pTempBuffer, index + 1, bytes, byteCount);
 
             if (count - index > 0)
                 result += OSEncoding.WideCharToMultiByte(
@@ -157,7 +157,7 @@ namespace System.Text
                     return 0;
                 }
 
-                int result =  OSEncoding.WideCharToMultiByte(_encoding.CodePage, chars, charCount, bytes, byteCount);
+                int result = OSEncoding.WideCharToMultiByte(_encoding.CodePage, chars, charCount, bytes, byteCount);
                 _charLeftOver = lastChar;
                 return result;
             }
index 38b5da5..c7815f6 100644 (file)
@@ -34,7 +34,7 @@ namespace System.Text
 
             fixed (char* pChar = chars)
             {
-                return WideCharToMultiByte(_codePage, pChar+index, count, null, 0);
+                return WideCharToMultiByte(_codePage, pChar + index, count, null, 0);
             }
         }
 
@@ -76,9 +76,9 @@ namespace System.Text
             }
 
             fixed (char* pChars = s)
-            fixed (byte *pBytes = &bytes[0])
+            fixed (bytepBytes = &bytes[0])
             {
-                return WideCharToMultiByte(_codePage, pChars+charIndex, charCount, pBytes+byteIndex, bytes.Length - byteIndex);
+                return WideCharToMultiByte(_codePage, pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex);
             }
         }
 
@@ -105,9 +105,9 @@ namespace System.Text
             }
 
             fixed (char* pChars = chars)
-            fixed (byte *pBytes = &bytes[0])
+            fixed (bytepBytes = &bytes[0])
             {
-                return WideCharToMultiByte(_codePage, pChars+charIndex, charCount, pBytes+byteIndex, bytes.Length - byteIndex);
+                return WideCharToMultiByte(_codePage, pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex);
             }
         }
 
@@ -127,7 +127,7 @@ namespace System.Text
 
             fixed (byte* pBytes = bytes)
             {
-                return MultiByteToWideChar(_codePage, pBytes+index, count, null, 0);
+                return MultiByteToWideChar(_codePage, pBytes + index, count, null, 0);
             }
         }
 
@@ -154,7 +154,7 @@ namespace System.Text
             fixed (byte* pBytes = bytes)
             fixed (char* pChars = &chars[0])
             {
-                return MultiByteToWideChar(_codePage, pBytes+byteIndex, byteCount, pChars+charIndex, chars.Length - charIndex);
+                return MultiByteToWideChar(_codePage, pBytes + byteIndex, byteCount, pChars + charIndex, chars.Length - charIndex);
             }
         }
 
index a67dcc3..3ea5f16 100644 (file)
@@ -31,10 +31,10 @@ namespace Microsoft.CSharp.RuntimeBinder
         // creating binders is not a very frequent operation.
         // typically a dynamic operation in the source will create just one binder lazily when first executed.
         private static readonly ConcurrentDictionary<ICSharpBinder, ICSharpBinder> binderEquivalenceCache =
-            new ConcurrentDictionary<ICSharpBinder, ICSharpBinder>(concurrencyLevel:2, capacity: 32, new BinderEqualityComparer());
+            new ConcurrentDictionary<ICSharpBinder, ICSharpBinder>(concurrencyLevel: 2, capacity: 32, new BinderEqualityComparer());
 
         internal static T TryGetExisting<T>(this T binder)
-            where T: ICSharpBinder
+            where T : ICSharpBinder
         {
             var fromCache = binderEquivalenceCache.GetOrAdd(binder, binder);
             if (fromCache == (object)binder)
index 924d73c..67c7a43 100644 (file)
@@ -112,7 +112,7 @@ namespace Microsoft.CSharp.RuntimeBinder
                     DynamicMetaObject arg0 = args[0];
 
                     expression = Expression.Block(
-                        new[] {tempForIncrement},
+                        new[] { tempForIncrement },
                         Expression.Assign(tempForIncrement, Expression.Convert(arg0.Expression, arg0.Value.GetType())),
                         expression,
                         Expression.Assign(arg0.Expression, Expression.Convert(tempForIncrement, arg0.Expression.Type)));
@@ -367,7 +367,7 @@ namespace Microsoft.CSharp.RuntimeBinder
                 return array;
             }
 
-            return new[] {sourceHead, sourceLast};
+            return new[] { sourceHead, sourceLast };
         }
 
         /////////////////////////////////////////////////////////////////////////////////
index f1d9b2e..1fa9625 100644 (file)
@@ -127,7 +127,7 @@ namespace Microsoft.CSharp.RuntimeBinder
         {
             BinderHelper.ValidateBindArgument(target, nameof(target));
             BinderHelper.ValidateBindArgument(arg, nameof(arg));
-            return BinderHelper.Bind(this, _binder, new[] {target, arg}, _argumentInfo, errorSuggestion);
+            return BinderHelper.Bind(this, _binder, new[] { target, arg }, _argumentInfo, errorSuggestion);
         }
     }
 }
index c49eb07..d0d69c7 100644 (file)
@@ -15,7 +15,7 @@ namespace Microsoft.CSharp.RuntimeBinder
     /// </summary>
     internal sealed class CSharpGetIndexBinder : GetIndexBinder, ICSharpBinder
     {
-        public string Name =>  SpecialNames.Indexer;
+        public string Name => SpecialNames.Indexer;
 
         public BindingFlag BindingFlags => BindingFlag.BIND_RVALUEREQUIRED;
 
index 9020efb..c2c2bfa 100644 (file)
@@ -110,7 +110,7 @@ namespace Microsoft.CSharp.RuntimeBinder
         public override DynamicMetaObject FallbackUnaryOperation(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
         {
             BinderHelper.ValidateBindArgument(target, nameof(target));
-            return BinderHelper.Bind(this, _binder, new[] {target}, _argumentInfo, errorSuggestion);
+            return BinderHelper.Bind(this, _binder, new[] { target }, _argumentInfo, errorSuggestion);
         }
     }
 }
index df73f1e..2e110c7 100644 (file)
@@ -775,13 +775,11 @@ namespace Microsoft.CSharp.RuntimeBinder
                         return GenerateConvert(call);
 
                     case PREDEFMETH.PM_EXPRESSION_NEWARRAYINIT:
-                    {
                         ExprList list = (ExprList)call.OptionalArguments;
                         return
                             Expression.NewArrayInit(
                                 ((ExprTypeOf)list.OptionalElement).SourceType.AssociatedSystemType,
                                 GetArgumentsFromArrayInit((ExprArrayInit)list.OptionalNextListNode));
-                    }
 
                     case PREDEFMETH.PM_EXPRESSION_ARRAYINDEX:
                     case PREDEFMETH.PM_EXPRESSION_ARRAYINDEX2:
index 4941f16..3817e0b 100644 (file)
@@ -1135,7 +1135,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
                         pexprDest = ExprFactory.CreateConstant(typeDest, cv);
                         return ConstCastResult.Success;
                     }
-                    valueInt = (long)(constSrc.UInt64Value& 0xFFFFFFFFFFFFFFFF);
+                    valueInt = (long)(constSrc.UInt64Value & 0xFFFFFFFFFFFFFFFF);
                 }
                 else
                 {
index c179ee4..443912b 100644 (file)
@@ -722,10 +722,10 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
         // invocation.
         private GroupToArgsBinderResult BindMethodGroupToArgumentsCore(BindingFlag bindFlags, ExprMemberGroup grp, Expr args, int carg, NamedArgumentsKind namedArgumentsKind)
         {
-            ArgInfos pargInfo = new ArgInfos {carg = carg};
+            ArgInfos pargInfo = new ArgInfos { carg = carg };
             FillInArgInfoFromArgList(pargInfo, args);
 
-            ArgInfos pOriginalArgInfo = new ArgInfos {carg = carg};
+            ArgInfos pOriginalArgInfo = new ArgInfos { carg = carg };
             FillInArgInfoFromArgList(pOriginalArgInfo, args);
 
             GroupToArgsBinder binder = new GroupToArgsBinder(this, bindFlags, grp, pargInfo, pOriginalArgInfo, namedArgumentsKind);
@@ -1069,7 +1069,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
         [Conditional("DEBUG")]
         private static void AssertObjectIsLvalue(Expr pObject)
         {
-            Debug.Assert (
+            Debug.Assert(
                        pObject == null ||  // statics are always lvalues
                        (((pObject.Flags & EXPRFLAG.EXF_LVALUE) != 0) && (pObject.Kind != ExpressionKind.Property)) ||
                        // things marked as lvalues have props/fields which are lvalues, with one exception:  props of structs
@@ -1319,7 +1319,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
 
                 return type;
 
-             NEXTI:
+            NEXTI:
                 ;
             }
 
index 4f338cc..6ebb848 100644 (file)
@@ -15,7 +15,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
         }
 
         protected ExprOperator(ExpressionKind kind, CType type, Expr call, MethPropWithInst userDefinedMethod)
-            : this (kind, type)
+            : this(kind, type)
         {
             OptionalUserDefinedCall = call;
             UserDefinedCallMethod = userDefinedMethod;
index f8d67be..3b9f6c1 100644 (file)
@@ -34,7 +34,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
             Expr lhs;
             if (assignment.LHS is ExprProperty prop)
             {
-                if (prop.OptionalArguments== null)
+                if (prop.OptionalArguments == null)
                 {
                     // Regular property.
                     lhs = Visit(prop);
@@ -113,7 +113,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
         {
             Debug.Assert(expr != null);
             Expr pObject;
-            if (expr.OptionalObject== null)
+            if (expr.OptionalObject == null)
             {
                 pObject = ExprFactory.CreateNull();
             }
@@ -244,7 +244,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
             }
 
             Expr pObject;
-            if (expr.MethWithInst.Meth().isStatic || expr.MemberGroup.OptionalObject== null)
+            if (expr.MethWithInst.Meth().isStatic || expr.MemberGroup.OptionalObject == null)
             {
                 pObject = ExprFactory.CreateNull();
             }
@@ -283,7 +283,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
         {
             Debug.Assert(expr != null);
             Expr pObject;
-            if (expr.PropWithTypeSlot.Prop().isStatic || expr.MemberGroup.OptionalObject== null)
+            if (expr.PropWithTypeSlot.Prop().isStatic || expr.MemberGroup.OptionalObject == null)
             {
                 pObject = ExprFactory.CreateNull();
             }
index 3650944..e691ba0 100644 (file)
@@ -94,7 +94,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics
         }
 
         // The SymWithType is considered NULL iff the Symbol is NULL.
-        public static implicit operator bool (SymWithType swt)
+        public static implicit operator bool(SymWithType swt)
         {
             return swt != null;
         }
index 9765082..5df305f 100644 (file)
@@ -39,7 +39,7 @@ namespace Microsoft.CSharp.RuntimeBinder
             public override bool Equals(object obj)
             {
                 Debug.Fail("Sub-optimal overload called. Check if this can be avoided.");
-                return obj is NameHashKey key &&  Equals(key);
+                return obj is NameHashKey key && Equals(key);
             }
 
             public override int GetHashCode() => Type.GetHashCode() ^ Name.GetHashCode();
@@ -789,10 +789,10 @@ namespace Microsoft.CSharp.RuntimeBinder
             {
                 // We use "IsEquivalentTo" so that unified local types match.
                 if (sym is AggregateSymbol agg)
-                if (agg.AssociatedSystemType.IsEquivalentTo(t.IsGenericType ? t.GetGenericTypeDefinition() : t))
-                {
-                    return agg;
-                }
+                    if (agg.AssociatedSystemType.IsEquivalentTo(t.IsGenericType ? t.GetGenericTypeDefinition() : t))
+                    {
+                        return agg;
+                    }
 
                 sym = sym.nextSameName;
             }
index 64f1561..58b582f 100644 (file)
@@ -67,7 +67,7 @@ namespace Microsoft.XmlSerializer.Generator
                     else if (ArgumentMatch(arg, "out") || ShortNameArgumentMatch(arg, "o"))
                     {
                         i++;
-                        if (i >= args.Length || codePath != null )
+                        if (i >= args.Length || codePath != null)
                         {
                             errs.Add(SR.Format(SR.ErrInvalidArgument, arg));
                         }
@@ -388,7 +388,7 @@ namespace Microsoft.XmlSerializer.Generator
         private bool ArgumentMatch(string arg, string formal)
         {
             // Full name format, eg: --assembly
-            if (arg.Length < 3 || arg[0] != '-' || arg[1] != '-' )
+            if (arg.Length < 3 || arg[0] != '-' || arg[1] != '-')
             {
                 return false;
             }
index b778e6c..8643d1a 100644 (file)
@@ -2741,60 +2741,60 @@ namespace Microsoft.CSharp
                 }
             }
 
-                    // replace + with . for nested classes.
-                    //
-                    var sb = new StringBuilder(s.Length + 10);
-                    if ((typeRef.Options & CodeTypeReferenceOptions.GlobalReference) != 0)
-                    {
-                        sb.Append("global::");
-                    }
+            // replace + with . for nested classes.
+            //
+            var sb = new StringBuilder(s.Length + 10);
+            if ((typeRef.Options & CodeTypeReferenceOptions.GlobalReference) != 0)
+            {
+                sb.Append("global::");
+            }
 
-                    string baseType = typeRef.BaseType;
+            string baseType = typeRef.BaseType;
 
-                    int lastIndex = 0;
-                    int currentTypeArgStart = 0;
-                    for (int i = 0; i < baseType.Length; i++)
-                    {
-                        switch (baseType[i])
+            int lastIndex = 0;
+            int currentTypeArgStart = 0;
+            for (int i = 0; i < baseType.Length; i++)
+            {
+                switch (baseType[i])
+                {
+                    case '+':
+                    case '.':
+                        sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
+                        sb.Append('.');
+                        i++;
+                        lastIndex = i;
+                        break;
+
+                    case '`':
+                        sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
+                        i++;    // skip the '
+                        int numTypeArgs = 0;
+                        while (i < baseType.Length && baseType[i] >= '0' && baseType[i] <= '9')
                         {
-                            case '+':
-                            case '.':
-                                sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
-                                sb.Append('.');
-                                i++;
-                                lastIndex = i;
-                                break;
-
-                            case '`':
-                                sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
-                                i++;    // skip the '
-                                int numTypeArgs = 0;
-                                while (i < baseType.Length && baseType[i] >= '0' && baseType[i] <= '9')
-                                {
-                                    numTypeArgs = numTypeArgs * 10 + (baseType[i] - '0');
-                                    i++;
-                                }
-
-                                GetTypeArgumentsOutput(typeRef.TypeArguments, currentTypeArgStart, numTypeArgs, sb);
-                                currentTypeArgStart += numTypeArgs;
-
-                                // Arity can be in the middle of a nested type name, so we might have a . or + after it.
-                                // Skip it if so.
-                                if (i < baseType.Length && (baseType[i] == '+' || baseType[i] == '.'))
-                                {
-                                    sb.Append('.');
-                                    i++;
-                                }
-
-                                lastIndex = i;
-                                break;
+                            numTypeArgs = numTypeArgs * 10 + (baseType[i] - '0');
+                            i++;
+                        }
+
+                        GetTypeArgumentsOutput(typeRef.TypeArguments, currentTypeArgStart, numTypeArgs, sb);
+                        currentTypeArgStart += numTypeArgs;
+
+                        // Arity can be in the middle of a nested type name, so we might have a . or + after it.
+                        // Skip it if so.
+                        if (i < baseType.Length && (baseType[i] == '+' || baseType[i] == '.'))
+                        {
+                            sb.Append('.');
+                            i++;
                         }
-                    }
 
-                    if (lastIndex < baseType.Length)
-                        sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex)));
+                        lastIndex = i;
+                        break;
+                }
+            }
 
-                    return sb.ToString();
+            if (lastIndex < baseType.Length)
+                sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex)));
+
+            return sb.ToString();
         }
 
         private string GetTypeArgumentsOutput(CodeTypeReferenceCollection typeArguments)
index cee045d..4eeaa42 100644 (file)
@@ -2450,58 +2450,58 @@ namespace Microsoft.VisualBasic
                 }
             }
 
-                var sb = new StringBuilder(baseType.Length + 10);
-                if ((typeRef.Options & CodeTypeReferenceOptions.GlobalReference) != 0)
-                {
-                    sb.Append("Global.");
-                }
+            var sb = new StringBuilder(baseType.Length + 10);
+            if ((typeRef.Options & CodeTypeReferenceOptions.GlobalReference) != 0)
+            {
+                sb.Append("Global.");
+            }
 
-                int lastIndex = 0;
-                int currentTypeArgStart = 0;
-                for (int i = 0; i < baseType.Length; i++)
+            int lastIndex = 0;
+            int currentTypeArgStart = 0;
+            for (int i = 0; i < baseType.Length; i++)
+            {
+                switch (baseType[i])
                 {
-                    switch (baseType[i])
-                    {
-                        case '+':
-                        case '.':
-                            sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
-                            sb.Append('.');
-                            i++;
-                            lastIndex = i;
-                            break;
+                    case '+':
+                    case '.':
+                        sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
+                        sb.Append('.');
+                        i++;
+                        lastIndex = i;
+                        break;
 
-                        case '`':
-                            sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
-                            i++;    // skip the '
-                            int numTypeArgs = 0;
-                            while (i < baseType.Length && baseType[i] >= '0' && baseType[i] <= '9')
-                            {
-                                numTypeArgs = numTypeArgs * 10 + (baseType[i] - '0');
-                                i++;
-                            }
+                    case '`':
+                        sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
+                        i++;    // skip the '
+                        int numTypeArgs = 0;
+                        while (i < baseType.Length && baseType[i] >= '0' && baseType[i] <= '9')
+                        {
+                            numTypeArgs = numTypeArgs * 10 + (baseType[i] - '0');
+                            i++;
+                        }
 
-                            GetTypeArgumentsOutput(typeRef.TypeArguments, currentTypeArgStart, numTypeArgs, sb);
-                            currentTypeArgStart += numTypeArgs;
+                        GetTypeArgumentsOutput(typeRef.TypeArguments, currentTypeArgStart, numTypeArgs, sb);
+                        currentTypeArgStart += numTypeArgs;
 
-                            // Arity can be in the middle of a nested type name, so we might have a . or + after it.
-                            // Skip it if so.
-                            if (i < baseType.Length && (baseType[i] == '+' || baseType[i] == '.'))
-                            {
-                                sb.Append('.');
-                                i++;
-                            }
+                        // Arity can be in the middle of a nested type name, so we might have a . or + after it.
+                        // Skip it if so.
+                        if (i < baseType.Length && (baseType[i] == '+' || baseType[i] == '.'))
+                        {
+                            sb.Append('.');
+                            i++;
+                        }
 
-                            lastIndex = i;
-                            break;
-                    }
+                        lastIndex = i;
+                        break;
                 }
+            }
 
-                if (lastIndex < baseType.Length)
-                {
-                    sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex)));
-                }
+            if (lastIndex < baseType.Length)
+            {
+                sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex)));
+            }
 
-                return sb.ToString();
+            return sb.ToString();
         }
 
         private string GetTypeOutputWithoutArrayPostFix(CodeTypeReference typeRef)
index e6d73f3..ef1095e 100644 (file)
@@ -555,11 +555,11 @@ namespace System.Collections.Concurrent
                 private readonly IEnumerator<TSource> _sharedReader;
                 private readonly SharedLong _sharedIndex; //initial value -1
 
-                private volatile KeyValuePair<long, TSource>[]? _fillBuffer;  // intermediate buffer to reduce locking
-                private volatile int _fillBufferSize;               // actual number of elements in _FillBuffer. Will start
-                                                                     // at _FillBuffer.Length, and might be reduced during the last refill
-                private volatile int _fillBufferCurrentPosition;    //shared value to be accessed by Interlock.Increment only
-                private volatile int _activeCopiers;               //number of active copiers
+                private volatile KeyValuePair<long, TSource>[]? _fillBuffer; // intermediate buffer to reduce locking
+                private volatile int _fillBufferSize;            // actual number of elements in _FillBuffer. Will start
+                                                                 // at _FillBuffer.Length, and might be reduced during the last refill
+                private volatile int _fillBufferCurrentPosition; //shared value to be accessed by Interlock.Increment only
+                private volatile int _activeCopiers;             //number of active copiers
 
                 //fields shared by all partitions that this Enumerable owns, their allocation is deferred
                 private readonly SharedBool _hasNoElementsLeft; // no elements left at all.
index c0c3547..cc8ac35 100644 (file)
@@ -169,7 +169,7 @@ namespace System.Collections.Immutable
             {
                 return ref this.Root.ItemRef(index);
             }
-            #endif
+#endif
 
             #endregion
 
index ab228d4..f809126 100644 (file)
@@ -53,13 +53,15 @@ namespace System.Collections.Specialized
         }
 
         [Obsolete("Please use NameObjectCollectionBase(IEqualityComparer) instead.")]
-        protected NameObjectCollectionBase(IHashCodeProvider hashProvider, IComparer comparer) {
+        protected NameObjectCollectionBase(IHashCodeProvider hashProvider, IComparer comparer)
+        {
             _keyComparer = new CompatibleComparer(hashProvider, comparer);
             Reset();
         }
 
         [Obsolete("Please use NameObjectCollectionBase(Int32, IEqualityComparer) instead.")]
-        protected NameObjectCollectionBase(int capacity, IHashCodeProvider hashProvider, IComparer comparer) {
+        protected NameObjectCollectionBase(int capacity, IHashCodeProvider hashProvider, IComparer comparer)
+        {
             _keyComparer = new CompatibleComparer(hashProvider, comparer);
             Reset(capacity);
         }
index cff5546..38c8813 100644 (file)
@@ -48,7 +48,8 @@ namespace System.Collections.Specialized
 
         [Obsolete("Please use NameValueCollection(IEqualityComparer) instead.")]
         public NameValueCollection(IHashCodeProvider hashProvider, IComparer comparer)
-            : base(hashProvider, comparer) {
+            : base(hashProvider, comparer)
+        {
         }
 
         /// <devdoc>
@@ -89,7 +90,8 @@ namespace System.Collections.Specialized
 
         [Obsolete("Please use NameValueCollection(Int32, IEqualityComparer) instead.")]
         public NameValueCollection(int capacity, IHashCodeProvider hashProvider, IComparer comparer)
-            : base(capacity, hashProvider, comparer) {
+            : base(capacity, hashProvider, comparer)
+        {
         }
 
         protected NameValueCollection(SerializationInfo info, StreamingContext context) : base(info, context)
index 2e782d0..30c9b96 100644 (file)
@@ -422,7 +422,8 @@ namespace System.Collections.Specialized
 #endregion
 
 #region IDeserializationCallback implementation
-        void IDeserializationCallback.OnDeserialization(object sender) {
+        void IDeserializationCallback.OnDeserialization(object sender)
+        {
             OnDeserialization(sender);
         }
 
index 8c76602..9ac4f74 100644 (file)
@@ -177,7 +177,7 @@ namespace System.Collections.Generic
                     }
 
                     return result;
-               }
+                }
             }
 
             internal override bool InOrderTreeWalk(TreeWalkPredicate<T> action)
index 0abaf27..82dc723 100644 (file)
@@ -108,7 +108,7 @@ namespace Microsoft.Internal.Collections
 
             public void Add(object item)
             {
-                _collectionOfT.Add((T) item);
+                _collectionOfT.Add((T)item);
             }
 
             public void Clear()
index 303eda8..3ee2140 100644 (file)
@@ -108,7 +108,7 @@ namespace System.ComponentModel.Composition
             //        CreationPolicy.Any.Equals(definition.Metadata[CompositionConstants.PartCreationPolicyMetadataName]) ||
             //        policy.Equals(definition.Metadata[CompositionConstants.PartCreationPolicyMetadataName]);
 
-            return  Expression.MakeBinary(ExpressionType.OrElse,
+            return Expression.MakeBinary(ExpressionType.OrElse,
                         Expression.MakeBinary(ExpressionType.OrElse,
                             Expression.Not(CreateMetadataContainsKeyExpression(parameter, CompositionConstants.PartCreationPolicyMetadataName)),
                             CreateMetadataValueEqualsExpression(parameter, CreationPolicy.Any, CompositionConstants.PartCreationPolicyMetadataName)),
@@ -130,7 +130,7 @@ namespace System.ComponentModel.Composition
             //    definition.Metadata.ContainsKey(CompositionServices.ExportTypeIdentity) &&
             //        requiredTypeIdentity.Equals(definition.Metadata[CompositionConstants.ExportTypeIdentityMetadataName]);
 
-            return  Expression.MakeBinary(ExpressionType.AndAlso,
+            return Expression.MakeBinary(ExpressionType.AndAlso,
                         CreateMetadataContainsKeyExpression(parameter, CompositionConstants.ExportTypeIdentityMetadataName),
                         CreateMetadataValueEqualsExpression(parameter, requiredTypeIdentity, CompositionConstants.ExportTypeIdentityMetadataName));
         }
@@ -148,7 +148,7 @@ namespace System.ComponentModel.Composition
             }
 
             // definition.Metadata.ContainsKey(constantKey)
-            return  Expression.Call(
+            return Expression.Call(
                         Expression.Property(parameter, ConstraintServices._exportDefinitionMetadataProperty),
                         ConstraintServices._metadataContainsKeyMethod,
                         Expression.Constant(constantKey));
@@ -195,7 +195,7 @@ namespace System.ComponentModel.Composition
             }
 
             // constantValue.Equals(definition.Metadata[CompositionServices.PartCreationPolicyMetadataName])
-            return  Expression.Call(
+            return Expression.Call(
                         Expression.Constant(constantValue),
                         ConstraintServices._metadataEqualsMethod,
                         Expression.Call(
index 15bfb4d..0e70ea9 100644 (file)
@@ -81,7 +81,7 @@ namespace System.ComponentModel.Composition.Hosting
         ///     </para>
         /// </remarks>
         public AggregateExportProvider(IEnumerable<ExportProvider> providers)
-            : this((providers!= null) ? providers.AsArray() : null)
+            : this((providers != null) ? providers.AsArray() : null)
         {
         }
 
index 1ed182e..ed3e532 100644 (file)
@@ -21,7 +21,7 @@ namespace System.ComponentModel.Composition.Hosting
         private readonly ICompositionElement _definitionOrigin = null;
         private readonly ReflectionContext _reflectionContext = null;
 
-        public ApplicationCatalog() {}
+        public ApplicationCatalog() { }
 
         public ApplicationCatalog(ICompositionElement definitionOrigin)
         {
@@ -59,9 +59,9 @@ namespace System.ComponentModel.Composition.Hosting
                 : new DirectoryCatalog(location, pattern);
         }
 
-//  Note:
-//      Creating a catalog does not cause change notifications to propagate, For some reason the DeploymentCatalog did, but that is a bug.
-//      InnerCatalog is delay evaluated, from data supplied at construction time and so does not propagate change notifications
+        //  Note:
+        //      Creating a catalog does not cause change notifications to propagate, For some reason the DeploymentCatalog did, but that is a bug.
+        //      InnerCatalog is delay evaluated, from data supplied at construction time and so does not propagate change notifications
         private AggregateCatalog InnerCatalog
         {
             get
@@ -85,7 +85,7 @@ namespace System.ComponentModel.Composition.Hosting
                             string relativeSearchPath = AppDomain.CurrentDomain.RelativeSearchPath;
                             if (!string.IsNullOrEmpty(relativeSearchPath))
                             {
-                                string[] probingPaths = relativeSearchPath.Split(new char[] {';'}, StringSplitOptions.RemoveEmptyEntries);
+                                string[] probingPaths = relativeSearchPath.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                                 foreach (var probingPath in probingPaths)
                                 {
                                     var path = Path.Combine(location, probingPath);
index bf62184..35ddb14 100644 (file)
@@ -32,7 +32,7 @@ namespace System.ComponentModel.Composition.Hosting
         }
 
         public ComposablePartExportProvider(bool isThreadSafe)
-            :this(isThreadSafe ? CompositionOptions.IsThreadSafe : CompositionOptions.Default)
+            : this(isThreadSafe ? CompositionOptions.IsThreadSafe : CompositionOptions.Default)
         {
         }
 
@@ -180,7 +180,7 @@ namespace System.ComponentModel.Composition.Hosting
             }
         }
 
-/// <summary>
+        /// <summary>
         /// Returns all exports that match the conditions of the specified import.
         /// </summary>
         /// <param name="definition">The <see cref="ImportDefinition"/> that defines the conditions of the
index 57da31e..b37bf6b 100644 (file)
@@ -90,7 +90,7 @@ namespace System.ComponentModel.Composition.Hosting
         /// <exception cref="ArgumentException">
         ///     <paramref name="providers"/> contains an element that is <see langword="null"/>.
         /// </exception>
-        public CompositionContainer(ComposablePartCatalog catalog, params ExportProvider[] providers):
+        public CompositionContainer(ComposablePartCatalog catalog, params ExportProvider[] providers) :
             this(catalog, false, providers)
         {
         }
@@ -212,7 +212,7 @@ namespace System.ComponentModel.Composition.Hosting
                 _disposableRootProvider = _rootProvider as IDisposable;
             }
 
-//Insert Composition Service
+            //Insert Composition Service
             if (compositionOptions.HasFlag(CompositionOptions.ExportCompositionService))
             {
                 this.ComposeExportedValue<ICompositionService>(new CompositionServiceShim(this));
index 3a5d190..c25ef88 100644 (file)
@@ -10,9 +10,9 @@ namespace System.ComponentModel.Composition.Hosting
     [Flags]
     public enum CompositionOptions
     {
-        Default                = 0x0000,
-        DisableSilentRejection = 0x0001,
-        IsThreadSafe           = 0x0002,
+        Default                  = 0x0000,
+        DisableSilentRejection   = 0x0001,
+        IsThreadSafe             = 0x0002,
         ExportCompositionService = 0x0004
     }
 }
index ffbe6b8..e4cef2e 100644 (file)
@@ -37,7 +37,7 @@ namespace System.ComponentModel.Composition.Hosting
             InitializeCompositionScopeDefinition(catalog, children, null);
         }
 
-/// <summary>
+        /// <summary>
         /// Initializes a new instance of the <see cref="CompositionScopeDefinition"/> class.
         /// </summary>
         /// <param name="catalog">The catalog.</param>
@@ -52,7 +52,7 @@ namespace System.ComponentModel.Composition.Hosting
             InitializeCompositionScopeDefinition(catalog, children, publicSurface);
         }
 
-/// <summary>
+        /// <summary>
         /// Initializes a new instance of the <see cref="CompositionScopeDefinition"/> class.
         /// </summary>
         /// <param name="catalog">The catalog.</param>
@@ -137,7 +137,7 @@ namespace System.ComponentModel.Composition.Hosting
                 ThrowIfDisposed();
                 if (_publicSurface == null)
                 {
-                    return this.SelectMany( (p) => p.ExportDefinitions );
+                    return this.SelectMany((p) => p.ExportDefinitions);
                 }
 
                 return _publicSurface;
index 38a0392..93cf9ac 100644 (file)
@@ -115,7 +115,7 @@ namespace System.ComponentModel.Composition.Hosting
             }
         }
 
-internal static string GetTypeIdentityFromExport(this MemberInfo member, Type typeIdentityType)
+        internal static string GetTypeIdentityFromExport(this MemberInfo member, Type typeIdentityType)
         {
             if (typeIdentityType != null)
             {
@@ -154,7 +154,7 @@ internal static string GetTypeIdentityFromExport(this MemberInfo member, Type ty
             return string.IsNullOrEmpty(export.ContractName);
         }
 
-internal static Type GetContractTypeFromImport(this IAttributedImport import, ImportType importType)
+        internal static Type GetContractTypeFromImport(this IAttributedImport import, ImportType importType)
         {
             if (import.ContractType != null)
             {
@@ -224,7 +224,7 @@ internal static Type GetContractTypeFromImport(this IAttributedImport import, Im
                 bool hasConstraints = false;
                 object[] genericParameterConstraints = new object[genericArguments.Length];
                 GenericParameterAttributes[] genericParameterAttributes = new GenericParameterAttributes[genericArguments.Length];
-                for (int i=0; i< genericArguments.Length; i++)
+                for (int i = 0; i < genericArguments.Length; i++)
                 {
                     Type genericArgument = genericArguments[i];
 
index 0cef10d..1270460 100644 (file)
@@ -47,7 +47,7 @@ namespace System.ComponentModel.Composition.Hosting
             }
         }
 
-/// <summary>
+        /// <summary>
         /// Releases unmanaged and - optionally - managed resources
         /// </summary>
         /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
@@ -173,12 +173,12 @@ namespace System.ComponentModel.Composition.Hosting
         /// </summary>
         public event EventHandler<ComposablePartCatalogChangeEventArgs> Changed;
 
-/// <summary>
+        /// <summary>
         /// Notify when the contents of the Catalog is changing.
         /// </summary>
         public event EventHandler<ComposablePartCatalogChangeEventArgs> Changing;
 
-/// <summary>
+        /// <summary>
         /// Raises the <see cref="Changed"/> event.
         /// </summary>
         /// <param name="e">The <see cref="System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs"/> instance containing the event data.</param>
index 61d05b7..ed0c221 100644 (file)
@@ -53,7 +53,7 @@ namespace System.ComponentModel.Composition.Hosting
                     var reply = _metadata;
                     if (reply == null)
                     {
-                        reply = new Dictionary<string, object> (_sourceDefinition.Metadata);
+                        reply = new Dictionary<string, object>(_sourceDefinition.Metadata);
                         reply.Remove(CompositionConstants.ImportSourceMetadataName);
                         _metadata = reply;
                     }
index 3c9416e..57f8d8c 100644 (file)
@@ -81,7 +81,7 @@ namespace System.ComponentModel.Composition.Hosting
             return false;
         }
 
-/// <summary>
+        /// <summary>
         /// Determines whether the part contains a metadata entry with the specified key.
         /// </summary>
         /// <param name="part">The part.</param>
index b08f97e..0bcd107 100644 (file)
@@ -8,8 +8,7 @@ namespace System.ComponentModel.Composition
     ///     Specifies that an attribute can be used to provide metadata for a type, property, field,
     ///     or method marked with the <see cref="ExportAttribute"/>.
     /// </summary>
-    [AttributeUsage(AttributeTargets.Class,
-                    AllowMultiple=false, Inherited=true)]
+    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
     public sealed class MetadataAttributeAttribute : Attribute
     {
         /// <summary>
index e19456d..84853dd 100644 (file)
@@ -59,17 +59,17 @@ namespace System.ComponentModel.Composition
     {
         public delegate object MetadataViewFactory(IDictionary<string, object> metadata);
 
-        public const string MetadataViewType       = "MetadataViewType";
-        public const string MetadataItemKey        = "MetadataItemKey";
-        public const string MetadataItemTargetType = "MetadataItemTargetType";
-        public const string MetadataItemSourceType = "MetadataItemSourceType";
-        public const string MetadataItemValue      = "MetadataItemValue";
-        public const string MetadataViewFactoryName= "Create";
+        public const string MetadataViewType        = "MetadataViewType";
+        public const string MetadataItemKey         = "MetadataItemKey";
+        public const string MetadataItemTargetType  = "MetadataItemTargetType";
+        public const string MetadataItemSourceType  = "MetadataItemSourceType";
+        public const string MetadataItemValue       = "MetadataItemValue";
+        public const string MetadataViewFactoryName = "Create";
 
         private static readonly Lock _lock = new Lock();
         private static readonly Dictionary<Type, MetadataViewFactory> _metadataViewFactories = new Dictionary<Type, MetadataViewFactory>();
         private static readonly AssemblyName ProxyAssemblyName = new AssemblyName(string.Format(CultureInfo.InvariantCulture, "MetadataViewProxies_{0}", Guid.NewGuid()));
-        private static ModuleBuilder    transparentProxyModuleBuilder;
+        private static ModuleBuilder transparentProxyModuleBuilder;
 
         private static readonly Type[] CtorArgumentTypes = new Type[] { typeof(IDictionary<string, object>) };
         private static readonly MethodInfo _mdvDictionaryTryGet = CtorArgumentTypes[0].GetMethod("TryGetValue");
index 509c5bd..31c82c4 100644 (file)
@@ -135,9 +135,9 @@ namespace System.ComponentModel.Composition
             }
 
             // If the Metadata dictionary is cast compatible with the passed in type
-            if (ExportServices.IsDefaultMetadataViewType(metadataViewType)
-            ||  metadataViewType.IsInterface
-            ||  ExportServices.IsDictionaryConstructorViewType(metadataViewType))
+            if (ExportServices.IsDefaultMetadataViewType(metadataViewType) ||
+                metadataViewType.IsInterface ||
+                ExportServices.IsDictionaryConstructorViewType(metadataViewType))
             {
                 return true;
             }
index 997beb0..565858b 100644 (file)
@@ -32,7 +32,7 @@ namespace System.ComponentModel.Composition.Primitives
         ///     <see cref="ComposablePartDefinition"/>.
         /// </value>
         /// <remarks>
-         ///     <note type="inheritinfo">
+        ///     <note type="inheritinfo">
         ///         Overrides of this property should never return <see langword="null"/>.
         ///         If the <see cref="ComposablePart"/> objects created by the
         ///         <see cref="ComposablePartDefinition"/> do not provide exported values, return
index 0ceadf0..f37d88b 100644 (file)
@@ -51,7 +51,7 @@ namespace System.ComponentModel.Composition.Primitives
             // This array should contains a lit of all argument types, and the last one is the return type (could be void)
             Type[] parameterTypes = new Type[parameters.Length + 1];
             parameterTypes[parameters.Length] = _method.ReturnType;
-            for (int i = 0; i < parameters.Length; i++ )
+            for (int i = 0; i < parameters.Length; i++)
             {
                 parameterTypes[i] = parameters[i].ParameterType;
             }
index 6213a58..1085c17 100644 (file)
@@ -51,7 +51,7 @@ namespace System.ComponentModel.Composition.Primitives
             }
         }
 
-internal static bool IsImportDependentOnPart(this ImportDefinition import, ComposablePartDefinition part, ExportDefinition export, bool expandGenerics)
+        internal static bool IsImportDependentOnPart(this ImportDefinition import, ComposablePartDefinition part, ExportDefinition export, bool expandGenerics)
         {
             import = import.GetProductImportDefinition();
             if (expandGenerics)
index 3dd2fec..450c29b 100644 (file)
@@ -12,7 +12,7 @@ namespace System.ComponentModel.Composition.ReflectionModel
         private static readonly MethodInfo _createStronglyTypedExportFactoryOfT = typeof(ExportFactoryCreator).GetMethod("CreateStronglyTypedExportFactoryOfT", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
         private static readonly MethodInfo _createStronglyTypedExportFactoryOfTM = typeof(ExportFactoryCreator).GetMethod("CreateStronglyTypedExportFactoryOfTM", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
 
-        private readonly Type    _exportFactoryType;
+        private readonly Type _exportFactoryType;
 
         public ExportFactoryCreator(Type exportFactoryType)
         {
@@ -29,7 +29,7 @@ namespace System.ComponentModel.Composition.ReflectionModel
             MethodInfo genericMethod = null;
             if (metadataViewType == null)
             {
-                 genericMethod = _createStronglyTypedExportFactoryOfT.MakeGenericMethod(exportType);
+                genericMethod = _createStronglyTypedExportFactoryOfT.MakeGenericMethod(exportType);
             }
             else
             {
@@ -71,7 +71,7 @@ namespace System.ComponentModel.Composition.ReflectionModel
             var metadataView = AttributedModelServices.GetMetadataView<M>(export.Metadata);
             object[] args = { exportLifetimeContextCreator, metadataView };
 
-            var instance =  Activator.CreateInstance(constructed, args);
+            var instance = Activator.CreateInstance(constructed, args);
 
             return instance;
         }
index 5ec6e9b..292eeba 100644 (file)
@@ -187,7 +187,7 @@ namespace System.ComponentModel.Composition.ReflectionModel
         {
             RequiresRunning();
             Requires.NotNull(definition, nameof(definition));
-            Requires.NotNull(exports, nameof(exports));;
+            Requires.NotNull(exports, nameof(exports));
 
             ImportingItem item = GetImportingItemFromDefinition(definition);
             if (item == null)
index 0f576c3..474615b 100644 (file)
@@ -322,7 +322,7 @@ namespace System.ComponentModel.Composition.ReflectionModel
         }
     }
 
-internal class ReflectionPartCreationInfo : IReflectionPartCreationInfo
+    internal class ReflectionPartCreationInfo : IReflectionPartCreationInfo
     {
         private readonly Lazy<Type> _partType;
         private readonly Lazy<IEnumerable<ImportDefinition>> _imports;
index 57d5437..190bb7f 100644 (file)
@@ -14,8 +14,8 @@ namespace System.ComponentModel.Composition.ReflectionModel
 
         public ReflectionParameter(ParameterInfo parameter)
         {
-           if (parameter == null)
-           {
+            if (parameter == null)
+            {
                 throw new ArgumentNullException(nameof(parameter));
             }
 
index b54faa4..d89bb6a 100644 (file)
@@ -48,7 +48,7 @@ namespace System.ComponentModel
         /// </summary>
         public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
         {
-            return s_values ?? (s_values = new StandardValuesCollection(new object[] {true, false}));
+            return s_values ?? (s_values = new StandardValuesCollection(new object[] { true, false }));
         }
 
         /// <summary>
index 7e38a7f..599153f 100644 (file)
@@ -14,7 +14,7 @@ namespace System.ComponentModel.Design
     public abstract class DesignerOptionService : IDesignerOptionService
     {
         private DesignerOptionCollection _options;
-        private static readonly char[] s_slash = {'\\'};
+        private static readonly char[] s_slash = { '\\' };
 
         /// <summary>
         /// Returns the options collection for this service. There is
index a7b19a4..a85b08a 100644 (file)
@@ -122,7 +122,7 @@ namespace System.ComponentModel
             }
         }
 
-        protected string[] TabClassNames => (string[]) _tabClassNames?.Clone();
+        protected string[] TabClassNames => (string[])_tabClassNames?.Clone();
 
         /// <summary>
         /// Gets the scopes of tabs for this System.ComponentModel.Design.PropertyTabAttribute, from System.ComponentModel.Design.PropertyTabScope.
index d6941fd..0d6b7a4 100644 (file)
@@ -179,7 +179,7 @@ namespace System.ComponentModel
         private static LicenseProvider GetCachedProviderInstance(Type providerType)
         {
             Debug.Assert(providerType != null, "Type cannot ever be null");
-            return (LicenseProvider) s_providerInstances?[providerType];
+            return (LicenseProvider)s_providerInstances?[providerType];
         }
 
         /// <summary>
index 2f9340c..5149b75 100644 (file)
@@ -131,7 +131,7 @@ namespace System.ComponentModel
                 lock (this)
                 {
                     _site?.Container?.Remove(this);
-                    ((EventHandler) _events?[s_eventDisposed])?.Invoke(this, EventArgs.Empty);
+                    ((EventHandler)_events?[s_eventDisposed])?.Invoke(this, EventArgs.Empty);
                 }
             }
         }
index 9311841..2198db2 100644 (file)
@@ -173,13 +173,13 @@ namespace System.ComponentModel
         /// Gets the name of the category that the member belongs to, as specified
         /// in the <see cref='System.ComponentModel.CategoryAttribute'/>.
         /// </summary>
-        public virtual string Category => _category ?? (_category = ((CategoryAttribute) Attributes[typeof(CategoryAttribute)]).Category);
+        public virtual string Category => _category ?? (_category = ((CategoryAttribute)Attributes[typeof(CategoryAttribute)]).Category);
 
         /// <summary>
         /// Gets the description of the member as specified in the <see cref='System.ComponentModel.DescriptionAttribute'/>.
         /// </summary>
         public virtual string Description => _description ??
-                                             (_description = ((DescriptionAttribute) Attributes[typeof(DescriptionAttribute)]).Description);
+                                             (_description = ((DescriptionAttribute)Attributes[typeof(DescriptionAttribute)]).Description);
 
         /// <summary>
         /// Gets a value indicating whether the member is browsable as specified in the
@@ -455,7 +455,8 @@ namespace System.ComponentModel
         protected static ISite GetSite(object component) => (component as IComponent)?.Site;
 
         [Obsolete("This method has been deprecated. Use GetInvocationTarget instead. https://go.microsoft.com/fwlink/?linkid=14202")]
-        protected static object GetInvokee(Type componentClass, object component) {
+        protected static object GetInvokee(Type componentClass, object component)
+        {
 
             if (componentClass == null)
             {
index 8b6705a..72f0d93 100644 (file)
@@ -107,9 +107,9 @@ namespace System.ComponentModel
             }
             else if (destinationType == typeof(InstanceDescriptor))
             {
-                ConstructorInfo ci = NullableType.GetConstructor(new Type[] {UnderlyingType});
+                ConstructorInfo ci = NullableType.GetConstructor(new Type[] { UnderlyingType });
                 Debug.Assert(ci != null, "Couldn't find constructor");
-                return new InstanceDescriptor(ci, new object[] {value}, true);
+                return new InstanceDescriptor(ci, new object[] { value }, true);
             }
             else if (value == null)
             {
index 14c3c38..68d24a2 100644 (file)
@@ -383,7 +383,7 @@ namespace System.ComponentModel
         {
             if (component != null)
             {
-                ((EventHandler) _valueChangedHandlers?[component])?.Invoke(component, e);
+                ((EventHandler)_valueChangedHandlers?[component])?.Invoke(component, e);
             }
         }
 
index 601dcd4..ff855a0 100644 (file)
@@ -94,7 +94,7 @@ namespace System.ComponentModel
                 if (value != null)
                 {
                     // Try the reference service first.
-                    IReferenceService refSvc = (IReferenceService) context?.GetService(typeof(IReferenceService));
+                    IReferenceService refSvc = (IReferenceService)context?.GetService(typeof(IReferenceService));
                     if (refSvc != null)
                     {
                         string name = refSvc.GetName(value);
index 245777f..100d063 100644 (file)
@@ -153,11 +153,14 @@ namespace System.ComponentModel
 
                 if (changeService != null)
                 {
-                    try {
+                    try
+                    {
                         changeService.OnComponentChanging(component, this);
                     }
-                    catch (CheckoutException coEx) {
-                        if (coEx == CheckoutException.Canceled) {
+                    catch (CheckoutException coEx)
+                    {
+                        if (coEx == CheckoutException.Canceled)
+                        {
                             return;
                         }
                         throw;
@@ -424,11 +427,14 @@ namespace System.ComponentModel
 
                 if (changeService != null)
                 {
-                    try {
+                    try
+                    {
                         changeService.OnComponentChanging(component, this);
                     }
-                    catch (CheckoutException coEx) {
-                        if (coEx == CheckoutException.Canceled) {
+                    catch (CheckoutException coEx)
+                    {
+                        if (coEx == CheckoutException.Canceled)
+                        {
                             return;
                         }
                         throw;
index 46ee18c..23edb7f 100644 (file)
@@ -565,7 +565,7 @@ namespace System.ComponentModel
             {
                 // Check our association table for a match.
                 Hashtable assocTable = AssociationTable;
-                IList associations = (IList) assocTable?[primary];
+                IList associations = (IList)assocTable?[primary];
                 if (associations != null)
                 {
                     lock (associations)
@@ -2401,7 +2401,7 @@ namespace System.ComponentModel
             }
 
             Hashtable assocTable = AssociationTable;
-            IList associations = (IList) assocTable?[primary];
+            IList associations = (IList)assocTable?[primary];
             if (associations != null)
             {
                 lock (associations)
index 960fa2f..7a6602b 100644 (file)
@@ -76,7 +76,7 @@ namespace System.Composition
         ///      A <see cref="string"/> containing the contract name to export the type or member
         ///      marked with this attribute, under. The default value is an empty string ("").
         /// </value>
-        public string ContractName { get;  }
+        public string ContractName { get; }
 
         /// <summary>
         ///     Get the contract type that is exported by the member that this attribute is attached to.
index 54da7df..7f2de39 100644 (file)
@@ -238,7 +238,7 @@ namespace System.Composition.TypedParts.Discovery
 
             public int GetHashCode(ParameterInfo obj)
             {
-                return HashHelpers.Combine(obj.Position.GetHashCode(),  obj.Member.GetHashCode());
+                return HashHelpers.Combine(obj.Position.GetHashCode(), obj.Member.GetHashCode());
             }
 
             public bool Equals(ParameterInfo x, ParameterInfo y)
index 0283dc3..4a4013b 100644 (file)
@@ -31,37 +31,37 @@ namespace System.Configuration
         protected const string ConfigSectionsTag = "configSections";
 
         protected const string SectionTag = "section";
-        protected const string  SectionNameAttribute = "name";
-        protected const string  SectionTypeAttribute = "type";
-        protected const string  SectionAllowLocationAttribute = "allowLocation";
-        protected const string  SectionAllowDefinitionAttribute = "allowDefinition";
-        protected const string   AllowDefinitionEverywhere = "Everywhere";
-        protected const string   AllowDefinitionMachineOnly = "MachineOnly";
-        protected const string   AllowDefinitionMachineToApplication = "MachineToApplication";
-        protected const string   AllowDefinitionMachineToWebRoot = "MachineToWebRoot";
-        protected const string  SectionAllowExeDefinitionAttribute = "allowExeDefinition";
-        protected const string   AllowExeDefinitionMachineToRoaming = "MachineToRoamingUser";
-        protected const string   AllowExeDefinitionMachineToLocal = "MachineToLocalUser";
-        protected const string  SectionRestartonExternalChangesAttribute = "restartOnExternalChanges";
-        protected const string  SectionRequirePermissionAttribute = "requirePermission";
-        internal const string   SectionOverrideModeDefaultAttribute = "overrideModeDefault";
+        protected const string SectionNameAttribute = "name";
+        protected const string SectionTypeAttribute = "type";
+        protected const string SectionAllowLocationAttribute = "allowLocation";
+        protected const string SectionAllowDefinitionAttribute = "allowDefinition";
+        protected const string AllowDefinitionEverywhere = "Everywhere";
+        protected const string AllowDefinitionMachineOnly = "MachineOnly";
+        protected const string AllowDefinitionMachineToApplication = "MachineToApplication";
+        protected const string AllowDefinitionMachineToWebRoot = "MachineToWebRoot";
+        protected const string SectionAllowExeDefinitionAttribute = "allowExeDefinition";
+        protected const string AllowExeDefinitionMachineToRoaming = "MachineToRoamingUser";
+        protected const string AllowExeDefinitionMachineToLocal = "MachineToLocalUser";
+        protected const string SectionRestartonExternalChangesAttribute = "restartOnExternalChanges";
+        protected const string SectionRequirePermissionAttribute = "requirePermission";
+        internal const string SectionOverrideModeDefaultAttribute = "overrideModeDefault";
 
         internal const string OverrideModeInherit = "Inherit";
         internal const string OverrideModeAllow = "Allow";
         internal const string OverrideModeDeny = "Deny";
 
         protected const string SectionGroupTag = "sectionGroup";
-        protected const string  SectionGroupNameAttribute = "name";
-        protected const string  SectionGroupTypeAttribute = "type";
+        protected const string SectionGroupNameAttribute = "name";
+        protected const string SectionGroupTypeAttribute = "type";
 
         protected const string RemoveTag = "remove";
         protected const string ClearTag = "clear";
 
         protected const string LocationTag = "location";
-        protected const string  LocationPathAttribute = "path";
-        internal const string   LocationAllowOverrideAttribute = "allowOverride";
-        internal const string   LocationOverrideModeAttribute = "overrideMode";
-        protected const string  LocationInheritInChildApplicationsAttribute = "inheritInChildApplications";
+        protected const string LocationPathAttribute = "path";
+        internal const string LocationAllowOverrideAttribute = "allowOverride";
+        internal const string LocationOverrideModeAttribute = "overrideMode";
+        protected const string LocationInheritInChildApplicationsAttribute = "inheritInChildApplications";
 
         protected const string ConfigSourceAttribute = "configSource";
         internal const string ProtectionProviderAttibute = "configProtectionProvider";
index 02dfec7..f2b9289 100644 (file)
@@ -70,7 +70,7 @@ namespace System.Configuration
                 }
                 else
                 {
-                    ApplicationUri =  Uri.EscapeDataString(configBasePath);
+                    ApplicationUri = Uri.EscapeDataString(configBasePath);
                 }
             }
 
index 5ce7433..5938dea 100644 (file)
@@ -142,7 +142,7 @@ namespace System.Configuration.Internal
 
                     childRecord = _isDesignTime
                         ? MgmtConfigurationRecord.Create(this, currentRecord, currentConfigPath, null)
-                        : (BaseConfigurationRecord) RuntimeConfigurationRecord.Create(this, currentRecord, currentConfigPath);
+                        : (BaseConfigurationRecord)RuntimeConfigurationRecord.Create(this, currentRecord, currentConfigPath);
 
                     currentRecord.HlAddChild(configName, childRecord);
 
index 76ae5b4..dfc7533 100644 (file)
@@ -28,7 +28,7 @@ namespace System.Configuration
 
         private static readonly ConfigurationPropertyCollection s_properties = new ConfigurationPropertyCollection { s_propProviders, s_propDefaultProvider };
 
-        public ProtectedConfigurationSection(){}
+        public ProtectedConfigurationSection() { }
 
         protected internal override ConfigurationPropertyCollection Properties => s_properties;
 
index faf9490..365f03e 100644 (file)
@@ -130,7 +130,10 @@ namespace System
                     stream: outputStream,
                     encoding: OutputEncoding.RemovePreamble(), // This ensures no prefix is written to the stream.
                     bufferSize: WriteBufferSize,
-                    leaveOpen: true) { AutoFlush = true });
+                    leaveOpen: true)
+                {
+                    AutoFlush = true
+                });
         }
 
         private static StrongBox<bool> _isStdInRedirected;
index 7bf08b7..8e15867 100644 (file)
@@ -1030,7 +1030,7 @@ namespace System
                 }
 
                 // Try to give a better error message here
-               Interop.Kernel32.COORD bounds = Interop.Kernel32.GetLargestConsoleWindowSize(OutputHandle);
+                Interop.Kernel32.COORD bounds = Interop.Kernel32.GetLargestConsoleWindowSize(OutputHandle);
                 if (width > bounds.X)
                     throw new ArgumentOutOfRangeException(nameof(width), width, SR.Format(SR.ArgumentOutOfRange_ConsoleWindowSize_Size, bounds.X));
                 if (height > bounds.Y)
index 7fc5cda..01a30b7 100644 (file)
@@ -20,7 +20,7 @@ namespace System.Data
         internal string _name = string.Empty;
         internal PropertyCollection _extendedProperties = null;
 
-        internal Constraint() {}
+        internal Constraint() { }
 
         /// <summary>
         /// The name of this constraint within the <see cref='System.Data.ConstraintCollection'/>.
index 3cd42b5..3c3bbed 100644 (file)
@@ -4775,7 +4775,7 @@ namespace System.Data
                 }
 
                 DataRow dataRow = LoadRow(values, loadOption, indextoUse); // if indextoUse == null, it means we dont have PK,
-                                                                          // so LoadRow will take care of just adding the row to end
+                                                                           // so LoadRow will take care of just adding the row to end
 
                 return dataRow;
             }
index 523ea6d..f06ef1a 100644 (file)
@@ -757,7 +757,7 @@ namespace System.Data
         }
 
         /// <summary>This method exists for LinqDataView to keep a level of abstraction away from the RBTree</summary>
-        internal Range FindRecords<TKey, TRow>(Index.ComparisonBySelector<TKey, TRow> comparison, TKey key) where TRow:DataRow
+        internal Range FindRecords<TKey, TRow>(Index.ComparisonBySelector<TKey, TRow> comparison, TKey key) where TRow : DataRow
         {
             return _index.FindRecords(comparison, key);
         }
index 0609213..de4432c 100644 (file)
@@ -122,7 +122,7 @@ namespace System.Data
             }
             else  // find for expression based sort
             {
-                if (sortExpressionBuilder.Count !=1)
+                if (sortExpressionBuilder.Count != 1)
                     throw DataSetUtil.InvalidOperation(SR.Format(SR.LDV_InvalidNumOfKeys, sortExpressionBuilder.Count));
 
                 Index.ComparisonBySelector<object, DataRow> compareDelg =
@@ -217,8 +217,7 @@ namespace System.Data
         internal override void SetIndex(string newSort, DataViewRowState newRowStates, IFilter newRowFilter)
         {
             // Throw only if expressions (filter or sort) are used and rowstate is not current rows
-            if ( (base.SortComparison != null || base.RowPredicate != null)
-                    && newRowStates != DataViewRowState.CurrentRows)
+            if ((base.SortComparison != null || base.RowPredicate != null) && newRowStates != DataViewRowState.CurrentRows)
             {
                 throw DataSetUtil.Argument(SR.LDVRowStateError);
             }
index 962f61e..4154dd0 100644 (file)
@@ -114,7 +114,7 @@ namespace System.Data.SqlTypes
         /// <summary>
         /// Converts a <see cref='SqlBinary'/> to a binary object.
         /// </summary>
-        public static explicit operator byte[] (SqlBinary x) => x.Value;
+        public static explicit operator byte[](SqlBinary x) => x.Value;
 
         /// <summary>
         /// Returns a string describing a <see cref='SqlBinary'/> object.
index 206831d..e2ff7ce 100644 (file)
@@ -106,7 +106,7 @@ namespace System.Data.SqlTypes
         /// <summary>
         /// Converts a <see cref='SqlBoolean'/> to a boolean.
         /// </summary>
-        public static explicit operator bool (SqlBoolean x)
+        public static explicit operator bool(SqlBoolean x)
         {
             return x.Value;
         }
index 6c69589..29093fb 100644 (file)
@@ -64,7 +64,7 @@ namespace System.Data.SqlTypes
         }
 
         // Explicit conversion from SqlByte to byte. Throw exception if x is Null.
-        public static explicit operator byte (SqlByte x)
+        public static explicit operator byte(SqlByte x)
         {
             return x.Value;
         }
index 0dd2400..d971839 100644 (file)
@@ -1167,7 +1167,7 @@ namespace System.Data.SqlTypes
         }
 
         // Explicit conversion from SqlDecimal to Decimal. Throw exception if x is Null.
-        public static explicit operator decimal (SqlDecimal x)
+        public static explicit operator decimal(SqlDecimal x)
         {
             return x.Value;
         }
index adae6d2..32781b7 100644 (file)
@@ -70,7 +70,7 @@ namespace System.Data.SqlTypes
         }
 
         // Explicit conversion from SqlDouble to double. Throw exception if x is Null.
-        public static explicit operator double (SqlDouble x)
+        public static explicit operator double(SqlDouble x)
         {
             return x.Value;
         }
index 6d2a5a0..3c005a9 100644 (file)
@@ -63,7 +63,7 @@ namespace System.Data.SqlTypes
         }
 
         // Explicit conversion from SqlInt16 to short. Throw exception if x is Null.
-        public static explicit operator short (SqlInt16 x)
+        public static explicit operator short(SqlInt16 x)
         {
             return x.Value;
         }
index 9c2ad07..f0f8673 100644 (file)
@@ -64,7 +64,7 @@ namespace System.Data.SqlTypes
         }
 
         // Explicit conversion from SqlInt32 to int. Throw exception if x is Null.
-        public static explicit operator int (SqlInt32 x)
+        public static explicit operator int(SqlInt32 x)
         {
             return x.Value;
         }
index a86bea4..0ad4d97 100644 (file)
@@ -65,7 +65,7 @@ namespace System.Data.SqlTypes
         }
 
         // Explicit conversion from SqlInt64 to long. Throw exception if x is Null.
-        public static explicit operator long (SqlInt64 x)
+        public static explicit operator long(SqlInt64 x)
         {
             return x.Value;
         }
index b3d7057..ebef7c4 100644 (file)
@@ -200,7 +200,7 @@ namespace System.Data.SqlTypes
         }
 
         // Explicit conversion from SqlMoney to Decimal. Throw exception if x is Null.
-        public static explicit operator decimal (SqlMoney x)
+        public static explicit operator decimal(SqlMoney x)
         {
             return x.Value;
         }
index ce7cc65..efae1f9 100644 (file)
@@ -71,7 +71,7 @@ namespace System.Data.SqlTypes
         }
 
         // Explicit conversion from SqlSingle to float. Throw exception if x is Null.
-        public static explicit operator float (SqlSingle x)
+        public static explicit operator float(SqlSingle x)
         {
             return x.Value;
         }
index 3aa30c8..835e199 100644 (file)
@@ -297,7 +297,7 @@ namespace System.Data.SqlTypes
         }
 
         // Explicit conversion from SqlString to String. Throw exception if x is Null.
-        public static explicit operator string (SqlString x)
+        public static explicit operator string(SqlString x)
         {
             return x.Value;
         }
index 63dc79f..7158884 100644 (file)
@@ -621,10 +621,10 @@ namespace System.Data
             return x;
         }
 
-        internal delegate int ComparisonBySelector<TKey, TRow>(TKey key, TRow row) where TRow:DataRow;
+        internal delegate int ComparisonBySelector<TKey, TRow>(TKey key, TRow row) where TRow : DataRow;
 
         /// <summary>This method exists for LinqDataView to keep a level of abstraction away from the RBTree</summary>
-        internal Range FindRecords<TKey, TRow>(ComparisonBySelector<TKey, TRow> comparison, TKey key) where TRow:DataRow
+        internal Range FindRecords<TKey, TRow>(ComparisonBySelector<TKey, TRow> comparison, TKey key) where TRow : DataRow
         {
             int x = _records.root;
             while (IndexTree.NIL != x)
index a1ba2f3..58d8ba8 100644 (file)
@@ -688,57 +688,43 @@ namespace System.Data.Odbc
         // Column set for SQLPrimaryKeys
         internal enum SQL_PRIMARYKEYS : short
         {
-/*
-            CATALOGNAME         = 1,                    // TABLE_CAT
-            SCHEMANAME          = 2,                    // TABLE_SCHEM
-            TABLENAME           = 3,                    // TABLE_NAME
-*/
+            // CATALOGNAME = 1,                // TABLE_CAT
+            // SCHEMANAME = 2,                 // TABLE_SCHEM
+            // TABLENAME = 3,                  // TABLE_NAME
             COLUMNNAME = 4,                    // COLUMN_NAME
-/*
-            KEY_SEQ             = 5,                    // KEY_SEQ
-            PKNAME              = 6,                    // PK_NAME
-*/
+            // KEY_SEQ = 5,                    // KEY_SEQ
+            // PKNAME = 6,                     // PK_NAME
         }
 
         // Column set for SQLStatistics
         internal enum SQL_STATISTICS : short
         {
-/*
-            CATALOGNAME         = 1,                    // TABLE_CAT
-            SCHEMANAME          = 2,                    // TABLE_SCHEM
-            TABLENAME           = 3,                    // TABLE_NAME
-            NONUNIQUE           = 4,                    // NON_UNIQUE
-            INDEXQUALIFIER      = 5,                    // INDEX_QUALIFIER
-*/
+            // CATALOGNAME = 1,               // TABLE_CAT
+            // SCHEMANAME = 2,                // TABLE_SCHEM
+            // TABLENAME = 3,                 // TABLE_NAME
+            // NONUNIQUE = 4,                 // NON_UNIQUE
+            // INDEXQUALIFIER = 5,            // INDEX_QUALIFIER
             INDEXNAME = 6,                    // INDEX_NAME
-/*
-            TYPE                = 7,                    // TYPE
-*/
-            ORDINAL_POSITION = 8,                    // ORDINAL_POSITION
-            COLUMN_NAME = 9,                    // COLUMN_NAME
-/*
-            ASC_OR_DESC         = 10,                   // ASC_OR_DESC
-            CARDINALITY         = 11,                   // CARDINALITY
-            PAGES               = 12,                   // PAGES
-            FILTER_CONDITION    = 13,                   // FILTER_CONDITION
-*/
+            // TYPE = 7,                      // TYPE
+            ORDINAL_POSITION = 8,             // ORDINAL_POSITION
+            COLUMN_NAME = 9,                  // COLUMN_NAME
+            // ASC_OR_DESC = 10,              // ASC_OR_DESC
+            // CARDINALITY = 11,              // CARDINALITY
+            // PAGES = 12,                    // PAGES
+            // FILTER_CONDITION = 13,         // FILTER_CONDITION
         }
 
         // Column set for SQLSpecialColumns
         internal enum SQL_SPECIALCOLUMNSET : short
         {
-/*
-            SCOPE               = 1,                    // SCOPE
-*/
+            // SCOPE = 1,                       // SCOPE
             COLUMN_NAME = 2,                    // COLUMN_NAME
-/*
-            DATA_TYPE           = 3,                    // DATA_TYPE
-            TYPE_NAME           = 4,                    // TYPE_NAME
-            COLUMN_SIZE         = 5,                    // COLUMN_SIZE
-            BUFFER_LENGTH       = 6,                    // BUFFER_LENGTH
-            DECIMAL_DIGITS      = 7,                    // DECIMAL_DIGITS
-            PSEUDO_COLUMN       = 8,                    // PSEUDO_COLUMN
-*/
+            // DATA_TYPE           = 3,         // DATA_TYPE
+            // TYPE_NAME           = 4,         // TYPE_NAME
+            // COLUMN_SIZE         = 5,         // COLUMN_SIZE
+            // BUFFER_LENGTH       = 6,         // BUFFER_LENGTH
+            // DECIMAL_DIGITS      = 7,         // DECIMAL_DIGITS
+            // PSEUDO_COLUMN       = 8,         // PSEUDO_COLUMN
         }
 
         internal const short SQL_DIAG_SQLSTATE = 4;
index 361b479..6c29aa1 100644 (file)
@@ -23,7 +23,8 @@ namespace System.Data.Odbc
 
         private object _coercedValue;
 
-        private OdbcParameter(OdbcParameter source) : this() { // V1.2.3300, Clone
+        private OdbcParameter(OdbcParameter source) : this() // V1.2.3300, Clone
+        {
             ADP.CheckArgumentNull(source, nameof(source));
 
             source.CloneHelper(this);
index 0a306c3..2599fa2 100644 (file)
@@ -40,8 +40,8 @@ namespace System.Data.Odbc
             return new SQLLEN(value);
         }
 
-        public static unsafe implicit operator int (SQLLEN value)
-        { //
+        public static unsafe implicit operator int(SQLLEN value)
+        {
 #if WIN32
             return (int)value._value.ToInt32();
 #else
@@ -50,7 +50,7 @@ namespace System.Data.Odbc
 #endif
         }
 
-        public static unsafe explicit operator long (SQLLEN value)
+        public static unsafe explicit operator long(SQLLEN value)
         {
             return value._value.ToInt64();
         }
index 11bfb76..319dd4c 100644 (file)
@@ -37,20 +37,26 @@ namespace System.Data.OleDb
             }
         }
 
-        public override bool IsFixedSize {
-            get {
+        public override bool IsFixedSize
+        {
+            get
+            {
                 return ((System.Collections.IList)InnerList).IsFixedSize;
             }
         }
 
-        public override bool IsReadOnly {
-            get {
+        public override bool IsReadOnly
+        {
+            get
+            {
                 return ((System.Collections.IList)InnerList).IsReadOnly;
             }
         }
 
-        public override bool IsSynchronized {
-            get {
+        public override bool IsSynchronized
+        {
+            get
+            {
                 return ((System.Collections.ICollection)InnerList).IsSynchronized;
             }
         }
index a756547..7730558 100644 (file)
@@ -261,12 +261,13 @@ namespace System.Data.Common
         internal static ArgumentOutOfRangeException InvalidCommandType(CommandType value)
         {
 #if DEBUG
-            switch (value) {
-            case CommandType.Text:
-            case CommandType.StoredProcedure:
-            case CommandType.TableDirect:
-                Debug.Assert(false, "valid CommandType " + value.ToString());
-                break;
+            switch (value)
+            {
+                case CommandType.Text:
+                case CommandType.StoredProcedure:
+                case CommandType.TableDirect:
+                    Debug.Assert(false, "valid CommandType " + value.ToString());
+                    break;
             }
 #endif
             return InvalidEnumerationValue(typeof(CommandType), (int)value);
@@ -276,13 +277,14 @@ namespace System.Data.Common
         internal static ArgumentOutOfRangeException InvalidDataRowVersion(DataRowVersion value)
         {
 #if DEBUG
-            switch (value) {
-            case DataRowVersion.Default:
-            case DataRowVersion.Current:
-            case DataRowVersion.Original:
-            case DataRowVersion.Proposed:
-                Debug.Assert(false, "valid DataRowVersion " + value.ToString());
-                break;
+            switch (value)
+            {
+                case DataRowVersion.Default:
+                case DataRowVersion.Current:
+                case DataRowVersion.Original:
+                case DataRowVersion.Proposed:
+                    Debug.Assert(false, "valid DataRowVersion " + value.ToString());
+                    break;
             }
 #endif
             return InvalidEnumerationValue(typeof(DataRowVersion), (int)value);
@@ -292,16 +294,17 @@ namespace System.Data.Common
         internal static ArgumentOutOfRangeException InvalidIsolationLevel(IsolationLevel value)
         {
 #if DEBUG
-            switch (value) {
-            case IsolationLevel.Unspecified:
-            case IsolationLevel.Chaos:
-            case IsolationLevel.ReadUncommitted:
-            case IsolationLevel.ReadCommitted:
-            case IsolationLevel.RepeatableRead:
-            case IsolationLevel.Serializable:
-            case IsolationLevel.Snapshot:
-                Debug.Assert(false, "valid IsolationLevel " + value.ToString());
-                break;
+            switch (value)
+            {
+                case IsolationLevel.Unspecified:
+                case IsolationLevel.Chaos:
+                case IsolationLevel.ReadUncommitted:
+                case IsolationLevel.ReadCommitted:
+                case IsolationLevel.RepeatableRead:
+                case IsolationLevel.Serializable:
+                case IsolationLevel.Snapshot:
+                    Debug.Assert(false, "valid IsolationLevel " + value.ToString());
+                    break;
             }
 #endif
             return InvalidEnumerationValue(typeof(IsolationLevel), (int)value);
@@ -311,13 +314,14 @@ namespace System.Data.Common
         internal static ArgumentOutOfRangeException InvalidParameterDirection(ParameterDirection value)
         {
 #if DEBUG
-            switch (value) {
-            case ParameterDirection.Input:
-            case ParameterDirection.Output:
-            case ParameterDirection.InputOutput:
-            case ParameterDirection.ReturnValue:
-                Debug.Assert(false, "valid ParameterDirection " + value.ToString());
-                break;
+            switch (value)
+            {
+                case ParameterDirection.Input:
+                case ParameterDirection.Output:
+                case ParameterDirection.InputOutput:
+                case ParameterDirection.ReturnValue:
+                    Debug.Assert(false, "valid ParameterDirection " + value.ToString());
+                    break;
             }
 #endif
             return InvalidEnumerationValue(typeof(ParameterDirection), (int)value);
@@ -327,13 +331,14 @@ namespace System.Data.Common
         internal static ArgumentOutOfRangeException InvalidUpdateRowSource(UpdateRowSource value)
         {
 #if DEBUG
-            switch (value) {
-            case UpdateRowSource.None:
-            case UpdateRowSource.OutputParameters:
-            case UpdateRowSource.FirstReturnedRecord:
-            case UpdateRowSource.Both:
-                Debug.Assert(false, "valid UpdateRowSource " + value.ToString());
-                break;
+            switch (value)
+            {
+                case UpdateRowSource.None:
+                case UpdateRowSource.OutputParameters:
+                case UpdateRowSource.FirstReturnedRecord:
+                case UpdateRowSource.Both:
+                    Debug.Assert(false, "valid UpdateRowSource " + value.ToString());
+                    break;
             }
 #endif
             return InvalidEnumerationValue(typeof(UpdateRowSource), (int)value);
@@ -1293,15 +1298,17 @@ namespace System.Data.Common
             return (condition == (condition & value.Direction));
         }
 #if DEBUG
-        private static void IsDirectionValid(ParameterDirection value) {
-            switch (value) { // @perfnote: Enum.IsDefined
-            case ParameterDirection.Input:
-            case ParameterDirection.Output:
-            case ParameterDirection.InputOutput:
-            case ParameterDirection.ReturnValue:
-                break;
-            default:
-                throw ADP.InvalidParameterDirection(value);
+        private static void IsDirectionValid(ParameterDirection value)
+        {
+            switch (value)
+            { // @perfnote: Enum.IsDefined
+                case ParameterDirection.Input:
+                case ParameterDirection.Output:
+                case ParameterDirection.InputOutput:
+                case ParameterDirection.ReturnValue:
+                    break;
+                default:
+                    throw ADP.InvalidParameterDirection(value);
             }
         }
 #endif
index 6f2a141..367e1a3 100644 (file)
@@ -82,7 +82,7 @@ namespace System.Data.SqlClient.SNI
 
             lock (this)
             {
-                if (_sqlUserInstanceLibraryHandle !=null)
+                if (_sqlUserInstanceLibraryHandle != null)
                 {
                     return true;
                 }
index b2a5491..c806f39 100644 (file)
@@ -16,7 +16,7 @@ namespace System.Data.SqlClient.SNI
         private int _dataCapacity; // the total capacity requested, if the array is rented this may be less than the _data.Length, does not include smux header length
         private int _dataOffset; // the start point of the data in the data segment, advanced by Take-ing data
         private int _headerLength; // the amount of space at the start of the array reserved for the smux header, this is zeroed in SetHeader
-                                    // _headerOffset is not needed because it is always 0
+                                   // _headerOffset is not needed because it is always 0
         private byte[] _data;
         private SNIAsyncCallback _completionCallback;
 
index 1f9736e..5ac2f13 100644 (file)
@@ -924,7 +924,8 @@ namespace System.Data.SqlClient
                     {
                         AsyncHelper.ContinueTaskWithState(execNQ, completion,
                             state: Tuple.Create(this, completion),
-                            onSuccess: state => {
+                            onSuccess: state =>
+                            {
                                 var parameters = (Tuple<SqlCommand, TaskCompletionSource<object>>)state;
                                 parameters.Item1.BeginExecuteNonQueryInternalReadStage(parameters.Item2);
                             }
@@ -1284,7 +1285,8 @@ namespace System.Data.SqlClient
                 {
                     AsyncHelper.ContinueTaskWithState(writeTask, completion,
                         state: Tuple.Create(this, completion),
-                        onSuccess: state => {
+                        onSuccess: state =>
+                        {
                             var parameters = (Tuple<SqlCommand, TaskCompletionSource<object>>)state;
                             parameters.Item1.BeginExecuteXmlReaderInternalReadStage(parameters.Item2);
                         }
@@ -1573,7 +1575,8 @@ namespace System.Data.SqlClient
                 {
                     AsyncHelper.ContinueTaskWithState(writeTask, completion,
                         state: Tuple.Create(this, completion),
-                        onSuccess: state => {
+                        onSuccess: state =>
+                        {
                             var parameters = (Tuple<SqlCommand, TaskCompletionSource<object>>)state;
                             parameters.Item1.BeginExecuteReaderInternalReadStage(parameters.Item2);
                         }
@@ -2584,7 +2587,7 @@ namespace System.Data.SqlClient
                     Debug.Assert(!IsPrepared, "Batch RPC should not be prepared!");
                     Debug.Assert(!IsDirty, "Batch RPC should not be marked as dirty!");
                     Debug.Assert(_SqlRPCBatchArray != null, "RunExecuteReader rpc array not provided");
-                    writeTask = _stateObj.Parser.TdsExecuteRPC( _SqlRPCBatchArray, timeout, inSchema, this.Notification, _stateObj, CommandType.StoredProcedure == CommandType, sync: !asyncWrite);
+                    writeTask = _stateObj.Parser.TdsExecuteRPC(_SqlRPCBatchArray, timeout, inSchema, this.Notification, _stateObj, CommandType.StoredProcedure == CommandType, sync: !asyncWrite);
                 }
                 else if ((System.Data.CommandType.Text == this.CommandType) && (0 == GetParameterCount(_parameters)))
                 {
@@ -3328,7 +3331,7 @@ namespace System.Data.SqlClient
                         if (parameter.IsDerivedParameterTypeName)
                         {
                             string[] parts = MultipartIdentifier.ParseMultipartIdentifier(parameter.TypeName, "[\"", "]\"", SR.SQL_TDSParserTableName, false);
-                            if (parts != null && parts.Length==4) // will always return int[4] right justified
+                            if (parts != null && parts.Length == 4) // will always return int[4] right justified
                             {
                                 if (
                                     parts[3] != null && // name must not be null
index 9abf927..4786513 100644 (file)
@@ -1430,12 +1430,12 @@ internal class SqlDependencyProcessDispatcher : MarshalByRefObject
             string appDomainKey,
         out bool appDomainStop)
     {
-         Debug.Assert(this == s_staticInstance, "Instance method called on non _staticInstance instance!");
-         server = null;  // Reset out param.
-         identity = null;
-         user = null;
-         database = null;
-         appDomainStop = false;
+        Debug.Assert(this == s_staticInstance, "Instance method called on non _staticInstance instance!");
+        server = null;  // Reset out param.
+        identity = null;
+        user = null;
+        database = null;
+        appDomainStop = false;
 
         SqlConnectionContainerHashHelper hashHelper = GetHashHelper(connectionString,
                                                           out SqlConnectionStringBuilder connectionStringBuilder,
@@ -1445,23 +1445,24 @@ internal class SqlDependencyProcessDispatcher : MarshalByRefObject
 
         bool stopped = false;
 
-         lock (_connectionContainers)
-         {
-             if (_connectionContainers.ContainsKey(hashHelper))
-             {
-                 SqlConnectionContainer container = _connectionContainers[hashHelper];
-                 server = container.Server;   // Return server, database, and queue info for use by calling SqlDependency.
-                 database = container.Database;
-                 queueService = container.Queue;
-
-                 if (container.Stop(appDomainKey, out appDomainStop))
-                 { // Stop can be blocking if refCount == 0 on container.
-                     stopped = true;
-                     _connectionContainers.Remove(hashHelper); // Remove from collection.
-                 }
-             }
-         }
-
-         return stopped;
+        lock (_connectionContainers)
+        {
+            if (_connectionContainers.ContainsKey(hashHelper))
+            {
+                SqlConnectionContainer container = _connectionContainers[hashHelper];
+                server = container.Server;   // Return server, database, and queue info for use by calling SqlDependency.
+                database = container.Database;
+                queueService = container.Queue;
+
+                if (container.Stop(appDomainKey, out appDomainStop))
+                {
+                    // Stop can be blocking if refCount == 0 on container.
+                    stopped = true;
+                    _connectionContainers.Remove(hashHelper); // Remove from collection.
+                }
+            }
+        }
+
+        return stopped;
     }
 }
index c147356..2afff43 100644 (file)
@@ -570,71 +570,71 @@ namespace System.Data.SqlTypes
                 }
 
                 switch (retval)
-                    {
-                        case 0:
-                            break;
+                {
+                    case 0:
+                        break;
 
-                        case Interop.Errors.ERROR_SHARING_VIOLATION:
-                            throw ADP.InvalidOperation(SR.GetString(SR.SqlFileStream_FileAlreadyInTransaction));
+                    case Interop.Errors.ERROR_SHARING_VIOLATION:
+                        throw ADP.InvalidOperation(SR.GetString(SR.SqlFileStream_FileAlreadyInTransaction));
 
-                        case Interop.Errors.ERROR_INVALID_PARAMETER:
-                            throw ADP.Argument(SR.GetString(SR.SqlFileStream_InvalidParameter));
+                    case Interop.Errors.ERROR_INVALID_PARAMETER:
+                        throw ADP.Argument(SR.GetString(SR.SqlFileStream_InvalidParameter));
 
-                        case Interop.Errors.ERROR_FILE_NOT_FOUND:
-                            {
-                                System.IO.DirectoryNotFoundException e = new System.IO.DirectoryNotFoundException();
-                                ADP.TraceExceptionAsReturnValue(e);
-                                throw e;
-                            }
-                        default:
+                    case Interop.Errors.ERROR_FILE_NOT_FOUND:
+                        {
+                            System.IO.DirectoryNotFoundException e = new System.IO.DirectoryNotFoundException();
+                            ADP.TraceExceptionAsReturnValue(e);
+                            throw e;
+                        }
+                    default:
+                        {
+                            uint error = Interop.NtDll.RtlNtStatusToDosError(retval);
+                            if (error == ERROR_MR_MID_NOT_FOUND)
                             {
-                                uint error = Interop.NtDll.RtlNtStatusToDosError(retval);
-                                if (error == ERROR_MR_MID_NOT_FOUND)
-                                {
-                                    // status code could not be mapped to a Win32 error code
-                                    error = (uint)retval;
-                                }
-
-                                System.ComponentModel.Win32Exception e = new System.ComponentModel.Win32Exception(unchecked((int)error));
-                                ADP.TraceExceptionAsReturnValue(e);
-                                throw e;
+                                // status code could not be mapped to a Win32 error code
+                                error = (uint)retval;
                             }
-                    }
-
-                    if (hFile.IsInvalid)
-                    {
-                        System.ComponentModel.Win32Exception e = new System.ComponentModel.Win32Exception(Interop.Errors.ERROR_INVALID_HANDLE);
-                        ADP.TraceExceptionAsReturnValue(e);
-                        throw e;
-                    }
-
-                    if (Interop.Kernel32.GetFileType(hFile) != Interop.Kernel32.FileTypes.FILE_TYPE_DISK)
-                    {
-                        hFile.Dispose();
-                        throw ADP.Argument(SR.GetString(SR.SqlFileStream_PathNotValidDiskResource));
-                    }
 
-                    // if the user is opening the SQL FileStream in read/write mode, we assume that they want to scan
-                    // through current data and then append new data to the end, so we need to tell SQL Server to preserve
-                    // the existing file contents.
-                    if (access == System.IO.FileAccess.ReadWrite)
-                    {
-                        uint ioControlCode = Interop.Kernel32.CTL_CODE(FILE_DEVICE_FILE_SYSTEM,
-                            IoControlCodeFunctionCode, (byte)Interop.Kernel32.IoControlTransferType.METHOD_BUFFERED,
-                            (byte)Interop.Kernel32.IoControlCodeAccess.FILE_ANY_ACCESS);
-
-                        if (!Interop.Kernel32.DeviceIoControl(hFile, ioControlCode, IntPtr.Zero, 0, IntPtr.Zero, 0, out uint cbBytesReturned, IntPtr.Zero))
-                        {
-                            System.ComponentModel.Win32Exception e = new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error());
+                            System.ComponentModel.Win32Exception e = new System.ComponentModel.Win32Exception(unchecked((int)error));
                             ADP.TraceExceptionAsReturnValue(e);
                             throw e;
                         }
+                }
+
+                if (hFile.IsInvalid)
+                {
+                    System.ComponentModel.Win32Exception e = new System.ComponentModel.Win32Exception(Interop.Errors.ERROR_INVALID_HANDLE);
+                    ADP.TraceExceptionAsReturnValue(e);
+                    throw e;
+                }
+
+                if (Interop.Kernel32.GetFileType(hFile) != Interop.Kernel32.FileTypes.FILE_TYPE_DISK)
+                {
+                    hFile.Dispose();
+                    throw ADP.Argument(SR.GetString(SR.SqlFileStream_PathNotValidDiskResource));
+                }
+
+                // if the user is opening the SQL FileStream in read/write mode, we assume that they want to scan
+                // through current data and then append new data to the end, so we need to tell SQL Server to preserve
+                // the existing file contents.
+                if (access == System.IO.FileAccess.ReadWrite)
+                {
+                    uint ioControlCode = Interop.Kernel32.CTL_CODE(FILE_DEVICE_FILE_SYSTEM,
+                        IoControlCodeFunctionCode, (byte)Interop.Kernel32.IoControlTransferType.METHOD_BUFFERED,
+                        (byte)Interop.Kernel32.IoControlCodeAccess.FILE_ANY_ACCESS);
+
+                    if (!Interop.Kernel32.DeviceIoControl(hFile, ioControlCode, IntPtr.Zero, 0, IntPtr.Zero, 0, out uint cbBytesReturned, IntPtr.Zero))
+                    {
+                        System.ComponentModel.Win32Exception e = new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error());
+                        ADP.TraceExceptionAsReturnValue(e);
+                        throw e;
                     }
+                }
 
-                    // now that we've successfully opened a handle on the path and verified that it is a file,
-                    // use the SafeFileHandle to initialize our internal System.IO.FileStream instance
-                    System.Diagnostics.Debug.Assert(_m_fs == null);
-                    _m_fs = new System.IO.FileStream(hFile, access, DefaultBufferSize, ((options & System.IO.FileOptions.Asynchronous) != 0));
+                // now that we've successfully opened a handle on the path and verified that it is a file,
+                // use the SafeFileHandle to initialize our internal System.IO.FileStream instance
+                System.Diagnostics.Debug.Assert(_m_fs == null);
+                _m_fs = new System.IO.FileStream(hFile, access, DefaultBufferSize, ((options & System.IO.FileOptions.Asynchronous) != 0));
             }
             catch
             {
index 81b4f2e..6ffe502 100644 (file)
@@ -835,7 +835,7 @@ namespace System.Data.SqlClient
                 // NOTE: Udts can change their value any time
                 if (_internalMetaType.SqlDbType == Data.SqlDbType.Udt)
                 {
-                    Set(SqlParameterFlags.IsNull, ((_value == null) || (_value == DBNull.Value) || (( _flags.HasFlag(SqlParameterFlags.IsSqlParameterSqlType)) && (_valueAsINullable.IsNull))));
+                    Set(SqlParameterFlags.IsNull, ((_value == null) || (_value == DBNull.Value) || ((_flags.HasFlag(SqlParameterFlags.IsSqlParameterSqlType)) && (_valueAsINullable.IsNull))));
                 }
                 return _flags.HasFlag(SqlParameterFlags.IsNull);
             }
index 91c558e..5ceecca 100644 (file)
@@ -29,7 +29,8 @@ namespace System.Data.SqlClient
                 TaskCompletionSource<object> completion = new TaskCompletionSource<object>();
                 ContinueTaskWithState(task, completion,
                     state: Tuple.Create(onSuccess, onFailure, completion),
-                    onSuccess: (state) => {
+                    onSuccess: (state) =>
+                    {
                         var parameters = (Tuple<Action, Action<Exception>, TaskCompletionSource<object>>)state;
                         Action success = parameters.Item1;
                         TaskCompletionSource<object> taskCompletionSource = parameters.Item3;
@@ -58,7 +59,8 @@ namespace System.Data.SqlClient
             {
                 var completion = new TaskCompletionSource<object>();
                 ContinueTaskWithState(task, completion, state,
-                    onSuccess: (continueState) => {
+                    onSuccess: (continueState) =>
+                    {
                         onSuccess(continueState);
                         completion.SetResult(null);
                     },
index 10e7ee3..898d531 100644 (file)
@@ -246,7 +246,7 @@ namespace System.Data.SqlClient
 
         internal override bool IsValidPacket(PacketHandle packetPointer)
         {
-            Debug.Assert(packetPointer.Type == PacketHandle.NativePointerType || packetPointer.Type==PacketHandle.NativePacketType, "unexpected packet type when requiring NativePointer");
+            Debug.Assert(packetPointer.Type == PacketHandle.NativePointerType || packetPointer.Type == PacketHandle.NativePacketType, "unexpected packet type when requiring NativePointer");
             return (
                 (packetPointer.Type == PacketHandle.NativePointerType && packetPointer.NativePointer != IntPtr.Zero)
                 ||
index 868187b..8cee348 100644 (file)
@@ -19,15 +19,15 @@ namespace System
             {
                 if (!s_isAppContainerProcessInitalized)
                 {
-                   if (Environment.OSVersion.Version.Major < 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1))
-                   {
-                       // Windows 7 or older.
-                       s_isAppContainerProcess = false;
-                   }
-                   else
-                   {
-                       s_isAppContainerProcess = HasAppContainerToken();
-                   }
+                    if (Environment.OSVersion.Version.Major < 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1))
+                    {
+                        // Windows 7 or older.
+                        s_isAppContainerProcess = false;
+                    }
+                    else
+                    {
+                        s_isAppContainerProcess = HasAppContainerToken();
+                    }
 
                     s_isAppContainerProcessInitalized = true;
                 }
index 3080a20..b2a1775 100644 (file)
@@ -46,12 +46,15 @@ namespace System.Diagnostics
             return true;
         }
 
-        private bool EnumWindowsCallback(IntPtr handle, IntPtr extraParameter) {
+        private bool EnumWindowsCallback(IntPtr handle, IntPtr extraParameter)
+        {
             int processId;
             Interop.User32.GetWindowThreadProcessId(handle, out processId);
 
-            if (processId == _processId) {
-                if (IsMainWindow(handle)) {
+            if (processId == _processId)
+            {
+                if (IsMainWindow(handle))
+                {
                     _bestHandle = handle;
                     return false;
                 }
index fc83ae3..7a84281 100644 (file)
@@ -6,7 +6,7 @@ namespace System.Diagnostics.SymbolStore
 {
     public class SymLanguageType
     {
-        public static readonly Guid C = new Guid(0x63a08714, unchecked((short) 0xfc37), 0x11d2, 0x90, 0x4c, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
+        public static readonly Guid C = new Guid(0x63a08714, unchecked((short)0xfc37), 0x11d2, 0x90, 0x4c, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
         public static readonly Guid CPlusPlus = new Guid(0x3a12d0b7, unchecked((short)0xc26c), 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);
 
         public static readonly Guid CSharp = new Guid(0x3f5162f8, unchecked((short)0x07c6), 0x11d3, 0x90, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
@@ -17,7 +17,7 @@ namespace System.Diagnostics.SymbolStore
 
         public static readonly Guid Cobol = new Guid(unchecked((int)0xaf046cd1), unchecked((short)0xd0e1), 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
 
-        public static readonly Guid Pascal = new Guid(unchecked((int)0xaf046cd2), unchecked((short) 0xd0e1), 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
+        public static readonly Guid Pascal = new Guid(unchecked((int)0xaf046cd2), unchecked((short)0xd0e1), 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
 
         public static readonly Guid ILAssembly = new Guid(unchecked((int)0xaf046cd3), unchecked((short)0xd0e1), 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
 
index 97e0472..73ae1e0 100644 (file)
@@ -6,6 +6,6 @@ namespace System.Diagnostics.SymbolStore
 {
     public class SymLanguageVendor
     {
-        public static readonly Guid Microsoft = new Guid(unchecked((int)0x994b45c4), unchecked((short) 0xe6e9), 0x11d2, 0x90, 0x3f, 0x00, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
+        public static readonly Guid Microsoft = new Guid(unchecked((int)0x994b45c4), unchecked((short)0xe6e9), 0x11d2, 0x90, 0x3f, 0x00, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
     }
 }
index c01eda8..856a8e1 100644 (file)
@@ -4,14 +4,15 @@
 
 namespace System.Diagnostics
 {
-    public class ConsoleTraceListener : TextWriterTraceListener {
+    public class ConsoleTraceListener : TextWriterTraceListener
+    {
         public ConsoleTraceListener()
-            : base (Console.Out)
+            : base(Console.Out)
         {
         }
 
         public ConsoleTraceListener(bool useErrorStream)
-            : base (useErrorStream ? Console.Error : Console.Out)
+            : base(useErrorStream ? Console.Error : Console.Out)
         {
         }
 
index 2397c10..19e8632 100644 (file)
@@ -83,7 +83,7 @@ namespace System.Diagnostics
             string stackTrace;
             try
             {
-                stackTrace = new StackTrace(fNeedFileInfo:true).ToString();
+                stackTrace = new StackTrace(fNeedFileInfo: true).ToString();
             }
             catch
             {
index a6a4abb..c7571e2 100644 (file)
@@ -145,7 +145,7 @@ namespace System.Diagnostics
 
         public static void Indent()
         {
-             Debug.IndentLevel++;
+            Debug.IndentLevel++;
         }
 
         public static void Unindent()
index 5dd4840..7b48cb8 100644 (file)
@@ -44,7 +44,8 @@ namespace System.Diagnostics
 
         public StringDictionary Attributes
         {
-            get {
+            get
+            {
                 if (_attributes == null)
                     _attributes = new StringDictionary();
                 return _attributes;
index 967c0f7..801c721 100644 (file)
@@ -468,8 +468,10 @@ namespace System.Diagnostics
             }
         }
 
-        public StringDictionary Attributes {
-            get {
+        public StringDictionary Attributes
+        {
+            get
+            {
                 // Ensure that config is loaded
                 Initialize();
 
index 9cfaf85..5e43e10 100644 (file)
@@ -229,13 +229,13 @@ namespace System.DirectoryServices.AccountManagement
         }
 
         private bool _disposed = false;                  // keeps track of whether this object was disposed or not.
-        private readonly bool _disposeDirEntry = false;           // If set to true then the RangeRetriever object will own the directory entry
+        private readonly bool _disposeDirEntry = false;  // If set to true then the RangeRetriever object will own the directory entry
                                                          // supplied to it in the constructor and will be responsible for disposing this entry
                                                          // when Dispose() is called on this object.
         private bool _cacheValues = false;               // If set to true then the attribute values will be cached in the InnerList
                                                          // By default caching is turned off.
-        private readonly DirectoryEntry _de;                      // the DirectoryEntry whose property we're retrieving the values of
-        private readonly string _propertyName;                    // the property we're retrieving the values of
+        private readonly DirectoryEntry _de;             // the DirectoryEntry whose property we're retrieving the values of
+        private readonly string _propertyName;           // the property we're retrieving the values of
 
         private bool _endReached = false;                // if true, all property values (from all chunks) have been retrieved
 
index ae7718d..ad56e0b 100644 (file)
@@ -21,7 +21,6 @@ namespace System.DirectoryServices.AccountManagement
         static GlobalDebug()
         {
             GlobalDebug.s_debugLevel = GlobalConfig.DebugLevel;
-//#if DEBUG
 #if SUPPORTDEBUGLOGFILE // not defined
             string debugLogFile = GlobalConfig.DebugLogFile;
 
index 673104c..ff6b110 100644 (file)
@@ -72,7 +72,7 @@ namespace System.DirectoryServices.Protocols
     {
         private readonly DirectoryControl[] _resultControls = null;
 
-        internal SearchResultEntry(string dn) : this(dn, new SearchResultAttributeCollection()) {}
+        internal SearchResultEntry(string dn) : this(dn, new SearchResultAttributeCollection()) { }
 
         internal SearchResultEntry(string dn, SearchResultAttributeCollection attrs)
         {
index 2a40927..62004ce 100644 (file)
@@ -284,7 +284,7 @@ namespace System.DirectoryServices.Interop
                 set;
             }
 
-            object Values { get; set;  }
+            object Values { get; set; }
         }
 
         [ComImport, Guid("C6F602B6-8F69-11D0-8528-00C04FD8D503")]
index 79d8e47..f61535c 100644 (file)
@@ -38,7 +38,7 @@ namespace System.DirectoryServices.ActiveDirectory
                 _searcher.ServerPageTimeLimit = s_defaultTimeSpan;
             }
 
-             _searcher.CacheResults = cacheResults;
+            _searcher.CacheResults = cacheResults;
         }
 
         public SearchResult FindOne() => _searcher.FindOne();
index 0d62e36..65dd718 100644 (file)
@@ -410,8 +410,8 @@ namespace System.DirectoryServices
         /// </devdoc>
         [
             DefaultValue(""),
-           // CoreFXPort - Remove design support
-           // TypeConverter("System.Diagnostics.Design.StringValueConverter, " + AssemblyRef.SystemDesign)
+            // CoreFXPort - Remove design support
+            // TypeConverter("System.Diagnostics.Design.StringValueConverter, " + AssemblyRef.SystemDesign)
         ]
         public string AttributeScopeQuery
         {
index 36895d0..e6e3fe1 100644 (file)
@@ -21,7 +21,7 @@ namespace System.Drawing
 
         internal Bitmap(IntPtr ptr) => SetNativeImage(ptr);
 
-        public Bitmap(string filename) : this (filename, useIcm: false) { }
+        public Bitmap(string filename) : this(filename, useIcm: false) { }
 
         public Bitmap(string filename, bool useIcm)
         {
index eeb37eb..6c53ac9 100644 (file)
@@ -247,7 +247,7 @@ namespace System.Drawing
         public static Brush MediumOrchid => GetBrush(s_mediumOrchidKey, Color.MediumOrchid);
         public static Brush MediumPurple => GetBrush(s_mediumPurpleKey, Color.MediumPurple);
         public static Brush MediumSeaGreen => GetBrush(s_mediumSeaGreenKey, Color.MediumSeaGreen);
-        public static Brush MediumSlateBlue => GetBrush(s_mediumSlateBlueKey,  Color.MediumSlateBlue);
+        public static Brush MediumSlateBlue => GetBrush(s_mediumSlateBlueKey, Color.MediumSlateBlue);
         public static Brush MediumSpringGreen => GetBrush(s_mediumSpringGreenKey, Color.MediumSpringGreen);
         public static Brush MediumTurquoise => GetBrush(s_mediumTurquoiseKey, Color.MediumTurquoise);
         public static Brush MediumVioletRed => GetBrush(s_mediumVioletRedKey, Color.MediumVioletRed);
index d243838..65c6afa 100644 (file)
@@ -238,7 +238,7 @@ namespace System.Drawing.Drawing2D
 
                 if (count == 0 || value.Positions.Length == 0)
                     throw new ArgumentException(SR.BlendObjectMustHaveTwoElements);
-                if (count >=2 && count != value.Positions.Length)
+                if (count >= 2 && count != value.Positions.Length)
                     throw new ArgumentOutOfRangeException();
                 if (count >= 2 && value.Positions[0] != 0.0F)
                     throw new ArgumentException(SR.BlendObjectFirstElementInvalid);
@@ -505,7 +505,7 @@ namespace System.Drawing.Drawing2D
 
         public void ScaleTransform(float sx, float sy, MatrixOrder order)
         {
-            Gdip.CheckStatus( Gdip.GdipScaleLineTransform(
+            Gdip.CheckStatus(Gdip.GdipScaleLineTransform(
                 new HandleRef(this, NativeBrush), sx, sy, order));
         }
 
index 1da8d18..478bfdf 100644 (file)
@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-    using System.Runtime.InteropServices;
+using System.Runtime.InteropServices;
 
 namespace System.Drawing.Imaging
 {
index db91a2a..7f0de6b 100644 (file)
@@ -166,7 +166,7 @@ namespace System.Drawing.Imaging
         /// <summary>
         /// Initializes a new instance of the <see cref='Metafile'/> class with the specified filename.
         /// </summary>
-        public Metafile(string fileName, IntPtr referenceHdc, RectangleF frameRect,  MetafileFrameUnit frameUnit, EmfType type) :
+        public Metafile(string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type) :
             this(fileName, referenceHdc, frameRect, frameUnit, type, null)
         {
         }
index 80ea841..39253b5 100644 (file)
@@ -41,7 +41,7 @@ namespace System.Drawing
         /// </summary>
         private Pen(IntPtr nativePen) => SetNativePen(nativePen);
 
-        internal Pen(Color color, bool immutable) : this(color) =>  _immutable = immutable;
+        internal Pen(Color color, bool immutable) : this(color) => _immutable = immutable;
 
         /// <summary>
         /// Initializes a new instance of the Pen class with the specified <see cref='Color'/>.
@@ -217,7 +217,7 @@ namespace System.Drawing
 
             int status = Gdip.GdipSetPenLineCap197819(new HandleRef(this, NativePen),
                 unchecked((int)startCap), unchecked((int)endCap), unchecked((int)dashCap));
-                Gdip.CheckStatus(status);
+            Gdip.CheckStatus(status);
         }
 
         /// <summary>
@@ -660,7 +660,7 @@ namespace System.Drawing
         {
             IntPtr nativeBrush = IntPtr.Zero;
             int status = Gdip.GdipGetPenBrushFill(new HandleRef(this, NativePen), out nativeBrush);
-                Gdip.CheckStatus(status);
+            Gdip.CheckStatus(status);
 
             return nativeBrush;
         }
index 0c8a7d6..0ad9933 100644 (file)
@@ -63,7 +63,7 @@ namespace System.Drawing.Printing
             return (value) ? True : False;
         }
 
-        public static explicit operator bool (TriState value)
+        public static explicit operator bool(TriState value)
         {
             if (value.IsDefault)
                 throw new InvalidCastException(SR.TriStateCompareError);
index db8f791..8a73061 100644 (file)
@@ -385,7 +385,7 @@ namespace System.Drawing
             Gdip.CheckStatus(Gdip.GdipIsVisibleRegionPointI(
                 new HandleRef(this, NativeRegion),
                 point.X, point.Y,
-                new HandleRef(g,  g?.NativeGraphics ?? IntPtr.Zero),
+                new HandleRef(g, g?.NativeGraphics ?? IntPtr.Zero),
                 out int isVisible));
 
             return isVisible != 0;
index b878204..6943b69 100644 (file)
@@ -129,8 +129,8 @@ namespace System.IO.Compression
         }
 
         public Stream BaseStream => _stream;
-        public override bool CanRead => _mode == CompressionMode.Decompress  && _stream != null && _stream.CanRead;
-        public override bool CanWrite => _mode == CompressionMode.Compress  && _stream != null && _stream.CanWrite;
+        public override bool CanRead => _mode == CompressionMode.Decompress && _stream != null && _stream.CanRead;
+        public override bool CanWrite => _mode == CompressionMode.Compress && _stream != null && _stream.CanWrite;
         public override bool CanSeek => false;
         public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException();
         public override long Length => throw new NotSupportedException();
index 58d84b6..a74cd3b 100644 (file)
@@ -111,7 +111,7 @@ namespace System.IO.Compression
             {
                 return new ValueTask<int>(Task.FromCanceled<int>(cancellationToken));
             }
-             return FinishReadAsyncMemory(buffer, cancellationToken);
+            return FinishReadAsyncMemory(buffer, cancellationToken);
         }
 
         private async ValueTask<int> FinishReadAsyncMemory(Memory<byte> buffer, CancellationToken cancellationToken)
index 21ae421..e0824f6 100644 (file)
@@ -76,7 +76,7 @@ namespace System.IO.Compression
 
             foreach (ZipArchiveEntry entry in source.Entries)
             {
-                 entry.ExtractRelativeToDirectory(destinationDirectoryName, overwriteFiles);
+                entry.ExtractRelativeToDirectory(destinationDirectoryName, overwriteFiles);
             }
         }
     }
index a433df3..c905c28 100644 (file)
@@ -295,7 +295,7 @@ namespace System.IO.Compression
                         throw new InvalidDataException(SR.GenericInvalidData);
                     }
 
-                     _inflater.SetInput(_buffer, 0, bytes);
+                    _inflater.SetInput(_buffer, 0, bytes);
                 }
             }
 
index 84ba93c..e938bbd 100644 (file)
@@ -12,17 +12,17 @@ namespace System.IO.Compression
     {
         private DeflateStream _deflateStream;
 
-        public GZipStream(Stream stream, CompressionMode mode): this(stream, mode, leaveOpen: false)
+        public GZipStream(Stream stream, CompressionMode mode) : this(stream, mode, leaveOpen: false)
         {
         }
 
         public GZipStream(Stream stream, CompressionMode mode, bool leaveOpen)
         {
-             _deflateStream = new DeflateStream(stream, mode, leaveOpen, ZLibNative.GZip_DefaultWindowBits);
+            _deflateStream = new DeflateStream(stream, mode, leaveOpen, ZLibNative.GZip_DefaultWindowBits);
         }
 
         // Implies mode = Compress
-        public GZipStream(Stream stream, CompressionLevel compressionLevel): this(stream, compressionLevel, leaveOpen: false)
+        public GZipStream(Stream stream, CompressionLevel compressionLevel) : this(stream, compressionLevel, leaveOpen: false)
         {
         }
 
index 82e0cbd..9f40670 100644 (file)
@@ -517,7 +517,7 @@ namespace System.IO.Compression
                     compressedSize = reader.ReadInt32();
                     uncompressedSize = reader.ReadInt32();
                 }
-                reader.BaseStream.Seek( -seekSize - entry.CompressedLength - 4,  SeekOrigin.Current); // Seek back to the beginning of compressed stream
+                reader.BaseStream.Seek(-seekSize - entry.CompressedLength - 4, SeekOrigin.Current); // Seek back to the beginning of compressed stream
             }
 
             if (entry.CompressedLength != compressedSize)
index acb0e74..35b2a59 100644 (file)
@@ -219,7 +219,7 @@ namespace System.IO
             => EnumerateFileSystemEntries(path, searchPattern, EnumerationOptions.FromSearchOption(searchOption));
 
         public static IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, EnumerationOptions enumerationOptions)
-            =>  InternalEnumeratePaths(path, searchPattern, SearchTarget.Both, enumerationOptions);
+            => InternalEnumeratePaths(path, searchPattern, SearchTarget.Both, enumerationOptions);
 
         public static string GetDirectoryRoot(string path)
         {
index 373419a..c0a66f5 100644 (file)
@@ -166,15 +166,15 @@ namespace System.IO.Enumeration
             EnumerationOptions options,
             bool isNormalized)
         {
-             return new FileSystemEnumerable<FileInfo>(
-                directory,
-                (ref FileSystemEntry entry) => (FileInfo)entry.ToFileSystemInfo(),
-                options,
-                isNormalized)
-             {
-                 ShouldIncludePredicate = (ref FileSystemEntry entry) =>
-                     !entry.IsDirectory && MatchesPattern(expression, entry.FileName, options)
-             };
+            return new FileSystemEnumerable<FileInfo>(
+               directory,
+               (ref FileSystemEntry entry) => (FileInfo)entry.ToFileSystemInfo(),
+               options,
+               isNormalized)
+            {
+                ShouldIncludePredicate = (ref FileSystemEntry entry) =>
+                    !entry.IsDirectory && MatchesPattern(expression, entry.FileName, options)
+            };
         }
 
         internal static IEnumerable<DirectoryInfo> DirectoryInfos(
index 1acdcee..3c13661 100644 (file)
@@ -17,11 +17,11 @@ namespace System.IO
         /// For internal use. These are the options we want to use if calling the existing Directory/File APIs where you don't
         /// explicitly specify EnumerationOptions.
         /// </summary>
-        internal static EnumerationOptions Compatible { get; } = new EnumerationOptions
-            { MatchType = MatchType.Win32, AttributesToSkip = 0, IgnoreInaccessible = false };
+        internal static EnumerationOptions Compatible { get; } =
+            new EnumerationOptions { MatchType = MatchType.Win32, AttributesToSkip = 0, IgnoreInaccessible = false };
 
-        private static EnumerationOptions CompatibleRecursive { get; } = new EnumerationOptions
-            { RecurseSubdirectories = true, MatchType = MatchType.Win32, AttributesToSkip = 0, IgnoreInaccessible = false };
+        private static EnumerationOptions CompatibleRecursive { get; } =
+            new EnumerationOptions { RecurseSubdirectories = true, MatchType = MatchType.Win32, AttributesToSkip = 0, IgnoreInaccessible = false };
 
         /// <summary>
         /// Internal singleton for default options.
index c86be39..ca9d015 100644 (file)
@@ -34,7 +34,7 @@ namespace System.IO
         internal static unsafe FileSystemInfo Create(string fullPath, ref FileSystemEntry findData)
         {
             FileSystemInfo info = findData.IsDirectory
-                ? (FileSystemInfo) new DirectoryInfo(fullPath, fileName: findData.FileName.ToString(), isNormalized: true)
+                ? (FileSystemInfo)new DirectoryInfo(fullPath, fileName: findData.FileName.ToString(), isNormalized: true)
                 : new FileInfo(fullPath, fileName: findData.FileName.ToString(), isNormalized: true);
 
             Debug.Assert(!PathInternal.IsPartiallyQualified(fullPath.AsSpan()), $"'{fullPath}' should be fully qualified when constructed from directory enumeration");
index cfe7710..09413c8 100644 (file)
@@ -31,7 +31,7 @@ namespace System.IO.Packaging
         // .NET Framework will parse this as relative. This will break internal relationships
         // in packaging. For more information, see
         // http://www.mono-project.com/docs/faq/known-issues/urikind-relativeorabsolute/
-        private static readonly UriKind DotNetRelativeOrAbsolute = Type.GetType ("Mono.Runtime") == null ? UriKind.RelativeOrAbsolute : (UriKind)300;
+        private static readonly UriKind DotNetRelativeOrAbsolute = Type.GetType("Mono.Runtime") == null ? UriKind.RelativeOrAbsolute : (UriKind)300;
 
         #region IEnumerable
         /// <summary>
index 5c181f1..4b6925e 100644 (file)
@@ -45,7 +45,7 @@ namespace System.IO.Packaging
         /// This parameter can be null in which case we will create a valid pack uri
         /// that references the entire package</param>
         /// <returns>A Uri with the "pack://" scheme</returns>
-         /// <exception cref="ArgumentNullException">If packageUri parameter is null</exception>
+        /// <exception cref="ArgumentNullException">If packageUri parameter is null</exception>
         /// <exception cref="ArgumentException">If packageUri parameter is not an absolute Uri</exception>
         /// <exception cref="ArgumentException">If partUri parameter does not conform to the valid partUri syntax</exception>
         public static Uri Create(Uri packageUri, Uri partUri)
index fdcaa03..d8fbe07 100644 (file)
@@ -786,7 +786,7 @@ namespace System.IO.Packaging
         //has been closed.
         private bool IsStreamClosed(Stream s)
         {
-            return !s.CanRead  && !s.CanSeek && !s.CanWrite;
+            return !s.CanRead && !s.CanSeek && !s.CanWrite;
         }
 
         #endregion Private Methods
index f26f7dc..0dacf42 100644 (file)
@@ -784,21 +784,21 @@ namespace System.IO.Packaging
                             {
                                 ProcessDefaultTagAttributes(reader);
                             }
+                            else if (reader.NodeType == XmlNodeType.Element
+                                     && reader.Depth == 1
+                                     && (string.CompareOrdinal(reader.NamespaceURI, TypesNamespaceUri) == 0)
+                                     && (string.CompareOrdinal(reader.Name, OverrideTagName) == 0))
+                            {
+                                ProcessOverrideTagAttributes(reader);
+                            }
+                            else if (reader.NodeType == XmlNodeType.EndElement && reader.Depth == 0 && string.CompareOrdinal(reader.Name, TypesTagName) == 0)
+                            {
+                                continue;
+                            }
                             else
-                                if (reader.NodeType == XmlNodeType.Element
-                                    && reader.Depth == 1
-                                    && (string.CompareOrdinal(reader.NamespaceURI, TypesNamespaceUri) == 0)
-                                    && (string.CompareOrdinal(reader.Name, OverrideTagName) == 0))
-                                {
-                                    ProcessOverrideTagAttributes(reader);
-                                }
-                                else
-                                    if (reader.NodeType == XmlNodeType.EndElement && reader.Depth == 0 && string.CompareOrdinal(reader.Name, TypesTagName) == 0)
-                                        continue;
-                                    else
-                                    {
-                                        throw new XmlException(SR.TypesXmlDoesNotMatchSchema, null, ((IXmlLineInfo)reader).LineNumber, ((IXmlLineInfo)reader).LinePosition);
-                                    }
+                            {
+                                throw new XmlException(SR.TypesXmlDoesNotMatchSchema, null, ((IXmlLineInfo)reader).LineNumber, ((IXmlLineInfo)reader).LinePosition);
+                            }
                         }
                     }
                     else
index 60c1d59..ed6ddb5 100644 (file)
@@ -102,7 +102,8 @@ namespace System.IO.Packaging
 
         public override long Length
         {
-            get {
+            get
+            {
                 // ZipArchiveEntry's read stream doesn't provide a length since it's a raw DeflateStream
                 // Return length from the archive entry.
                 if (_packageFileAccess == FileAccess.Read)
index be0eda0..388e5c2 100644 (file)
@@ -12,12 +12,12 @@ namespace System.IO.Pipes
         //
         // Constructor for creating access rules for pipe objects
         //
-        public PipeAccessRule( string identity, PipeAccessRights rights, AccessControlType type)
-            : this( new NTAccount(identity), AccessMaskFromRights(rights, type), false, type)
+        public PipeAccessRule(string identity, PipeAccessRights rights, AccessControlType type)
+            : this(new NTAccount(identity), AccessMaskFromRights(rights, type), false, type)
         {
         }
 
-        public PipeAccessRule( IdentityReference identity, PipeAccessRights rights, AccessControlType type)
+        public PipeAccessRule(IdentityReference identity, PipeAccessRights rights, AccessControlType type)
             : this(identity, AccessMaskFromRights(rights, type), false, type)
         {
         }
@@ -26,8 +26,8 @@ namespace System.IO.Pipes
         // Internal constructor to be called by public constructors
         // and the access rights factory methods
         //
-        internal PipeAccessRule( IdentityReference identity, int accessMask, bool isInherited, AccessControlType type)
-            : base( identity, accessMask, isInherited, InheritanceFlags.None, PropagationFlags.None, type)
+        internal PipeAccessRule(IdentityReference identity, int accessMask, bool isInherited, AccessControlType type)
+            : base(identity, accessMask, isInherited, InheritanceFlags.None, PropagationFlags.None, type)
         {
         }
 
index 6ede7c0..2affb90 100644 (file)
@@ -558,7 +558,7 @@ namespace System.IO.Ports
         {
             if (portName == null)
             {
-                 throw new ArgumentNullException(nameof(portName));
+                throw new ArgumentNullException(nameof(portName));
             }
 
             if (!portName.StartsWith("COM", StringComparison.OrdinalIgnoreCase) ||
index 50897ed..87db42f 100644 (file)
@@ -343,7 +343,7 @@ namespace System.Json
 
         // JsonValue -> CLI
 
-        public static implicit operator bool (JsonValue value)
+        public static implicit operator bool(JsonValue value)
         {
             if (value == null)
             {
@@ -353,7 +353,7 @@ namespace System.Json
             return Convert.ToBoolean(((JsonPrimitive)value).Value, CultureInfo.InvariantCulture);
         }
 
-        public static implicit operator byte (JsonValue value)
+        public static implicit operator byte(JsonValue value)
         {
             if (value == null)
             {
@@ -363,7 +363,7 @@ namespace System.Json
             return Convert.ToByte(((JsonPrimitive)value).Value, CultureInfo.InvariantCulture);
         }
 
-        public static implicit operator char (JsonValue value)
+        public static implicit operator char(JsonValue value)
         {
             if (value == null)
             {
@@ -373,7 +373,7 @@ namespace System.Json
             return Convert.ToChar(((JsonPrimitive)value).Value, CultureInfo.InvariantCulture);
         }
 
-        public static implicit operator decimal (JsonValue value)
+        public static implicit operator decimal(JsonValue value)
         {
             if (value == null)
             {
@@ -383,14 +383,14 @@ namespace System.Json
             return Convert.ToDecimal(((JsonPrimitive)value).Value, CultureInfo.InvariantCulture);
         }
 
-        public static implicit operator double (JsonValue value)
+        public static implicit operator double(JsonValue value)
         {
             if (value == null)
                 throw new ArgumentNullException(nameof(value));
             return Convert.ToDouble(((JsonPrimitive)value).Value, CultureInfo.InvariantCulture);
         }
 
-        public static implicit operator float (JsonValue value)
+        public static implicit operator float(JsonValue value)
         {
             if (value == null)
             {
@@ -400,7 +400,7 @@ namespace System.Json
             return Convert.ToSingle(((JsonPrimitive)value).Value, CultureInfo.InvariantCulture);
         }
 
-        public static implicit operator int (JsonValue value)
+        public static implicit operator int(JsonValue value)
         {
             if (value == null)
             {
@@ -410,7 +410,7 @@ namespace System.Json
             return Convert.ToInt32(((JsonPrimitive)value).Value, CultureInfo.InvariantCulture);
         }
 
-        public static implicit operator long (JsonValue value)
+        public static implicit operator long(JsonValue value)
         {
             if (value == null)
             {
@@ -421,7 +421,7 @@ namespace System.Json
         }
 
         [CLSCompliant(false)]
-        public static implicit operator sbyte (JsonValue value)
+        public static implicit operator sbyte(JsonValue value)
         {
             if (value == null)
             {
@@ -431,7 +431,7 @@ namespace System.Json
             return Convert.ToSByte(((JsonPrimitive)value).Value, CultureInfo.InvariantCulture);
         }
 
-        public static implicit operator short (JsonValue value)
+        public static implicit operator short(JsonValue value)
         {
             if (value == null)
             {
@@ -441,7 +441,7 @@ namespace System.Json
             return Convert.ToInt16(((JsonPrimitive)value).Value, CultureInfo.InvariantCulture);
         }
 
-        public static implicit operator string (JsonValue value)
+        public static implicit operator string(JsonValue value)
         {
             return value != null ?
                 (string)((JsonPrimitive)value).Value :
@@ -449,7 +449,7 @@ namespace System.Json
         }
 
         [CLSCompliant(false)]
-        public static implicit operator uint (JsonValue value)
+        public static implicit operator uint(JsonValue value)
         {
             if (value == null)
             {
@@ -460,7 +460,7 @@ namespace System.Json
         }
 
         [CLSCompliant(false)]
-        public static implicit operator ulong (JsonValue value)
+        public static implicit operator ulong(JsonValue value)
         {
             if (value == null)
             {
@@ -471,7 +471,7 @@ namespace System.Json
         }
 
         [CLSCompliant(false)]
-        public static implicit operator ushort (JsonValue value)
+        public static implicit operator ushort(JsonValue value)
         {
             if (value == null)
             {
index 1493357..5342245 100644 (file)
@@ -1090,7 +1090,7 @@ namespace System.Linq.Expressions.Interpreter
                 }
                 else
                 {
-                    _instructions.EmitByRefCall(method, parameters, new[] {updater});
+                    _instructions.EmitByRefCall(method, parameters, new[] { updater });
                     updater.UndefineTemps(_instructions, _locals);
                 }
 
index 369c71c..81494ca 100644 (file)
@@ -13,7 +13,7 @@ namespace System.Linq
         internal abstract Expression Expression { get; }
         internal abstract IEnumerable Enumerable { get; }
 
-        internal EnumerableQuery() {}
+        internal EnumerableQuery() { }
 
         internal static IQueryable Create(Type elementType, IEnumerable sequence)
         {
index ec433c2..774b115 100644 (file)
@@ -168,7 +168,7 @@ namespace System.Linq
                     var interfacesWithInfo = pubType.GetInterfaces().Select(IntrospectionExtensions.GetTypeInfo).ToArray();
                     var singleTypeGenInterfacesWithGetType = interfacesWithInfo
                         .Where(i => i.IsGenericType && i.GenericTypeArguments.Length == 1)
-                        .Select(i => new {Info = i, GenType = i.GetGenericTypeDefinition() })
+                        .Select(i => new { Info = i, GenType = i.GetGenericTypeDefinition() })
                         .ToArray();
                     Type typeArg = singleTypeGenInterfacesWithGetType
                         .Where(i => i.GenType == typeof(IOrderedQueryable<>) || i.GenType == typeof(IOrderedEnumerable<>))
index 583b85c..21b647a 100644 (file)
@@ -10,8 +10,8 @@ using System.Threading;
 using System.Runtime.Versioning;
 using System.Text;
 
-namespace WbemClient_v1 {}
-namespace WbemUtilities_v1 {}
+namespace WbemClient_v1 { }
+namespace WbemUtilities_v1 { }
 
 namespace System.Management
 {
@@ -60,7 +60,7 @@ namespace System.Management
             Dispose_(false);
         }
 
-        private void Dispose_ ( bool finalization )
+        private void Dispose_(bool finalization)
         {
             if (pWbemClassObject != IntPtr.Zero)
             {
@@ -75,7 +75,7 @@ namespace System.Management
             Dispose_(true);
         }
 
-        private void DeserializeFromBlob(byte [] rg)
+        private void DeserializeFromBlob(byte[] rg)
         {
             IntPtr hGlobal = IntPtr.Zero;
             System.Runtime.InteropServices.ComTypes.IStream stream = null;
@@ -100,7 +100,7 @@ namespace System.Management
 
         private byte[] SerializeToBlob()
         {
-            byte [] rg = null;
+            byte[] rg = null;
             System.Runtime.InteropServices.ComTypes.IStream stream = null;
             IntPtr pData = IntPtr.Zero;
             try
@@ -343,7 +343,7 @@ namespace System.Management
         {
             if (pWbemClassObject == IntPtr.Zero)
                 throw new ObjectDisposedException(name);
-            int res =  WmiNetUtilsHelper.BeginMethodEnumeration_f(22, pWbemClassObject, lEnumFlags);
+            int res = WmiNetUtilsHelper.BeginMethodEnumeration_f(22, pWbemClassObject, lEnumFlags);
             GC.KeepAlive(this);
             return res;
         }
@@ -400,24 +400,24 @@ namespace System.Management
 
         private enum STATFLAG
         {
-            STATFLAG_DEFAULT    = 0,
-            STATFLAG_NONAME     = 1
+            STATFLAG_DEFAULT = 0,
+            STATFLAG_NONAME  = 1
         }
 
         private enum MSHCTX
         {
-            MSHCTX_LOCAL               = 0,
-            MSHCTX_NOSHAREDMEM         = 1,
-            MSHCTX_DIFFERENTMACHINE    = 2,
-            MSHCTX_INPROC              = 3
+            MSHCTX_LOCAL            = 0,
+            MSHCTX_NOSHAREDMEM      = 1,
+            MSHCTX_DIFFERENTMACHINE = 2,
+            MSHCTX_INPROC           = 3
         }
 
         private enum MSHLFLAGS
         {
-            MSHLFLAGS_NORMAL         = 0,
-            MSHLFLAGS_TABLESTRONG    = 1,
-            MSHLFLAGS_TABLEWEAK      = 2,
-            MSHLFLAGS_NOPING         = 3
+            MSHLFLAGS_NORMAL      = 0,
+            MSHLFLAGS_TABLESTRONG = 1,
+            MSHLFLAGS_TABLEWEAK   = 2,
+            MSHLFLAGS_NOPING      = 3
         }
     }
 
@@ -438,14 +438,14 @@ namespace System.Management
             Dispose_(false);
         }
 
-        private void Dispose_( bool finalization )
+        private void Dispose_(bool finalization)
         {
             if (pWbemQualifierSet != IntPtr.Zero)
             {
                 Marshal.Release(pWbemQualifierSet);
                 pWbemQualifierSet = IntPtr.Zero;
             }
-            if ( finalization == false )
+            if (finalization == false)
             {
                 GC.KeepAlive(this);
             }
@@ -471,7 +471,7 @@ namespace System.Management
         {
             if (pWbemQualifierSet == IntPtr.Zero)
                 throw new ObjectDisposedException(name);
-            int res =  WmiNetUtilsHelper.QualifierPut_f(4, pWbemQualifierSet, wszName, ref pVal, lFlavor);
+            int res = WmiNetUtilsHelper.QualifierPut_f(4, pWbemQualifierSet, wszName, ref pVal, lFlavor);
             GC.KeepAlive(this);
             return res;
         }
@@ -562,30 +562,30 @@ namespace System.Management
     [ComImport]
     internal interface IWbemClassObject_DoNotMarshal
     {
-        [PreserveSig] int GetQualifierSet_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal   ppQualSet);
-        [PreserveSig] int Get_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
-        [PreserveSig] int Put_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In] ref object pVal, [In] int Type);
-        [PreserveSig] int Delete_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName);
-        [PreserveSig] int GetNames_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszQualifierName, [In] int lFlags, [In] ref object pQualifierVal, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_BSTR)]  out string[]   pNames);
+        [PreserveSig] int GetQualifierSet_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal ppQualSet);
+        [PreserveSig] int Get_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
+        [PreserveSig] int Put_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [In] ref object pVal, [In] int Type);
+        [PreserveSig] int Delete_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName);
+        [PreserveSig] int GetNames_([In][MarshalAs(UnmanagedType.LPWStr)] string wszQualifierName, [In] int lFlags, [In] ref object pQualifierVal, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]  out string[] pNames);
         [PreserveSig] int BeginEnumeration_([In] int lEnumFlags);
-        [PreserveSig] int Next_([In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string   strName, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
+        [PreserveSig] int Next_([In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)] ref string strName, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
         [PreserveSig] int EndEnumeration_();
-        [PreserveSig] int GetPropertyQualifierSet_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszProperty, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal   ppQualSet);
-        [PreserveSig] int Clone_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   ppCopy);
-        [PreserveSig] int GetObjectText_([In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrObjectText);
-        [PreserveSig] int SpawnDerivedClass_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   ppNewClass);
-        [PreserveSig] int SpawnInstance_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   ppNewInstance);
-        [PreserveSig] int CompareTo_([In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pCompareTo);
-        [PreserveSig] int GetPropertyOrigin_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrClassName);
-        [PreserveSig] int InheritsFrom_([In][MarshalAs(UnmanagedType.LPWStr)]  string   strAncestor);
-        [PreserveSig] int GetMethod_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   ppInSignature, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   ppOutSignature);
-        [PreserveSig] int PutMethod_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pInSignature, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pOutSignature);
-        [PreserveSig] int DeleteMethod_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName);
+        [PreserveSig] int GetPropertyQualifierSet_([In][MarshalAs(UnmanagedType.LPWStr)] string wszProperty, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal ppQualSet);
+        [PreserveSig] int Clone_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal ppCopy);
+        [PreserveSig] int GetObjectText_([In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrObjectText);
+        [PreserveSig] int SpawnDerivedClass_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal ppNewClass);
+        [PreserveSig] int SpawnInstance_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal ppNewInstance);
+        [PreserveSig] int CompareTo_([In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pCompareTo);
+        [PreserveSig] int GetPropertyOrigin_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrClassName);
+        [PreserveSig] int InheritsFrom_([In][MarshalAs(UnmanagedType.LPWStr)] string strAncestor);
+        [PreserveSig] int GetMethod_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal ppInSignature, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal ppOutSignature);
+        [PreserveSig] int PutMethod_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pInSignature, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pOutSignature);
+        [PreserveSig] int DeleteMethod_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName);
         [PreserveSig] int BeginMethodEnumeration_([In] int lEnumFlags);
-        [PreserveSig] int NextMethod_([In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string   pstrName, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal   ppInSignature, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal   ppOutSignature);
+        [PreserveSig] int NextMethod_([In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string pstrName, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal ppInSignature, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal ppOutSignature);
         [PreserveSig] int EndMethodEnumeration_();
-        [PreserveSig] int GetMethodQualifierSet_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszMethod, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal   ppQualSet);
-        [PreserveSig] int GetMethodOrigin_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszMethodName, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrClassName);
+        [PreserveSig] int GetMethodQualifierSet_([In][MarshalAs(UnmanagedType.LPWStr)] string wszMethod, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal ppQualSet);
+        [PreserveSig] int GetMethodOrigin_([In][MarshalAs(UnmanagedType.LPWStr)] string wszMethodName, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrClassName);
     }
 
     [InterfaceTypeAttribute(0x0001)]
@@ -594,12 +594,12 @@ namespace System.Management
     [ComImport]
     internal interface IWbemQualifierSet_DoNotMarshal
     {
-        [PreserveSig] int Get_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In][Out] ref object pVal, [In][Out] ref int plFlavor);
-        [PreserveSig] int Put_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] ref object pVal, [In] int lFlavor);
-        [PreserveSig] int Delete_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName);
-        [PreserveSig] int GetNames_([In] int lFlags, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_BSTR)]  out string[]   pNames);
+        [PreserveSig] int Get_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [In][Out] ref object pVal, [In][Out] ref int plFlavor);
+        [PreserveSig] int Put_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] ref object pVal, [In] int lFlavor);
+        [PreserveSig] int Delete_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName);
+        [PreserveSig] int GetNames_([In] int lFlags, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]  out string[] pNames);
         [PreserveSig] int BeginEnumeration_([In] int lFlags);
-        [PreserveSig] int Next_([In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string   pstrName, [In][Out] ref object pVal, [In][Out] ref int plFlavor);
+        [PreserveSig] int Next_([In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string pstrName, [In][Out] ref object pVal, [In][Out] ref int plFlavor);
         [PreserveSig] int EndEnumeration_();
     }
 
@@ -609,7 +609,7 @@ namespace System.Management
     [ComImport]
     internal interface IWbemLocator
     {
-        [PreserveSig] int ConnectServer_([In][MarshalAs(UnmanagedType.BStr)]  string   strNetworkResource, [In][MarshalAs(UnmanagedType.BStr)]  string   strUser, [In]IntPtr   strPassword, [In][MarshalAs(UnmanagedType.BStr)]  string   strLocale, [In] int lSecurityFlags, [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemServices   ppNamespace);
+        [PreserveSig] int ConnectServer_([In][MarshalAs(UnmanagedType.BStr)] string strNetworkResource, [In][MarshalAs(UnmanagedType.BStr)] string strUser, [In]IntPtr strPassword, [In][MarshalAs(UnmanagedType.BStr)] string strLocale, [In] int lSecurityFlags, [In][MarshalAs(UnmanagedType.BStr)] string strAuthority, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemServices ppNamespace);
     }
 
     [GuidAttribute("44ACA674-E8FC-11D0-A07C-00C04FB68820")]
@@ -618,14 +618,14 @@ namespace System.Management
     [ComImport]
     internal interface IWbemContext
     {
-        [PreserveSig] int Clone_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemContext   ppNewCopy);
-        [PreserveSig] int GetNames_([In] int lFlags, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_BSTR)]  out string[]   pNames);
+        [PreserveSig] int Clone_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemContext ppNewCopy);
+        [PreserveSig] int GetNames_([In] int lFlags, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]  out string[] pNames);
         [PreserveSig] int BeginEnumeration_([In] int lFlags);
-        [PreserveSig] int Next_([In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrName, [Out] out object pValue);
+        [PreserveSig] int Next_([In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrName, [Out] out object pValue);
         [PreserveSig] int EndEnumeration_();
-        [PreserveSig] int SetValue_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In] ref object pValue);
-        [PreserveSig] int GetValue_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [Out] out object pValue);
-        [PreserveSig] int DeleteValue_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags);
+        [PreserveSig] int SetValue_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [In] ref object pValue);
+        [PreserveSig] int GetValue_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [Out] out object pValue);
+        [PreserveSig] int DeleteValue_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags);
         [PreserveSig] int DeleteAll_();
     }
 
@@ -635,29 +635,29 @@ namespace System.Management
     [ComImport]
     internal interface IWbemServices
     {
-        [PreserveSig] int OpenNamespace_([In][MarshalAs(UnmanagedType.BStr)]  string   strNamespace, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemServices   ppWorkingNamespace, [In] IntPtr ppCallResult);
-        [PreserveSig] int CancelAsyncCall_([In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pSink);
-        [PreserveSig] int QueryObjectSink_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemObjectSink   ppResponseHandler);
-        [PreserveSig] int GetObject_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(MarshalWbemObject))] out IWbemClassObjectFreeThreaded ppObject, [In] IntPtr ppCallResult);
-        [PreserveSig] int GetObjectAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int PutClass_([In] IntPtr pObject, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In] IntPtr ppCallResult);
-        [PreserveSig] int PutClassAsync_([In] IntPtr pObject, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int DeleteClass_([In][MarshalAs(UnmanagedType.BStr)]  string   strClass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In] IntPtr ppCallResult);
-        [PreserveSig] int DeleteClassAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strClass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int CreateClassEnum_([In][MarshalAs(UnmanagedType.BStr)]  string   strSuperclass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum);
-        [PreserveSig] int CreateClassEnumAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strSuperclass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int PutInstance_([In] IntPtr pInst, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In] IntPtr ppCallResult);
-        [PreserveSig] int PutInstanceAsync_([In] IntPtr pInst, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int DeleteInstance_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In] IntPtr ppCallResult);
-        [PreserveSig] int DeleteInstanceAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int CreateInstanceEnum_([In][MarshalAs(UnmanagedType.BStr)]  string   strFilter, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum);
-        [PreserveSig] int CreateInstanceEnumAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strFilter, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int ExecQuery_([In][MarshalAs(UnmanagedType.BStr)]  string   strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)]  string   strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum);
-        [PreserveSig] int ExecQueryAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)]  string   strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int ExecNotificationQuery_([In][MarshalAs(UnmanagedType.BStr)]  string   strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)]  string   strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum);
-        [PreserveSig] int ExecNotificationQueryAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)]  string   strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int ExecMethod_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In][MarshalAs(UnmanagedType.BStr)]  string   strMethodName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In] IntPtr pInParams, [Out][MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(MarshalWbemObject))] out IWbemClassObjectFreeThreaded ppOutParams, [In] IntPtr ppCallResult);
-        [PreserveSig] int ExecMethodAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In][MarshalAs(UnmanagedType.BStr)]  string   strMethodName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In] IntPtr pInParams, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
+        [PreserveSig] int OpenNamespace_([In][MarshalAs(UnmanagedType.BStr)] string strNamespace, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemServices ppWorkingNamespace, [In] IntPtr ppCallResult);
+        [PreserveSig] int CancelAsyncCall_([In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pSink);
+        [PreserveSig] int QueryObjectSink_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemObjectSink ppResponseHandler);
+        [PreserveSig] int GetObject_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(MarshalWbemObject))] out IWbemClassObjectFreeThreaded ppObject, [In] IntPtr ppCallResult);
+        [PreserveSig] int GetObjectAsync_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int PutClass_([In] IntPtr pObject, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In] IntPtr ppCallResult);
+        [PreserveSig] int PutClassAsync_([In] IntPtr pObject, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int DeleteClass_([In][MarshalAs(UnmanagedType.BStr)] string strClass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In] IntPtr ppCallResult);
+        [PreserveSig] int DeleteClassAsync_([In][MarshalAs(UnmanagedType.BStr)] string strClass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int CreateClassEnum_([In][MarshalAs(UnmanagedType.BStr)] string strSuperclass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum);
+        [PreserveSig] int CreateClassEnumAsync_([In][MarshalAs(UnmanagedType.BStr)] string strSuperclass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int PutInstance_([In] IntPtr pInst, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In] IntPtr ppCallResult);
+        [PreserveSig] int PutInstanceAsync_([In] IntPtr pInst, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int DeleteInstance_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In] IntPtr ppCallResult);
+        [PreserveSig] int DeleteInstanceAsync_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int CreateInstanceEnum_([In][MarshalAs(UnmanagedType.BStr)] string strFilter, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum);
+        [PreserveSig] int CreateInstanceEnumAsync_([In][MarshalAs(UnmanagedType.BStr)] string strFilter, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int ExecQuery_([In][MarshalAs(UnmanagedType.BStr)] string strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)] string strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum);
+        [PreserveSig] int ExecQueryAsync_([In][MarshalAs(UnmanagedType.BStr)] string strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)] string strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int ExecNotificationQuery_([In][MarshalAs(UnmanagedType.BStr)] string strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)] string strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum);
+        [PreserveSig] int ExecNotificationQueryAsync_([In][MarshalAs(UnmanagedType.BStr)] string strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)] string strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int ExecMethod_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In][MarshalAs(UnmanagedType.BStr)] string strMethodName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In] IntPtr pInParams, [Out][MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(MarshalWbemObject))] out IWbemClassObjectFreeThreaded ppOutParams, [In] IntPtr ppCallResult);
+        [PreserveSig] int ExecMethodAsync_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In][MarshalAs(UnmanagedType.BStr)] string strMethodName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In] IntPtr pInParams, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
     }
 
     [InterfaceTypeAttribute(0x0001)]
@@ -666,29 +666,29 @@ namespace System.Management
     [ComImport]
     internal interface IWbemServices_Old
     {
-        [PreserveSig] int OpenNamespace_([In][MarshalAs(UnmanagedType.BStr)]  string   strNamespace, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemServices   ppWorkingNamespace, [In] IntPtr ppCallResult);
-        [PreserveSig] int CancelAsyncCall_([In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pSink);
-        [PreserveSig] int QueryObjectSink_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemObjectSink   ppResponseHandler);
-        [PreserveSig] int GetObject_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal   ppObject, [In] IntPtr ppCallResult);
-        [PreserveSig] int GetObjectAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int PutClass_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pObject, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In] IntPtr ppCallResult);
-        [PreserveSig] int PutClassAsync_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pObject, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int DeleteClass_([In][MarshalAs(UnmanagedType.BStr)]  string   strClass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In] IntPtr ppCallResult);
-        [PreserveSig] int DeleteClassAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strClass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int CreateClassEnum_([In][MarshalAs(UnmanagedType.BStr)]  string   strSuperclass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum);
-        [PreserveSig] int CreateClassEnumAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strSuperclass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int PutInstance_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pInst, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In] IntPtr ppCallResult);
-        [PreserveSig] int PutInstanceAsync_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pInst, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int DeleteInstance_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In] IntPtr ppCallResult);
-        [PreserveSig] int DeleteInstanceAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int CreateInstanceEnum_([In][MarshalAs(UnmanagedType.BStr)]  string   strFilter, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum);
-        [PreserveSig] int CreateInstanceEnumAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strFilter, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int ExecQuery_([In][MarshalAs(UnmanagedType.BStr)]  string   strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)]  string   strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum);
-        [PreserveSig] int ExecQueryAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)]  string   strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int ExecNotificationQuery_([In][MarshalAs(UnmanagedType.BStr)]  string   strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)]  string   strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum);
-        [PreserveSig] int ExecNotificationQueryAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)]  string   strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
-        [PreserveSig] int ExecMethod_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In][MarshalAs(UnmanagedType.BStr)]  string   strMethodName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pInParams, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal   ppOutParams, [In] IntPtr ppCallResult);
-        [PreserveSig] int ExecMethodAsync_([In][MarshalAs(UnmanagedType.BStr)]  string   strObjectPath, [In][MarshalAs(UnmanagedType.BStr)]  string   strMethodName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pInParams, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pResponseHandler);
+        [PreserveSig] int OpenNamespace_([In][MarshalAs(UnmanagedType.BStr)] string strNamespace, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemServices ppWorkingNamespace, [In] IntPtr ppCallResult);
+        [PreserveSig] int CancelAsyncCall_([In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pSink);
+        [PreserveSig] int QueryObjectSink_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemObjectSink ppResponseHandler);
+        [PreserveSig] int GetObject_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal ppObject, [In] IntPtr ppCallResult);
+        [PreserveSig] int GetObjectAsync_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int PutClass_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pObject, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In] IntPtr ppCallResult);
+        [PreserveSig] int PutClassAsync_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pObject, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int DeleteClass_([In][MarshalAs(UnmanagedType.BStr)] string strClass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In] IntPtr ppCallResult);
+        [PreserveSig] int DeleteClassAsync_([In][MarshalAs(UnmanagedType.BStr)] string strClass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int CreateClassEnum_([In][MarshalAs(UnmanagedType.BStr)] string strSuperclass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum);
+        [PreserveSig] int CreateClassEnumAsync_([In][MarshalAs(UnmanagedType.BStr)] string strSuperclass, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int PutInstance_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pInst, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In] IntPtr ppCallResult);
+        [PreserveSig] int PutInstanceAsync_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pInst, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int DeleteInstance_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In] IntPtr ppCallResult);
+        [PreserveSig] int DeleteInstanceAsync_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int CreateInstanceEnum_([In][MarshalAs(UnmanagedType.BStr)] string strFilter, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum);
+        [PreserveSig] int CreateInstanceEnumAsync_([In][MarshalAs(UnmanagedType.BStr)] string strFilter, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int ExecQuery_([In][MarshalAs(UnmanagedType.BStr)] string strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)] string strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum);
+        [PreserveSig] int ExecQueryAsync_([In][MarshalAs(UnmanagedType.BStr)] string strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)] string strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int ExecNotificationQuery_([In][MarshalAs(UnmanagedType.BStr)] string strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)] string strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum);
+        [PreserveSig] int ExecNotificationQueryAsync_([In][MarshalAs(UnmanagedType.BStr)] string strQueryLanguage, [In][MarshalAs(UnmanagedType.BStr)] string strQuery, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
+        [PreserveSig] int ExecMethod_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In][MarshalAs(UnmanagedType.BStr)] string strMethodName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pInParams, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal ppOutParams, [In] IntPtr ppCallResult);
+        [PreserveSig] int ExecMethodAsync_([In][MarshalAs(UnmanagedType.BStr)] string strObjectPath, [In][MarshalAs(UnmanagedType.BStr)] string strMethodName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pInParams, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pResponseHandler);
     }
 
     [GuidAttribute("44ACA675-E8FC-11D0-A07C-00C04FB68820")]
@@ -697,9 +697,9 @@ namespace System.Management
     [ComImport]
     internal interface IWbemCallResult
     {
-        [PreserveSig] int GetResultObject_([In] int lTimeout, [Out][MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(MarshalWbemObject))] out IWbemClassObjectFreeThreaded ppResultObject);
-        [PreserveSig] int GetResultString_([In] int lTimeout, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrResultString);
-        [PreserveSig] int GetResultServices_([In] int lTimeout, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemServices   ppServices);
+        [PreserveSig] int GetResultObject_([In] int lTimeout, [Out][MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(MarshalWbemObject))] out IWbemClassObjectFreeThreaded ppResultObject);
+        [PreserveSig] int GetResultString_([In] int lTimeout, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrResultString);
+        [PreserveSig] int GetResultServices_([In] int lTimeout, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemServices ppServices);
         [PreserveSig] int GetCallStatus_([In] int lTimeout, [Out] out int plStatus);
     }
 
@@ -710,7 +710,7 @@ namespace System.Management
     internal interface IWbemObjectSink
     {
         [PreserveSig] int Indicate_([In] int lObjectCount, [In][MarshalAs(UnmanagedType.LPArray)] IntPtr[] apObjArray);
-        [PreserveSig] int SetStatus_([In] int lFlags, [In][MarshalAs(UnmanagedType.Error)]  int   hResult, [In][MarshalAs(UnmanagedType.BStr)]  string   strParam, [In] IntPtr pObjParam);
+        [PreserveSig] int SetStatus_([In] int lFlags, [In][MarshalAs(UnmanagedType.Error)]  int hResult, [In][MarshalAs(UnmanagedType.BStr)] string strParam, [In] IntPtr pObjParam);
     }
 
     [InterfaceTypeAttribute(0x0001)]
@@ -721,8 +721,8 @@ namespace System.Management
     {
         [PreserveSig] int Reset_();
         [PreserveSig] int Next_([In] int lTimeout, [In] uint uCount, [In][Out][MarshalAs(UnmanagedType.LPArray)] IWbemClassObject_DoNotMarshal[] apObjects, [Out] out uint puReturned);
-        [PreserveSig] int NextAsync_([In] uint uCount, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pSink);
-        [PreserveSig] int Clone_([Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum);
+        [PreserveSig] int NextAsync_([In] uint uCount, [In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pSink);
+        [PreserveSig] int Clone_([Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum);
         [PreserveSig] int Skip_([In] int lTimeout, [In] uint nCount);
     }
 
@@ -731,7 +731,7 @@ namespace System.Management
     [ComImport]
     internal interface IWbemShutdown
     {
-        [PreserveSig] int Shutdown_([In] int uReason, [In] uint uMaxMilliseconds, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx);
+        [PreserveSig] int Shutdown_([In] int uReason, [In] uint uMaxMilliseconds, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx);
     }
 
     [InterfaceTypeAttribute(0x0001)]
@@ -740,8 +740,8 @@ namespace System.Management
     [ComImport]
     internal interface IWbemObjectTextSrc
     {
-        [PreserveSig] int GetText_([In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pObj, [In] uint uObjTextFormat, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.BStr)]  out string   strText);
-        [PreserveSig] int CreateFromText_([In] int lFlags, [In][MarshalAs(UnmanagedType.BStr)]  string   strText, [In] uint uObjTextFormat, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   pNewObj);
+        [PreserveSig] int GetText_([In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pObj, [In] uint uObjTextFormat, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.BStr)]  out string strText);
+        [PreserveSig] int CreateFromText_([In] int lFlags, [In][MarshalAs(UnmanagedType.BStr)] string strText, [In] uint uObjTextFormat, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal pNewObj);
     }
 
     [GuidAttribute("49353C9A-516B-11D1-AEA6-00C04FB68820")]
@@ -750,38 +750,38 @@ namespace System.Management
     [ComImport]
     internal interface IWbemObjectAccess
     {
-        [PreserveSig] int GetQualifierSet_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal   ppQualSet);
-        [PreserveSig] int Get_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
-        [PreserveSig] int Put_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In] ref object pVal, [In] int Type);
-        [PreserveSig] int Delete_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName);
-        [PreserveSig] int GetNames_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszQualifierName, [In] int lFlags, [In] ref object pQualifierVal, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_BSTR)]  out string[]   pNames);
+        [PreserveSig] int GetQualifierSet_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal ppQualSet);
+        [PreserveSig] int Get_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
+        [PreserveSig] int Put_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [In] ref object pVal, [In] int Type);
+        [PreserveSig] int Delete_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName);
+        [PreserveSig] int GetNames_([In][MarshalAs(UnmanagedType.LPWStr)] string wszQualifierName, [In] int lFlags, [In] ref object pQualifierVal, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]  out string[] pNames);
         [PreserveSig] int BeginEnumeration_([In] int lEnumFlags);
-        [PreserveSig] int Next_([In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string   strName, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
+        [PreserveSig] int Next_([In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string strName, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
         [PreserveSig] int EndEnumeration_();
-        [PreserveSig] int GetPropertyQualifierSet_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszProperty, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal   ppQualSet);
-        [PreserveSig] int Clone_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   ppCopy);
-        [PreserveSig] int GetObjectText_([In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrObjectText);
-        [PreserveSig] int SpawnDerivedClass_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   ppNewClass);
-        [PreserveSig] int SpawnInstance_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   ppNewInstance);
-        [PreserveSig] int CompareTo_([In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pCompareTo);
-        [PreserveSig] int GetPropertyOrigin_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrClassName);
-        [PreserveSig] int InheritsFrom_([In][MarshalAs(UnmanagedType.LPWStr)]  string   strAncestor);
-        [PreserveSig] int GetMethod_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   ppInSignature, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal   ppOutSignature);
-        [PreserveSig] int PutMethod_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pInSignature, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pOutSignature);
-        [PreserveSig] int DeleteMethod_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName);
+        [PreserveSig] int GetPropertyQualifierSet_([In][MarshalAs(UnmanagedType.LPWStr)] string wszProperty, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal ppQualSet);
+        [PreserveSig] int Clone_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal ppCopy);
+        [PreserveSig] int GetObjectText_([In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrObjectText);
+        [PreserveSig] int SpawnDerivedClass_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal ppNewClass);
+        [PreserveSig] int SpawnInstance_([In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal ppNewInstance);
+        [PreserveSig] int CompareTo_([In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pCompareTo);
+        [PreserveSig] int GetPropertyOrigin_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrClassName);
+        [PreserveSig] int InheritsFrom_([In][MarshalAs(UnmanagedType.LPWStr)] string strAncestor);
+        [PreserveSig] int GetMethod_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal ppInSignature, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemClassObject_DoNotMarshal ppOutSignature);
+        [PreserveSig] int PutMethod_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pInSignature, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pOutSignature);
+        [PreserveSig] int DeleteMethod_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName);
         [PreserveSig] int BeginMethodEnumeration_([In] int lEnumFlags);
-        [PreserveSig] int NextMethod_([In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string   pstrName, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal   ppInSignature, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal   ppOutSignature);
+        [PreserveSig] int NextMethod_([In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string pstrName, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal ppInSignature, [In][Out][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal ppOutSignature);
         [PreserveSig] int EndMethodEnumeration_();
-        [PreserveSig] int GetMethodQualifierSet_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszMethod, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal   ppQualSet);
-        [PreserveSig] int GetMethodOrigin_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszMethodName, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrClassName);
-        [PreserveSig] int GetPropertyHandle_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszPropertyName, [Out] out int pType, [Out] out int plHandle);
+        [PreserveSig] int GetMethodQualifierSet_([In][MarshalAs(UnmanagedType.LPWStr)] string wszMethod, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemQualifierSet_DoNotMarshal ppQualSet);
+        [PreserveSig] int GetMethodOrigin_([In][MarshalAs(UnmanagedType.LPWStr)] string wszMethodName, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrClassName);
+        [PreserveSig] int GetPropertyHandle_([In][MarshalAs(UnmanagedType.LPWStr)] string wszPropertyName, [Out] out int pType, [Out] out int plHandle);
         [PreserveSig] int WritePropertyValue_([In] int lHandle, [In] int lNumBytes, [In] ref byte aData);
         [PreserveSig] int ReadPropertyValue_([In] int lHandle, [In] int lBufferSize, [Out] out int plNumBytes, [Out] out byte aData);
         [PreserveSig] int ReadDWORD_([In] int lHandle, [Out] out uint pdw);
         [PreserveSig] int WriteDWORD_([In] int lHandle, [In] uint dw);
         [PreserveSig] int ReadQWORD_([In] int lHandle, [Out] out ulong pqw);
         [PreserveSig] int WriteQWORD_([In] int lHandle, [In] ulong pw);
-        [PreserveSig] int GetPropertyInfoByHandle_([In] int lHandle, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrName, [Out] out int pType);
+        [PreserveSig] int GetPropertyInfoByHandle_([In] int lHandle, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrName, [Out] out int pType);
         [PreserveSig] int Lock_([In] int lFlags);
         [PreserveSig] int Unlock_([In] int lFlags);
     }
@@ -792,7 +792,7 @@ namespace System.Management
     [ComImport]
     internal interface IUnsecuredApartment
     {
-        [PreserveSig] int CreateObjectStub_([In][MarshalAs(UnmanagedType.IUnknown)]  object   pObject, [Out][MarshalAs(UnmanagedType.IUnknown)]  out object   ppStub);
+        [PreserveSig] int CreateObjectStub_([In][MarshalAs(UnmanagedType.IUnknown)]  object pObject, [Out][MarshalAs(UnmanagedType.IUnknown)]  out object ppStub);
     }
 
     [GuidAttribute("EB87E1BC-3233-11D2-AEC9-00C04FB68820")]
@@ -800,8 +800,8 @@ namespace System.Management
     [ComImport]
     internal interface IWbemStatusCodeText
     {
-        [PreserveSig] int GetErrorCodeText_([In][MarshalAs(UnmanagedType.Error)]  int   hRes, [In] uint LocaleId, [In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string   MessageText);
-        [PreserveSig] int GetFacilityCodeText_([In][MarshalAs(UnmanagedType.Error)]  int   hRes, [In] uint LocaleId, [In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string   MessageText);
+        [PreserveSig] int GetErrorCodeText_([In][MarshalAs(UnmanagedType.Error)]  int hRes, [In] uint LocaleId, [In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string MessageText);
+        [PreserveSig] int GetFacilityCodeText_([In][MarshalAs(UnmanagedType.Error)]  int hRes, [In] uint LocaleId, [In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string MessageText);
     }
 
     [InterfaceTypeAttribute(0x0001)]
@@ -810,7 +810,7 @@ namespace System.Management
     [ComImport]
     internal interface IWbemUnboundObjectSink
     {
-        [PreserveSig] int IndicateToConsumer_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pLogicalConsumer, [In] int lNumObjects, [In][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal   apObjects);
+        [PreserveSig] int IndicateToConsumer_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pLogicalConsumer, [In] int lNumObjects, [In][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal apObjects);
     }
 
     [InterfaceTypeAttribute(0x0001)]
@@ -819,8 +819,8 @@ namespace System.Management
     [ComImport]
     internal interface IWbemPropertyProvider
     {
-        [PreserveSig] int GetProperty_([In] int lFlags, [In][MarshalAs(UnmanagedType.BStr)]  string   strLocale, [In][MarshalAs(UnmanagedType.BStr)]  string   strClassMapping, [In][MarshalAs(UnmanagedType.BStr)]  string   strInstMapping, [In][MarshalAs(UnmanagedType.BStr)]  string   strPropMapping, [Out] out object pvValue);
-        [PreserveSig] int PutProperty_([In] int lFlags, [In][MarshalAs(UnmanagedType.BStr)]  string   strLocale, [In][MarshalAs(UnmanagedType.BStr)]  string   strClassMapping, [In][MarshalAs(UnmanagedType.BStr)]  string   strInstMapping, [In][MarshalAs(UnmanagedType.BStr)]  string   strPropMapping, [In] ref object pvValue);
+        [PreserveSig] int GetProperty_([In] int lFlags, [In][MarshalAs(UnmanagedType.BStr)] string strLocale, [In][MarshalAs(UnmanagedType.BStr)] string strClassMapping, [In][MarshalAs(UnmanagedType.BStr)] string strInstMapping, [In][MarshalAs(UnmanagedType.BStr)] string strPropMapping, [Out] out object pvValue);
+        [PreserveSig] int PutProperty_([In] int lFlags, [In][MarshalAs(UnmanagedType.BStr)] string strLocale, [In][MarshalAs(UnmanagedType.BStr)] string strClassMapping, [In][MarshalAs(UnmanagedType.BStr)] string strInstMapping, [In][MarshalAs(UnmanagedType.BStr)] string strPropMapping, [In] ref object pvValue);
     }
 
     [InterfaceTypeAttribute(0x0001)]
@@ -829,7 +829,7 @@ namespace System.Management
     [ComImport]
     internal interface IWbemEventProvider
     {
-        [PreserveSig] int ProvideEvents_([In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink   pSink, [In] int lFlags);
+        [PreserveSig] int ProvideEvents_([In][MarshalAs(UnmanagedType.Interface)]  IWbemObjectSink pSink, [In] int lFlags);
     }
 
     [GuidAttribute("580ACAF8-FA1C-11D0-AD72-00C04FD8FDFF")]
@@ -838,7 +838,7 @@ namespace System.Management
     [ComImport]
     internal interface IWbemEventProviderQuerySink
     {
-        [PreserveSig] int NewQuery_([In] uint dwId, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszQueryLanguage, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszQuery);
+        [PreserveSig] int NewQuery_([In] uint dwId, [In][MarshalAs(UnmanagedType.LPWStr)] string wszQueryLanguage, [In][MarshalAs(UnmanagedType.LPWStr)] string wszQuery);
         [PreserveSig] int CancelQuery_([In] uint dwId);
     }
 
@@ -848,7 +848,7 @@ namespace System.Management
     [ComImport]
     internal interface IWbemEventProviderSecurity
     {
-        [PreserveSig] int AccessCheck_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszQueryLanguage, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszQuery, [In] int lSidLength, [In] ref byte pSid);
+        [PreserveSig] int AccessCheck_([In][MarshalAs(UnmanagedType.LPWStr)] string wszQueryLanguage, [In][MarshalAs(UnmanagedType.LPWStr)] string wszQuery, [In] int lSidLength, [In] ref byte pSid);
     }
 
     [GuidAttribute("631F7D97-D993-11D2-B339-00105A1F4AAF")]
@@ -857,7 +857,7 @@ namespace System.Management
     [ComImport]
     internal interface IWbemProviderIdentity
     {
-        [PreserveSig] int SetRegistrationObject_([In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pProvReg);
+        [PreserveSig] int SetRegistrationObject_([In] int lFlags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pProvReg);
     }
 
     [InterfaceTypeAttribute(0x0001)]
@@ -866,7 +866,7 @@ namespace System.Management
     [ComImport]
     internal interface IWbemEventConsumerProvider
     {
-        [PreserveSig] int FindConsumer_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pLogicalConsumer, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemUnboundObjectSink   ppConsumer);
+        [PreserveSig] int FindConsumer_([In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pLogicalConsumer, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemUnboundObjectSink ppConsumer);
     }
 
     [GuidAttribute("1BE41571-91DD-11D1-AEB2-00C04FB68820")]
@@ -882,7 +882,7 @@ namespace System.Management
     [ComImport]
     internal interface IWbemProviderInit
     {
-        [PreserveSig] int Initialize_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszUser, [In] int lFlags, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszNamespace, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszLocale, [In][MarshalAs(UnmanagedType.Interface)]  IWbemServices   pNamespace, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemProviderInitSink   pInitSink);
+        [PreserveSig] int Initialize_([In][MarshalAs(UnmanagedType.LPWStr)] string wszUser, [In] int lFlags, [In][MarshalAs(UnmanagedType.LPWStr)] string wszNamespace, [In][MarshalAs(UnmanagedType.LPWStr)] string wszLocale, [In][MarshalAs(UnmanagedType.Interface)]  IWbemServices pNamespace, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx, [In][MarshalAs(UnmanagedType.Interface)]  IWbemProviderInitSink pInitSink);
     }
 
     [InterfaceTypeAttribute(0x0001)]
@@ -890,7 +890,7 @@ namespace System.Management
     [ComImport]
     internal interface IWbemDecoupledRegistrar
     {
-        [PreserveSig] int Register_([In] int flags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   context, [In][MarshalAs(UnmanagedType.LPWStr)]  string   user, [In][MarshalAs(UnmanagedType.LPWStr)]  string   locale, [In][MarshalAs(UnmanagedType.LPWStr)]  string   scope, [In][MarshalAs(UnmanagedType.LPWStr)]  string   registration, [In][MarshalAs(UnmanagedType.IUnknown)]  object   unknown);
+        [PreserveSig] int Register_([In] int flags, [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext context, [In][MarshalAs(UnmanagedType.LPWStr)] string user, [In][MarshalAs(UnmanagedType.LPWStr)] string locale, [In][MarshalAs(UnmanagedType.LPWStr)] string scope, [In][MarshalAs(UnmanagedType.LPWStr)] string registration, [In][MarshalAs(UnmanagedType.IUnknown)]  object unknown);
         [PreserveSig] int UnRegister_();
     }
 
@@ -900,12 +900,12 @@ namespace System.Management
     [ComImport]
     internal interface IWbemEventSink
     {
-        [PreserveSig] int Indicate_([In] int lObjectCount, [In][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal   apObjArray);
-        [PreserveSig] int SetStatus_([In] int lFlags, [In][MarshalAs(UnmanagedType.Error)]  int   hResult, [In][MarshalAs(UnmanagedType.BStr)]  string   strParam, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal   pObjParam);
-        [PreserveSig] int IndicateWithSD_([In] int lNumObjects, [In][MarshalAs(UnmanagedType.IUnknown)]  ref object   apObjects, [In] int lSDLength, [In] ref byte pSD);
+        [PreserveSig] int Indicate_([In] int lObjectCount, [In][MarshalAs(UnmanagedType.Interface)]  ref IWbemClassObject_DoNotMarshal apObjArray);
+        [PreserveSig] int SetStatus_([In] int lFlags, [In][MarshalAs(UnmanagedType.Error)]  int hResult, [In][MarshalAs(UnmanagedType.BStr)] string strParam, [In][MarshalAs(UnmanagedType.Interface)]  IWbemClassObject_DoNotMarshal pObjParam);
+        [PreserveSig] int IndicateWithSD_([In] int lNumObjects, [In][MarshalAs(UnmanagedType.IUnknown)]  ref object apObjects, [In] int lSDLength, [In] ref byte pSD);
         [PreserveSig] int SetSinkSecurity_([In] int lSDLength, [In] ref byte pSD);
         [PreserveSig] int IsActive_();
-        [PreserveSig] int GetRestrictedSink_([In] int lNumQueries, [In][MarshalAs(UnmanagedType.LPWStr)]  ref string   awszQueries, [In][MarshalAs(UnmanagedType.IUnknown)]  object   pCallback, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemEventSink   ppSink);
+        [PreserveSig] int GetRestrictedSink_([In] int lNumQueries, [In][MarshalAs(UnmanagedType.LPWStr)]  ref string awszQueries, [In][MarshalAs(UnmanagedType.IUnknown)]  object pCallback, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemEventSink ppSink);
         [PreserveSig] int SetBatchingParameters_([In] int lFlags, [In] uint dwMaxBufferSize, [In] uint dwMaxSendLatency);
     }
 
@@ -916,15 +916,15 @@ namespace System.Management
     internal interface IWbemPathKeyList
     {
         [PreserveSig] int GetCount_([Out] out uint puKeyCount);
-        [PreserveSig] int SetKey_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] uint uFlags, [In] uint uCimType, [In] IntPtr pKeyVal);
-        [PreserveSig] int SetKey2_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] uint uFlags, [In] uint uCimType, [In] ref object pKeyVal);
-        [PreserveSig] int GetKey_([In] uint uKeyIx, [In] uint uFlags, [In][Out] ref uint puNameBufSize, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 2)]  char[]   pszKeyName, [In][Out] ref uint puKeyValBufSize, [In][Out] IntPtr pKeyVal, [Out] out uint puApparentCimType);
-        [PreserveSig] int GetKey2_([In] uint uKeyIx, [In] uint uFlags, [In][Out] ref uint puNameBufSize, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 2)]  char[]   pszKeyName, [In][Out] ref object pKeyValue, [Out] out uint puApparentCimType);
-        [PreserveSig] int RemoveKey_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] uint uFlags);
+        [PreserveSig] int SetKey_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] uint uFlags, [In] uint uCimType, [In] IntPtr pKeyVal);
+        [PreserveSig] int SetKey2_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] uint uFlags, [In] uint uCimType, [In] ref object pKeyVal);
+        [PreserveSig] int GetKey_([In] uint uKeyIx, [In] uint uFlags, [In][Out] ref uint puNameBufSize, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 2)]  char[] pszKeyName, [In][Out] ref uint puKeyValBufSize, [In][Out] IntPtr pKeyVal, [Out] out uint puApparentCimType);
+        [PreserveSig] int GetKey2_([In] uint uKeyIx, [In] uint uFlags, [In][Out] ref uint puNameBufSize, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 2)]  char[] pszKeyName, [In][Out] ref object pKeyValue, [Out] out uint puApparentCimType);
+        [PreserveSig] int RemoveKey_([In][MarshalAs(UnmanagedType.LPWStr)] string wszName, [In] uint uFlags);
         [PreserveSig] int RemoveAllKeys_([In] uint uFlags);
         [PreserveSig] int MakeSingleton_([In] sbyte bSet);
         [PreserveSig] int GetInfo_([In] uint uRequestedInfo, [Out] out ulong puResponse);
-        [PreserveSig] int GetText_([In] int lFlags, [In][Out] ref uint puBuffLength, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 1)]  char[]   pszText);
+        [PreserveSig] int GetText_([In] int lFlags, [In][Out] ref uint puBuffLength, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 1)]  char[] pszText);
     }
 
     [GuidAttribute("3BC15AF2-736C-477E-9E51-238AF8667DCC")]
@@ -932,32 +932,32 @@ namespace System.Management
     [ComImport]
     internal interface IWbemPath
     {
-        [PreserveSig] int SetText_([In] uint uMode, [In][MarshalAs(UnmanagedType.LPWStr)]  string   pszPath);
-        [PreserveSig] int GetText_([In] int lFlags, [In][Out] ref uint puBuffLength, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 1)]  char[]   pszText);
+        [PreserveSig] int SetText_([In] uint uMode, [In][MarshalAs(UnmanagedType.LPWStr)] string pszPath);
+        [PreserveSig] int GetText_([In] int lFlags, [In][Out] ref uint puBuffLength, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 1)]  char[] pszText);
         [PreserveSig] int GetInfo_([In] uint uRequestedInfo, [Out] out ulong puResponse);
-        [PreserveSig] int SetServer_([In][MarshalAs(UnmanagedType.LPWStr)]  string   Name);
-        [PreserveSig] int GetServer_([In][Out] ref uint puNameBufLength, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)]  char[]   pName);
+        [PreserveSig] int SetServer_([In][MarshalAs(UnmanagedType.LPWStr)] string Name);
+        [PreserveSig] int GetServer_([In][Out] ref uint puNameBufLength, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)]  char[] pName);
         [PreserveSig] int GetNamespaceCount_([Out] out uint puCount);
-        [PreserveSig] int SetNamespaceAt_([In] uint uIndex, [In][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)]  char[]   pszName);
-        [PreserveSig] int GetNamespaceAt_([In] uint uIndex, [In][Out] ref uint puNameBufLength, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 1)]  char[]   pName);
+        [PreserveSig] int SetNamespaceAt_([In] uint uIndex, [In][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)]  char[] pszName);
+        [PreserveSig] int GetNamespaceAt_([In] uint uIndex, [In][Out] ref uint puNameBufLength, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 1)]  char[] pName);
         [PreserveSig] int RemoveNamespaceAt_([In] uint uIndex);
         [PreserveSig] int RemoveAllNamespaces_();
         [PreserveSig] int GetScopeCount_([Out] out uint puCount);
-        [PreserveSig] int SetScope_([In] uint uIndex, [In][MarshalAs(UnmanagedType.LPWStr)]  string   pszClass);
-        [PreserveSig] int SetScopeFromText_([In] uint uIndex, [In][MarshalAs(UnmanagedType.LPWStr)]  string   pszText);
-        [PreserveSig] int GetScope_([In] uint uIndex, [In][Out] ref uint puClassNameBufSize, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 1)]  char[]   pszClass, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemPathKeyList   pKeyList);
-        [PreserveSig] int GetScopeAsText_([In] uint uIndex, [In][Out] ref uint puTextBufSize, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 1)]  char[]   pszText);
+        [PreserveSig] int SetScope_([In] uint uIndex, [In][MarshalAs(UnmanagedType.LPWStr)] string pszClass);
+        [PreserveSig] int SetScopeFromText_([In] uint uIndex, [In][MarshalAs(UnmanagedType.LPWStr)] string pszText);
+        [PreserveSig] int GetScope_([In] uint uIndex, [In][Out] ref uint puClassNameBufSize, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 1)]  char[] pszClass, [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemPathKeyList pKeyList);
+        [PreserveSig] int GetScopeAsText_([In] uint uIndex, [In][Out] ref uint puTextBufSize, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 1)]  char[] pszText);
         [PreserveSig] int RemoveScope_([In] uint uIndex);
         [PreserveSig] int RemoveAllScopes_();
-        [PreserveSig] int SetClassName_([In][MarshalAs(UnmanagedType.LPWStr)]  string   Name);
-        [PreserveSig] int GetClassName_([In][Out] ref uint puBuffLength, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)]  char[]   pszName);
-        [PreserveSig] int GetKeyList_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemPathKeyList   pOut);
-        [PreserveSig] int CreateClassPart_([In] int lFlags, [In][MarshalAs(UnmanagedType.LPWStr)]  string   Name);
+        [PreserveSig] int SetClassName_([In][MarshalAs(UnmanagedType.LPWStr)] string Name);
+        [PreserveSig] int GetClassName_([In][Out] ref uint puBuffLength, [Out][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)]  char[] pszName);
+        [PreserveSig] int GetKeyList_([Out][MarshalAs(UnmanagedType.Interface)]  out IWbemPathKeyList pOut);
+        [PreserveSig] int CreateClassPart_([In] int lFlags, [In][MarshalAs(UnmanagedType.LPWStr)] string Name);
         [PreserveSig] int DeleteClassPart_([In] int lFlags);
-        [PreserveSig] int IsRelative_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszMachine, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszNamespace);
-        [PreserveSig] int IsRelativeOrChild_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszMachine, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszNamespace, [In] int lFlags);
-        [PreserveSig] int IsLocal_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszMachine);
-        [PreserveSig] int IsSameClassName_([In][MarshalAs(UnmanagedType.LPWStr)]  string   wszClass);
+        [PreserveSig] int IsRelative_([In][MarshalAs(UnmanagedType.LPWStr)] string wszMachine, [In][MarshalAs(UnmanagedType.LPWStr)] string wszNamespace);
+        [PreserveSig] int IsRelativeOrChild_([In][MarshalAs(UnmanagedType.LPWStr)] string wszMachine, [In][MarshalAs(UnmanagedType.LPWStr)] string wszNamespace, [In] int lFlags);
+        [PreserveSig] int IsLocal_([In][MarshalAs(UnmanagedType.LPWStr)] string wszMachine);
+        [PreserveSig] int IsSameClassName_([In][MarshalAs(UnmanagedType.LPWStr)] string wszClass);
     }
 
     #endregion
@@ -1487,7 +1487,7 @@ namespace System.Management
 
                 ndx = reqList.Add(myReq);
 
-                if ( evtGo.Set() == false )
+                if (evtGo.Set() == false)
                 {
                     reqList.RemoveAt(ndx);
                     throw new ManagementException(SR.WorkerThreadWakeupFailed);
@@ -1566,7 +1566,7 @@ namespace System.Management
         public static bool IsNoContextMTA()
         {
             // If the runtime says we are not an MTA thread, we'll trust it and return false
-            if (Thread.CurrentThread.GetApartmentState()  != ApartmentState.MTA)
+            if (Thread.CurrentThread.GetApartmentState() != ApartmentState.MTA)
                 return false;
 
             // We know that 'ApartmentState' says we are MTA
@@ -1619,7 +1619,7 @@ namespace System.Management
             // If we are on Win2k or above, we are OK
             // - Platform == Win32NT and OS version >= 5.0.0.0
             OperatingSystem os = Environment.OSVersion;
-            if (os.Platform==PlatformID.Win32NT && os.Version >= new Version(5, 0))
+            if (os.Platform == PlatformID.Win32NT && os.Version >= new Version(5, 0))
                 return true;
             return false;
         }
@@ -1648,16 +1648,16 @@ namespace System.Management
     internal class ThreadDispatch
     {
         #region Private fields
-        private     Thread                                  thread;
-        private     Exception                               exception;                                 // Exception thrown from worker method (if any). Exposed as property.
-        private     ThreadWorkerMethodWithReturn            threadWorkerMethodWithReturn;              // Delegate to be called for worker method with return value
-        private     ThreadWorkerMethodWithReturnAndParam    threadWorkerMethodWithReturnAndParam;      // Delegate to be called for worker method with return value and parameter
-        private     ThreadWorkerMethod                      threadWorkerMethod;                        // Delegate to be called for worker method
-        private     ThreadWorkerMethodWithParam             threadWorkerMethodWithParam;               // Delegate to be called for worker method with parameter
-        private     object                                  threadReturn;                              // Return data from worker method.
-        private     object                                  threadParams;                              // Parameters to be passed to worker method
-        private     bool                                    backgroundThread;                          // Is this a background thread?
-        private     ApartmentState                          apartmentType;                             // Apartment type of thread
+        private Thread thread;
+        private Exception exception;                                                        // Exception thrown from worker method (if any). Exposed as property.
+        private ThreadWorkerMethodWithReturn threadWorkerMethodWithReturn;                  // Delegate to be called for worker method with return value
+        private ThreadWorkerMethodWithReturnAndParam threadWorkerMethodWithReturnAndParam;  // Delegate to be called for worker method with return value and parameter
+        private ThreadWorkerMethod threadWorkerMethod;                                      // Delegate to be called for worker method
+        private ThreadWorkerMethodWithParam threadWorkerMethodWithParam;                    // Delegate to be called for worker method with parameter
+        private object threadReturn;                                                        // Return data from worker method.
+        private object threadParams;                                                        // Parameters to be passed to worker method
+        private bool backgroundThread;                                                      // Is this a background thread?
+        private ApartmentState apartmentType;                                               // Apartment type of thread
         #endregion
 
         #region Properties
@@ -1735,22 +1735,22 @@ namespace System.Management
         /// <summary>
         /// Delegate declaration representing signature of worker method with return value.
         /// </summary>
-        public delegate object  ThreadWorkerMethodWithReturn (  );
+        public delegate object ThreadWorkerMethodWithReturn();
 
         /// <summary>
         /// Delegate declaration representing signature of worker method with return value and parameter.
         /// </summary>
-        public delegate object  ThreadWorkerMethodWithReturnAndParam ( object param );
+        public delegate object ThreadWorkerMethodWithReturnAndParam(object param);
 
         /// <summary>
         /// Delegate declaration representing signature of worker method with no return value and no parameter
         /// </summary>
-        public delegate void    ThreadWorkerMethod (  );
+        public delegate void ThreadWorkerMethod();
 
         /// <summary>
         /// Delegate declaration representing signature of worker method with parameter.
         /// </summary>
-        public delegate void    ThreadWorkerMethodWithParam ( object param );
+        public delegate void ThreadWorkerMethodWithParam(object param);
         #endregion
 
         #region Public methods
@@ -1762,9 +1762,9 @@ namespace System.Management
         ///     3. Background thread status will be false
         /// </summary>
         /// <param name="workerMethod">Delegate to be called to perform the work</param>
-        public ThreadDispatch ( ThreadWorkerMethodWithReturn workerMethod ) : this ( )
+        public ThreadDispatch(ThreadWorkerMethodWithReturn workerMethod) : this()
         {
-            InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false );
+            InitializeThreadState(null, workerMethod, ApartmentState.MTA, false);
         }
 
         /// <summary>
@@ -1775,9 +1775,9 @@ namespace System.Management
         ///     3. Background thread status will be false
         /// </summary>
         /// <param name="workerMethod">Delegate to be called to perform the work</param>
-        public ThreadDispatch ( ThreadWorkerMethodWithReturnAndParam workerMethod ) : this ( )
+        public ThreadDispatch(ThreadWorkerMethodWithReturnAndParam workerMethod) : this()
         {
-            InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false );
+            InitializeThreadState(null, workerMethod, ApartmentState.MTA, false);
         }
 
         /// <summary>
@@ -1788,9 +1788,9 @@ namespace System.Management
         ///     3. Background thread status will be false
         /// </summary>
         /// <param name="workerMethod">Delegate to be called to perform the work</param>
-        public ThreadDispatch ( ThreadWorkerMethodWithParam workerMethod ) : this ( )
+        public ThreadDispatch(ThreadWorkerMethodWithParam workerMethod) : this()
         {
-            InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false );
+            InitializeThreadState(null, workerMethod, ApartmentState.MTA, false);
         }
 
         /// <summary>
@@ -1801,20 +1801,20 @@ namespace System.Management
         ///     3. Background thread status will be false
         /// </summary>
         /// <param name="workerMethod">Delegate to be called to perform the work</param>
-        public ThreadDispatch ( ThreadWorkerMethod workerMethod ) : this ( )
+        public ThreadDispatch(ThreadWorkerMethod workerMethod) : this()
         {
-            InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false );
+            InitializeThreadState(null, workerMethod, ApartmentState.MTA, false);
         }
 
         /// <summary>
         /// Starts the thread execution and waits for thread to finish. If an exception occurs in the worker method
         /// this method rethrows the exception.
         /// </summary>
-        public void Start ( )
+        public void Start()
         {
             this.exception = null;
             DispatchThread();
-            if ( this.Exception != null )
+            if (this.Exception != null)
             {
                 throw this.Exception;
             }
@@ -1826,18 +1826,18 @@ namespace System.Management
         /// Initializes the ThreadDispatch instance with initial values. Note that this constructor is private to avoid
         /// declaring instances without specifying at least a worker delegate instance.
         /// </summary>
-        private ThreadDispatch ( )
+        private ThreadDispatch()
         {
-            this.thread                               = null;
-            this.exception                            = null;
-            this.threadParams                         = null;
-            this.threadWorkerMethodWithReturn         = null;
+            this.thread = null;
+            this.exception = null;
+            this.threadParams = null;
+            this.threadWorkerMethodWithReturn = null;
             this.threadWorkerMethodWithReturnAndParam = null;
-            this.threadWorkerMethod                   = null;
-            this.threadWorkerMethodWithParam          = null;
-            this.threadReturn                         = null;
-            this.backgroundThread                     = false;
-            this.apartmentType                        = ApartmentState.MTA;
+            this.threadWorkerMethod = null;
+            this.threadWorkerMethodWithParam = null;
+            this.threadReturn = null;
+            this.backgroundThread = false;
+            this.apartmentType = ApartmentState.MTA;
         }
 
         /// <summary>
@@ -1847,11 +1847,11 @@ namespace System.Management
         /// <param name="workerMethod">The delegate to be called from thread</param>
         /// <param name="aptState">The apartment of the thread created</param>
         /// <param name="background">Thread is created as a background or not</param>
-        private void InitializeThreadState ( object threadParams, ThreadWorkerMethodWithReturn workerMethod, ApartmentState aptState, bool background )
+        private void InitializeThreadState(object threadParams, ThreadWorkerMethodWithReturn workerMethod, ApartmentState aptState, bool background)
         {
             this.threadParams = threadParams;
-            this.threadWorkerMethodWithReturn  = workerMethod;
-            this.thread = new Thread ( new ThreadStart ( ThreadEntryPointMethodWithReturn ) );
+            this.threadWorkerMethodWithReturn = workerMethod;
+            this.thread = new Thread(new ThreadStart(ThreadEntryPointMethodWithReturn));
             this.thread.SetApartmentState(aptState);
             this.backgroundThread = background;
         }
@@ -1863,11 +1863,11 @@ namespace System.Management
         /// <param name="workerMethod">The delegate to be called from thread</param>
         /// <param name="aptState">The apartment of the thread created</param>
         /// <param name="background">Thread is created as a background or not</param>
-        private void InitializeThreadState ( object threadParams, ThreadWorkerMethodWithReturnAndParam workerMethod, ApartmentState aptState, bool background )
+        private void InitializeThreadState(object threadParams, ThreadWorkerMethodWithReturnAndParam workerMethod, ApartmentState aptState, bool background)
         {
             this.threadParams = threadParams;
             this.threadWorkerMethodWithReturnAndParam = workerMethod;
-            this.thread = new Thread ( new ThreadStart ( ThreadEntryPointMethodWithReturnAndParam ) );
+            this.thread = new Thread(new ThreadStart(ThreadEntryPointMethodWithReturnAndParam));
             this.thread.SetApartmentState(aptState);
             this.backgroundThread = background;
         }
@@ -1879,12 +1879,12 @@ namespace System.Management
         /// <param name="workerMethod">The delegate to be called from thread</param>
         /// <param name="aptState">The apartment of the thread created</param>
         /// <param name="background">Thread is created as a background or not</param>
-        private void InitializeThreadState ( object threadParams, ThreadWorkerMethod workerMethod, ApartmentState aptState, bool background )
+        private void InitializeThreadState(object threadParams, ThreadWorkerMethod workerMethod, ApartmentState aptState, bool background)
         {
             this.threadParams = threadParams;
-            this.threadWorkerMethod  = workerMethod;
-            this.thread = new Thread ( new ThreadStart ( ThreadEntryPoint ) );
-            this.thread.SetApartmentState(aptState );
+            this.threadWorkerMethod = workerMethod;
+            this.thread = new Thread(new ThreadStart(ThreadEntryPoint));
+            this.thread.SetApartmentState(aptState);
             this.backgroundThread = background;
         }
 
@@ -1895,12 +1895,12 @@ namespace System.Management
         /// <param name="workerMethod">The delegate to be called from thread</param>
         /// <param name="aptState">The apartment of the thread created</param>
         /// <param name="background">Thread is created as a background or not</param>
-        private void InitializeThreadState ( object threadParams, ThreadWorkerMethodWithParam workerMethod, ApartmentState aptState, bool background )
+        private void InitializeThreadState(object threadParams, ThreadWorkerMethodWithParam workerMethod, ApartmentState aptState, bool background)
         {
             this.threadParams = threadParams;
             this.threadWorkerMethodWithParam = workerMethod;
-            this.thread = new Thread ( new ThreadStart ( ThreadEntryPointMethodWithParam ) );
-            this.thread.SetApartmentState( aptState );
+            this.thread = new Thread(new ThreadStart(ThreadEntryPointMethodWithParam));
+            this.thread.SetApartmentState(aptState);
             this.backgroundThread = background;
         }
 
@@ -1908,7 +1908,7 @@ namespace System.Management
         /// <summary>
         /// Starts the execution of the thread and waits until the threadFinished event is signaled before continuing
         /// </summary>
-        private void DispatchThread ( )
+        private void DispatchThread()
         {
             this.thread.Start();
             this.thread.Join();
@@ -1919,7 +1919,7 @@ namespace System.Management
         /// exceptions thrown from the worker method and re-throws the exception.
         /// The worker method for this thread entry point has no parameter and no return value.
         /// </summary>
-        private void ThreadEntryPoint ( )
+        private void ThreadEntryPoint()
         {
             try
             {
@@ -1937,11 +1937,11 @@ namespace System.Management
         /// The worker method for this thread entry point takes a parameter and no return value.
         /// </summary>
 
-        private void ThreadEntryPointMethodWithParam ( )
+        private void ThreadEntryPointMethodWithParam()
         {
             try
             {
-                this.threadWorkerMethodWithParam ( this.threadParams );
+                this.threadWorkerMethodWithParam(this.threadParams);
             }
             catch (Exception e)
             {
@@ -1955,7 +1955,7 @@ namespace System.Management
         /// The worker method for this thread entry point has no parameter but does return a value.
         /// </summary>
 
-        private void ThreadEntryPointMethodWithReturn ( )
+        private void ThreadEntryPointMethodWithReturn()
         {
             try
             {
@@ -1973,7 +1973,7 @@ namespace System.Management
         /// The worker method for this thread entry point has a parameter and return value.
         /// </summary>
 
-        private void ThreadEntryPointMethodWithReturnAndParam ( )
+        private void ThreadEntryPointMethodWithReturnAndParam()
         {
             try
             {
index 24b1530..ca5bd06 100644 (file)
@@ -323,7 +323,7 @@ namespace System.Management
             return new ManagementBaseObject(theClone);
         }
 
-        internal virtual void Initialize ( bool getObject ) {}
+        internal virtual void Initialize(bool getObject) { }
 
         //
         //Properties
@@ -342,7 +342,7 @@ namespace System.Management
         {
             get
             {
-                Initialize ( true );
+                Initialize(true);
 
                 if (properties == null)
                     properties = new PropertyDataCollection(this, false);
@@ -364,7 +364,7 @@ namespace System.Management
         {
             get
             {
-                Initialize ( false );
+                Initialize(false);
 
                 if (systemProperties == null)
                     systemProperties = new PropertyDataCollection(this, true);
@@ -387,7 +387,7 @@ namespace System.Management
         {
             get
             {
-                Initialize ( true );
+                Initialize(true);
 
                 if (qualifiers == null)
                     qualifiers = new QualifierDataCollection(this);
@@ -479,10 +479,10 @@ namespace System.Management
             get { return GetPropertyValue(propertyName); }
             set
             {
-                Initialize ( true );
+                Initialize(true);
                 try
                 {
-                    SetPropertyValue (propertyName, value);
+                    SetPropertyValue(propertyName, value);
                 }
                 catch (COMException e)
                 {
@@ -504,10 +504,10 @@ namespace System.Management
         public object GetPropertyValue(string propertyName)
         {
             if (null == propertyName)
-                throw new ArgumentNullException (nameof(propertyName));
+                throw new ArgumentNullException(nameof(propertyName));
 
             // Check for system properties
-            if (propertyName.StartsWith ("__", StringComparison.Ordinal))
+            if (propertyName.StartsWith("__", StringComparison.Ordinal))
                 return SystemProperties[propertyName].Value;
             else
                 return Properties[propertyName].Value;
@@ -525,7 +525,7 @@ namespace System.Management
         /// </returns>
         public object GetQualifierValue(string qualifierName)
         {
-            return Qualifiers [qualifierName].Value;
+            return Qualifiers[qualifierName].Value;
         }
 
         //******************************************************
@@ -538,7 +538,7 @@ namespace System.Management
         /// <param name='qualifierValue'>The value to set.</param>
         public void SetQualifierValue(string qualifierName, object qualifierValue)
         {
-            Qualifiers [qualifierName].Value = qualifierValue;
+            Qualifiers[qualifierName].Value = qualifierValue;
         }
 
 
@@ -595,7 +595,7 @@ namespace System.Management
             //
             switch (format)
             {
-                case TextFormat.Mof :
+                case TextFormat.Mof:
 
                     status = wbemObject.GetObjectText_(0, out objText);
 
@@ -609,8 +609,8 @@ namespace System.Management
 
                     return objText;
 
-                case TextFormat.CimDtd20 :
-                case TextFormat.WmiDtd20 :
+                case TextFormat.CimDtd20:
+                case TextFormat.WmiDtd20:
 
                     //This may throw on non-XP platforms... - should we catch ?
                     IWbemObjectTextSrc wbemTextSrc = (IWbemObjectTextSrc)new WbemObjectTextSrc();
@@ -660,7 +660,7 @@ namespace System.Management
             {
                 if (obj is ManagementBaseObject)
                 {
-                    result = CompareTo ((ManagementBaseObject)obj, ComparisonSettings.IncludeAll);
+                    result = CompareTo((ManagementBaseObject)obj, ComparisonSettings.IncludeAll);
                 }
                 else
                 {
@@ -741,15 +741,15 @@ namespace System.Management
         public bool CompareTo(ManagementBaseObject otherObject, ComparisonSettings settings)
         {
             if (null == otherObject)
-                throw new ArgumentNullException (nameof(otherObject));
+                throw new ArgumentNullException(nameof(otherObject));
 
             bool result = false;
 
             if (null != wbemObject)
             {
-                int status = (int) ManagementStatus.NoError;
+                int status = (int)ManagementStatus.NoError;
 
-                status = wbemObject.CompareTo_((int) settings, otherObject.wbemObject);
+                status = wbemObject.CompareTo_((int)settings, otherObject.wbemObject);
 
                 if ((int)ManagementStatus.Different == status)
                     result = false;
@@ -772,7 +772,7 @@ namespace System.Management
                 int dummy1 = 0, dummy2 = 0;
                 int status = (int)ManagementStatus.NoError;
 
-                status = wbemObject.Get_ ("__CLASS", 0, ref val, ref dummy1, ref dummy2);
+                status = wbemObject.Get_("__CLASS", 0, ref val, ref dummy1, ref dummy2);
 
                 if (status < 0)
                 {
@@ -785,7 +785,7 @@ namespace System.Management
                 if (val is System.DBNull)
                     return string.Empty;
                 else
-                    return ((string) val);
+                    return ((string)val);
             }
         }
 
@@ -820,15 +820,15 @@ namespace System.Management
         /// </summary>
         /// <param name='propertyName'>The name of the property to be changed.</param>
         /// <param name='propertyValue'>The new value for this property.</param>
-        public void SetPropertyValue (
+        public void SetPropertyValue(
             string propertyName,
             object propertyValue)
         {
             if (null == propertyName)
-                throw new ArgumentNullException (nameof(propertyName));
+                throw new ArgumentNullException(nameof(propertyName));
 
             // Check for system properties
-            if (propertyName.StartsWith ("__", StringComparison.Ordinal))
+            if (propertyName.StartsWith("__", StringComparison.Ordinal))
                 SystemProperties[propertyName].Value = propertyValue;
             else
                 Properties[propertyName].Value = propertyValue;
index 5380fad..523121b 100644 (file)
@@ -141,7 +141,7 @@ namespace System.Management
         ///    <code lang='VB'>Dim c As New ManagementClass()
         ///    </code>
         /// </example>
-        public ManagementClass() : this ((ManagementScope)null, (ManagementPath)null, null) {}
+        public ManagementClass() : this((ManagementScope)null, (ManagementPath)null, null) { }
 
         //parameterized constructors
         /// <summary>
@@ -161,7 +161,7 @@ namespace System.Management
         ///     New ManagementPath("Win32_LogicalDisk"))
         ///    </code>
         /// </example>
-        public ManagementClass(ManagementPath path) : this(null, path, null) {}
+        public ManagementClass(ManagementPath path) : this(null, path, null) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementClass'/> class initialized to the given path.</para>
@@ -174,7 +174,7 @@ namespace System.Management
         ///    <code lang='VB'>Dim c As New ManagementClass("Win32_LogicalDisk")
         ///    </code>
         /// </example>
-        public ManagementClass(string path) : this(null, new ManagementPath(path), null) {}
+        public ManagementClass(string path) : this(null, new ManagementPath(path), null) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementClass'/> class initialized to the
@@ -194,7 +194,7 @@ namespace System.Management
         /// Dim c As New ManagementClass(p,o)
         ///    </code>
         /// </example>
-        public ManagementClass(ManagementPath path, ObjectGetOptions options) : this(null, path, options) {}
+        public ManagementClass(ManagementPath path, ObjectGetOptions options) : this(null, path, options) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementClass'/> class initialized to the given WMI class path
@@ -213,7 +213,7 @@ namespace System.Management
         ///    </code>
         /// </example>
         public ManagementClass(string path, ObjectGetOptions options)
-            : this(null, new ManagementPath(path), options) {}
+            : this(null, new ManagementPath(path), options) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementClass'/> class for the specified
@@ -240,7 +240,7 @@ namespace System.Management
         ///    </code>
         /// </example>
         public ManagementClass(ManagementScope scope, ManagementPath path, ObjectGetOptions options)
-            : base (scope, path, options) {}
+            : base(scope, path, options) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementClass'/> class for the specified WMI class, in the
@@ -265,7 +265,7 @@ namespace System.Management
         ///    </code>
         /// </example>
         public ManagementClass(string scope, string path, ObjectGetOptions options)
-            : base (new ManagementScope(scope), new ManagementPath(path), options) {}
+            : base(new ManagementScope(scope), new ManagementPath(path), options) { }
 
         protected ManagementClass(SerializationInfo info, StreamingContext context) : base(info, context)
         {
@@ -353,7 +353,7 @@ namespace System.Management
                 }
 
                 if (null != val)
-                    result.AddRange((string [])val);
+                    result.AddRange((string[])val);
 
                 return result;
             }
@@ -382,7 +382,7 @@ namespace System.Management
         {
             get
             {
-                Initialize ( true );
+                Initialize(true);
 
                 if (methods == null)
                     methods = new MethodDataCollection(this);
@@ -458,7 +458,7 @@ namespace System.Management
             if ((null == Path) || (null == Path.Path) || (0 == Path.Path.Length))
                 throw new InvalidOperationException();
 
-            Initialize ( false );
+            Initialize(false);
             IEnumWbemClassObject enumWbem = null;
 
             EnumerationOptions o = (null == options) ? new EnumerationOptions() : (EnumerationOptions)options.Clone();
@@ -467,16 +467,13 @@ namespace System.Management
             o.EnsureLocatable = false; o.PrototypeOnly = false;
 
             SecurityHandler securityHandler = null;
-            int status                      = (int)ManagementStatus.NoError;
+            int status = (int)ManagementStatus.NoError;
 
             try
             {
                 securityHandler = Scope.GetSecurityHandler();
-                            status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices() ).CreateInstanceEnum_(ClassName,
-                                                            o.Flags,
-                                                            o.GetContext(),
-                                                            ref enumWbem
-                                                             );
+                status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).CreateInstanceEnum_(
+                    ClassName, o.Flags, o.GetContext(), ref enumWbem);
             }
             finally
             {
@@ -585,7 +582,7 @@ namespace System.Management
             if ((null == Path) || (null == Path.Path) || (0 == Path.Path.Length))
                 throw new InvalidOperationException();
 
-            Initialize ( false );
+            Initialize(false);
 
             EnumerationOptions o = (null == options) ? new EnumerationOptions() : (EnumerationOptions)options.Clone();
 
@@ -603,19 +600,16 @@ namespace System.Management
             WmiEventSink sink = watcher.GetNewSink(Scope, o.Context);
 
             SecurityHandler securityHandler = null;
-            int status                      = (int)ManagementStatus.NoError;
+            int status = (int)ManagementStatus.NoError;
 
             securityHandler = Scope.GetSecurityHandler();
 
-                    status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices() ).CreateInstanceEnumAsync_(
-                ClassName,
-                o.Flags,
-                o.GetContext(),
-                sink.Stub );
+            status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).CreateInstanceEnumAsync_(
+                ClassName, o.Flags, o.GetContext(), sink.Stub);
 
 
             if (securityHandler != null)
-                    securityHandler.Reset();
+                securityHandler.Reset();
 
             if (status < 0)
             {
@@ -682,7 +676,7 @@ namespace System.Management
             if (null == Path)
                 throw new InvalidOperationException();
 
-            Initialize ( false );
+            Initialize(false);
             IEnumWbemClassObject enumWbem = null;
 
             EnumerationOptions o = (null == options) ? new EnumerationOptions() : (EnumerationOptions)options.Clone();
@@ -691,15 +685,13 @@ namespace System.Management
             o.EnsureLocatable = false; o.PrototypeOnly = false;
 
             SecurityHandler securityHandler = null;
-            int status                      = (int)ManagementStatus.NoError;
+            int status = (int)ManagementStatus.NoError;
 
             try
             {
                 securityHandler = Scope.GetSecurityHandler();
-                            status = scope.GetSecuredIWbemServicesHandler( Scope.GetIWbemServices() ).CreateClassEnum_(ClassName,
-                    o.Flags,
-                    o.GetContext(),
-                    ref enumWbem);
+                status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).CreateClassEnum_(
+                    ClassName, o.Flags, o.GetContext(), ref enumWbem);
             }
             finally
             {
@@ -743,7 +735,7 @@ namespace System.Management
             if (null == Path)
                 throw new InvalidOperationException();
 
-            Initialize ( false );
+            Initialize(false);
 
             EnumerationOptions o = (null == options) ? new EnumerationOptions() :
                                       (EnumerationOptions)options.Clone();
@@ -762,14 +754,12 @@ namespace System.Management
             WmiEventSink sink = watcher.GetNewSink(Scope, o.Context);
 
             SecurityHandler securityHandler = null;
-            int status                      = (int)ManagementStatus.NoError;
+            int status = (int)ManagementStatus.NoError;
 
             securityHandler = Scope.GetSecurityHandler();
 
-                    status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices() ).CreateClassEnumAsync_(ClassName,
-                o.Flags,
-                o.GetContext(),
-                sink.Stub);
+            status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).CreateClassEnumAsync_(
+                ClassName, o.Flags, o.GetContext(), sink.Stub);
 
 
             if (securityHandler != null)
@@ -1032,7 +1022,7 @@ namespace System.Management
             if ((null == Path) || (null == Path.Path) || (0 == Path.Path.Length))
                 throw new InvalidOperationException();
 
-            Initialize ( false );
+            Initialize(false);
 
             IEnumWbemClassObject enumWbem = null;
 
@@ -1040,7 +1030,7 @@ namespace System.Management
             //Ensure EnumerateDeep flag bit is turned off as it's invalid for queries
             o.EnumerateDeep = true;
 
-            RelatedObjectQuery q = new RelatedObjectQuery(true,    Path.Path,
+            RelatedObjectQuery q = new RelatedObjectQuery(true, Path.Path,
                                                             relatedClass,
                                                             relationshipClass,
                                                             relatedQualifier,
@@ -1048,12 +1038,12 @@ namespace System.Management
                                                             relatedRole, thisRole);
 
             SecurityHandler securityHandler = null;
-            int status                      = (int)ManagementStatus.NoError;
+            int status = (int)ManagementStatus.NoError;
 
             try
             {
                 securityHandler = Scope.GetSecurityHandler();
-                status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices() ).ExecQuery_(
+                status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).ExecQuery_(
                     q.QueryLanguage,
                     q.QueryString,
                     o.Flags,
@@ -1130,7 +1120,7 @@ namespace System.Management
             if ((null == Path) || (null == Path.Path) || (0 == Path.Path.Length))
                 throw new InvalidOperationException();
 
-            Initialize ( true );
+            Initialize(true);
 
             if (null == watcher)
                 throw new ArgumentNullException(nameof(watcher));
@@ -1159,16 +1149,12 @@ namespace System.Management
                                                                 relatedRole, thisRole);
 
                 SecurityHandler securityHandler = null;
-                int status                      = (int)ManagementStatus.NoError;
+                int status = (int)ManagementStatus.NoError;
 
                 securityHandler = Scope.GetSecurityHandler();
 
-                            status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices() ).ExecQueryAsync_(
-                        q.QueryLanguage,
-                        q.QueryString,
-                        o.Flags,
-                        o.GetContext(),
-                        sink.Stub);
+                status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).ExecQueryAsync_(
+                    q.QueryLanguage, q.QueryString, o.Flags, o.GetContext(), sink.Stub);
 
 
                 if (securityHandler != null)
@@ -1241,7 +1227,7 @@ namespace System.Management
             if ((null == Path) || (null == Path.Path) || (0 == Path.Path.Length))
                 throw new InvalidOperationException();
 
-            Initialize ( false );
+            Initialize(false);
 
             IEnumWbemClassObject enumWbem = null;
 
@@ -1254,18 +1240,14 @@ namespace System.Management
                                                         relationshipQualifier, thisRole);
 
             SecurityHandler securityHandler = null;
-            int status                      = (int)ManagementStatus.NoError;
+            int status = (int)ManagementStatus.NoError;
 
             //Execute WMI query
             try
             {
                 securityHandler = Scope.GetSecurityHandler();
-                            status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices() ).ExecQuery_(
-                    q.QueryLanguage,
-                    q.QueryString,
-                    o.Flags,
-                    o.GetContext(),
-                    ref enumWbem);
+                status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).ExecQuery_(
+                    q.QueryLanguage, q.QueryString, o.Flags, o.GetContext(), ref enumWbem);
 
             }
             finally
@@ -1334,7 +1316,7 @@ namespace System.Management
                 throw new ArgumentNullException(nameof(watcher));
             else
             {
-                Initialize ( true );
+                Initialize(true);
 
                 EnumerationOptions o =
                         (null != options) ? (EnumerationOptions)options.Clone() : new EnumerationOptions();
@@ -1355,16 +1337,12 @@ namespace System.Management
                         relationshipQualifier, thisRole);
 
                 SecurityHandler securityHandler = null;
-                int status                      = (int)ManagementStatus.NoError;
+                int status = (int)ManagementStatus.NoError;
 
                 securityHandler = Scope.GetSecurityHandler();
 
-                            status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).ExecQueryAsync_(
-                        q.QueryLanguage,
-                        q.QueryString,
-                        o.Flags,
-                        o.GetContext(),
-                        sink.Stub);
+                status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).ExecQueryAsync_(
+                    q.QueryLanguage, q.QueryString, o.Flags, o.GetContext(), sink.Stub);
 
 
                 if (securityHandler != null)
index c857012..0480248 100644 (file)
@@ -175,7 +175,7 @@ namespace System.Management
                 tempString = dmtf.Substring(15, 6);
                 if (("******" != tempString))
                 {
-                    ticks = (long.Parse(tempString, (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long)))) * (TimeSpan.TicksPerMillisecond/1000);
+                    ticks = (long.Parse(tempString, (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long)))) * (TimeSpan.TicksPerMillisecond / 1000);
                 }
                 tempString = dmtf.Substring(22, 3);
                 if (("***" != tempString))
@@ -184,7 +184,7 @@ namespace System.Management
                     utcOffset = int.Parse(tempString, frmInt32);
                 }
 
-                if ( year < 0 || month < 0 || day < 0 || hour < 0 || minute < 0 || second < 0 || ticks < 0)
+                if (year < 0 || month < 0 || day < 0 || hour < 0 || minute < 0 || second < 0 || ticks < 0)
                 {
                     throw new ArgumentOutOfRangeException(nameof(dmtfDate));
                 }
@@ -256,7 +256,7 @@ namespace System.Management
             else
             {
                 string strTemp = OffsetMins.ToString(frmInt32);
-                UtcString = "-" + strTemp.Substring(1, strTemp.Length-1).PadLeft(3, '0');
+                UtcString = "-" + strTemp.Substring(1, strTemp.Length - 1).PadLeft(3, '0');
             }
 
             string dmtfDateTime = date.Year.ToString(frmInt32).PadLeft(4, '0');
@@ -271,7 +271,7 @@ namespace System.Management
             // Construct a DateTime with the precision to Second as same as the passed DateTime and so get
             // the ticks difference so that the microseconds can be calculated
             DateTime dtTemp = new DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0);
-            long microsec = ((date.Ticks-dtTemp.Ticks) * 1000) / System.TimeSpan.TicksPerMillisecond;
+            long microsec = ((date.Ticks - dtTemp.Ticks) * 1000) / System.TimeSpan.TicksPerMillisecond;
 
             // fill the microseconds field
             string strMicrosec = microsec.ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long)));
@@ -354,7 +354,7 @@ namespace System.Management
                 seconds = int.Parse(tempString, frmInt32);
 
                 tempString = dmtfts.Substring(15, 6);
-                ticks = (long.Parse(tempString, (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long)))) * (System.TimeSpan.TicksPerMillisecond/1000);
+                ticks = (long.Parse(tempString, (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long)))) * (System.TimeSpan.TicksPerMillisecond / 1000);
 
             }
             catch
@@ -362,7 +362,7 @@ namespace System.Management
                 throw new System.ArgumentOutOfRangeException(nameof(dmtfTimespan));
             }
 
-            if ( days < 0 || hours < 0 || minutes < 0 || seconds < 0 || ticks < 0 )
+            if (days < 0 || hours < 0 || minutes < 0 || seconds < 0 || ticks < 0)
             {
                 throw new System.ArgumentOutOfRangeException(nameof(dmtfTimespan));
             }
@@ -426,7 +426,7 @@ namespace System.Management
             // Construct a DateTime with the precision to Second as same as the passed DateTime and so get
             // the ticks difference so that the microseconds can be calculated
             TimeSpan tsTemp = new TimeSpan(timespan.Days, timespan.Hours, timespan.Minutes, timespan.Seconds, 0);
-            long microsec = ((timespan.Ticks-tsTemp.Ticks) * 1000) / System.TimeSpan.TicksPerMillisecond;
+            long microsec = ((timespan.Ticks - tsTemp.Ticks) * 1000) / System.TimeSpan.TicksPerMillisecond;
 
             // fill the microseconds field
             string strMicrosec = microsec.ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long)));
index f8cd3d8..6745dc4 100644 (file)
 namespace System.Management
 {
 
-internal class IdentifierChangedEventArgs : EventArgs
-{
-    internal IdentifierChangedEventArgs () {}
-}
-
-internal class InternalObjectPutEventArgs : EventArgs
-{
-    private readonly ManagementPath path;
-
-    internal InternalObjectPutEventArgs (ManagementPath path)
+    internal class IdentifierChangedEventArgs : EventArgs
     {
-        this.path = path.Clone();
+        internal IdentifierChangedEventArgs() { }
     }
 
-    internal ManagementPath Path {
-        get { return path; }
-    }
-}
-
-
-    /// <summary>
-    ///    <para>Represents the virtual base class to hold event data for WMI events.</para>
-    /// </summary>
-public abstract class ManagementEventArgs : EventArgs
-{
-    private readonly object context;
+    internal class InternalObjectPutEventArgs : EventArgs
+    {
+        private readonly ManagementPath path;
 
-    /// <summary>
-    /// Constructor. This is not callable directly by applications.
-    /// </summary>
-    /// <param name="context">The operation context which is echoed back
-    /// from the operation which trigerred the event.</param>
-    internal ManagementEventArgs (object context) {
-        this.context = context;
-    }
+        internal InternalObjectPutEventArgs(ManagementPath path)
+        {
+            this.path = path.Clone();
+        }
 
-    /// <summary>
-    ///    <para> Gets the operation context echoed back
-    ///       from the operation that triggered the event.</para>
-    /// </summary>
-    /// <value>
-    ///    A WMI context object containing
-    ///    context information provided by the operation that triggered the event.
-    /// </value>
-    public object Context { get { return context; }
+        internal ManagementPath Path
+        {
+            get { return path; }
+        }
     }
-}
 
-/// <summary>
-/// <para>Holds event data for the <see cref='System.Management.ManagementOperationObserver.ObjectReady'/> event.</para>
-/// </summary>
-public class ObjectReadyEventArgs : ManagementEventArgs
-{
-    private readonly ManagementBaseObject wmiObject;
 
     /// <summary>
-    /// Constructor.
+    ///    <para>Represents the virtual base class to hold event data for WMI events.</para>
     /// </summary>
-    /// <param name="context">The operation context which is echoed back
-    /// from the operation which triggerred the event.</param>
-    /// <param name="wmiObject">The newly arrived WmiObject.</param>
-    internal ObjectReadyEventArgs (
-                    object context,
-                    ManagementBaseObject wmiObject
-                    ) : base (context)
+    public abstract class ManagementEventArgs : EventArgs
     {
-        this.wmiObject = wmiObject;
-    }
+        private readonly object context;
 
-    /// <summary>
-    ///    <para> Gets the newly-returned object.</para>
-    /// </summary>
-    /// <value>
-    /// <para>A <see cref='System.Management.ManagementBaseObject'/> representing the
-    ///    newly-returned object.</para>
-    /// </value>
-    public ManagementBaseObject NewObject
-    {
-        get {
-            return wmiObject;
+        /// <summary>
+        /// Constructor. This is not callable directly by applications.
+        /// </summary>
+        /// <param name="context">The operation context which is echoed back
+        /// from the operation which trigerred the event.</param>
+        internal ManagementEventArgs(object context)
+        {
+            this.context = context;
         }
-    }
-}
 
-/// <summary>
-/// <para> Holds event data for the <see cref='System.Management.ManagementOperationObserver.Completed'/> event.</para>
-/// </summary>
-public class CompletedEventArgs : ManagementEventArgs
-{
-    private readonly int status;
-    private readonly ManagementBaseObject wmiObject;
-
-    /// <summary>
-    /// Constructor.
-    /// </summary>
-    /// <param name="context">The operation context which is echoed back
-    /// from the operation which trigerred the event.</param>
-    /// <param name="status">The completion status of the operation.</param>
-    /// <param name="wmiStatusObject">Additional status information
-    /// encapsulated within a WmiObject. This may be null.</param>
-    internal CompletedEventArgs (
-                    object context,
-                    int status,
-                    ManagementBaseObject wmiStatusObject
-                    ) : base (context)
-    {
-        wmiObject = wmiStatusObject;
-        this.status = status;
+        /// <summary>
+        ///    <para> Gets the operation context echoed back
+        ///       from the operation that triggered the event.</para>
+        /// </summary>
+        /// <value>
+        ///    A WMI context object containing
+        ///    context information provided by the operation that triggered the event.
+        /// </value>
+        public object Context
+        {
+            get { return context; }
+        }
     }
 
     /// <summary>
-    ///    <para>Gets or sets additional status information
-    ///       within a WMI object. This may be null.</para>
+    /// <para>Holds event data for the <see cref='System.Management.ManagementOperationObserver.ObjectReady'/> event.</para>
     /// </summary>
-    /// <value>
-    /// <para><see langword='null '/> if an error did not occur. Otherwise, may be non-null if the provider
-    ///    supports extended error information.</para>
-    /// </value>
-    public ManagementBaseObject StatusObject
+    public class ObjectReadyEventArgs : ManagementEventArgs
     {
-        get {
-            return wmiObject;
+        private readonly ManagementBaseObject wmiObject;
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        /// <param name="context">The operation context which is echoed back
+        /// from the operation which triggerred the event.</param>
+        /// <param name="wmiObject">The newly arrived WmiObject.</param>
+        internal ObjectReadyEventArgs(object context, ManagementBaseObject wmiObject) : base(context)
+        {
+            this.wmiObject = wmiObject;
         }
-    }
 
-    /// <summary>
-    ///    <para>Gets the completion status of the operation.</para>
-    /// </summary>
-    /// <value>
-    /// <para>A <see cref='System.Management.ManagementStatus'/> value
-    ///    indicating the return code of the operation.</para>
-    /// </value>
-    public ManagementStatus Status
-    {
-        get {
-            return (ManagementStatus) status;
+        /// <summary>
+        ///    <para> Gets the newly-returned object.</para>
+        /// </summary>
+        /// <value>
+        /// <para>A <see cref='System.Management.ManagementBaseObject'/> representing the
+        ///    newly-returned object.</para>
+        /// </value>
+        public ManagementBaseObject NewObject
+        {
+            get
+            {
+                return wmiObject;
+            }
         }
     }
-}
-
-/// <summary>
-/// <para>Holds event data for the <see cref='System.Management.ManagementOperationObserver.ObjectPut'/> event.</para>
-/// </summary>
-public class ObjectPutEventArgs : ManagementEventArgs
-{
-    private readonly ManagementPath wmiPath;
 
     /// <summary>
-    /// Constructor
+    /// <para> Holds event data for the <see cref='System.Management.ManagementOperationObserver.Completed'/> event.</para>
     /// </summary>
-    /// <param name="context">The operation context which is echoed back
-    /// from the operation which trigerred the event.</param>
-    /// <param name="path">The WmiPath representing the identity of the
-    /// object that has been put.</param>
-    internal ObjectPutEventArgs (
-                    object context,
-                    ManagementPath path
-                    ) : base (context)
+    public class CompletedEventArgs : ManagementEventArgs
     {
-        wmiPath = path;
-    }
+        private readonly int status;
+        private readonly ManagementBaseObject wmiObject;
 
-    /// <summary>
-    ///    <para> Gets the identity of the
-    ///       object that has been put.</para>
-    /// </summary>
-    /// <value>
-    /// <para>A <see cref='System.Management.ManagementPath'/> containing the path of the object that has
-    ///    been put.</para>
-    /// </value>
-    public ManagementPath Path
-    {
-        get {
-            return wmiPath;
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        /// <param name="context">The operation context which is echoed back
+        /// from the operation which trigerred the event.</param>
+        /// <param name="status">The completion status of the operation.</param>
+        /// <param name="wmiStatusObject">Additional status information
+        /// encapsulated within a WmiObject. This may be null.</param>
+        internal CompletedEventArgs(object context, int status, ManagementBaseObject wmiStatusObject) : base(context)
+        {
+            wmiObject = wmiStatusObject;
+            this.status = status;
         }
-    }
-}
 
-/// <summary>
-/// <para>Holds event data for the <see cref='System.Management.ManagementOperationObserver.Progress'/> event.</para>
-/// </summary>
-public class ProgressEventArgs : ManagementEventArgs
-{
-    private readonly int    upperBound;
-    private readonly int    current;
-    private readonly string message;
+        /// <summary>
+        ///    <para>Gets or sets additional status information
+        ///       within a WMI object. This may be null.</para>
+        /// </summary>
+        /// <value>
+        /// <para><see langword='null '/> if an error did not occur. Otherwise, may be non-null if the provider
+        ///    supports extended error information.</para>
+        /// </value>
+        public ManagementBaseObject StatusObject
+        {
+            get
+            {
+                return wmiObject;
+            }
+        }
 
-    /// <summary>
-    /// Constructor
-    /// </summary>
-    /// <param name="context">The operation context which is echoed back
-    /// from the operation which trigerred the event.</param>
-    /// <param name="upperBound">A quantity representing the total
-    /// amount of work required to be done by the operation.</param>
-    /// <param name="current">A quantity representing the current
-    /// amount of work required to be done by the operation. This is
-    /// always less than or equal to upperBound.</param>
-    /// <param name="message">Optional additional information regarding
-    /// operation progress.</param>
-    internal ProgressEventArgs (
-                    object context,
-                    int upperBound,
-                    int current,
-                    string message
-                    ) : base (context)
-    {
-        this.upperBound = upperBound;
-        this.current = current;
-        this.message = message;
+        /// <summary>
+        ///    <para>Gets the completion status of the operation.</para>
+        /// </summary>
+        /// <value>
+        /// <para>A <see cref='System.Management.ManagementStatus'/> value
+        ///    indicating the return code of the operation.</para>
+        /// </value>
+        public ManagementStatus Status
+        {
+            get
+            {
+                return (ManagementStatus)status;
+            }
+        }
     }
 
     /// <summary>
-    ///    <para> Gets the total
-    ///       amount of work required to be done by the operation.</para>
+    /// <para>Holds event data for the <see cref='System.Management.ManagementOperationObserver.ObjectPut'/> event.</para>
     /// </summary>
-    /// <value>
-    ///    An integer representing the total
-    ///    amount of work for the operation.
-    /// </value>
-    public int UpperBound
+    public class ObjectPutEventArgs : ManagementEventArgs
     {
-        get {
-            return upperBound;
+        private readonly ManagementPath wmiPath;
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="context">The operation context which is echoed back
+        /// from the operation which trigerred the event.</param>
+        /// <param name="path">The WmiPath representing the identity of the
+        /// object that has been put.</param>
+        internal ObjectPutEventArgs(object context, ManagementPath path) : base(context)
+        {
+            wmiPath = path;
         }
-    }
 
-    /// <summary>
-    ///    <para> Gets the current amount of work
-    ///       done by the operation. This is always less than or equal to <see cref='System.Management.ProgressEventArgs.UpperBound'/>.</para>
-    /// </summary>
-    /// <value>
-    ///    <para>An integer representing the current amount of work
-    ///       already completed by the operation.</para>
-    /// </value>
-    public int Current
-    {
-        get {
-            return current;
+        /// <summary>
+        ///    <para> Gets the identity of the
+        ///       object that has been put.</para>
+        /// </summary>
+        /// <value>
+        /// <para>A <see cref='System.Management.ManagementPath'/> containing the path of the object that has
+        ///    been put.</para>
+        /// </value>
+        public ManagementPath Path
+        {
+            get
+            {
+                return wmiPath;
+            }
         }
     }
 
     /// <summary>
-    ///    <para>Gets or sets optional additional information regarding the operation's progress.</para>
+    /// <para>Holds event data for the <see cref='System.Management.ManagementOperationObserver.Progress'/> event.</para>
     /// </summary>
-    /// <value>
-    ///    A string containing additional
-    ///    information regarding the operation's progress.
-    /// </value>
-    public string Message
+    public class ProgressEventArgs : ManagementEventArgs
     {
-        get {
-            return (null != message) ? message : string.Empty;
+        private readonly int upperBound;
+        private readonly int current;
+        private readonly string message;
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="context">The operation context which is echoed back
+        /// from the operation which trigerred the event.</param>
+        /// <param name="upperBound">A quantity representing the total
+        /// amount of work required to be done by the operation.</param>
+        /// <param name="current">A quantity representing the current
+        /// amount of work required to be done by the operation. This is
+        /// always less than or equal to upperBound.</param>
+        /// <param name="message">Optional additional information regarding
+        /// operation progress.</param>
+        internal ProgressEventArgs(object context, int upperBound, int current, string message) : base(context)
+        {
+            this.upperBound = upperBound;
+            this.current = current;
+            this.message = message;
         }
-    }
-}
 
-/// <summary>
-/// <para>Holds event data for the <see cref='System.Management.ManagementEventWatcher.EventArrived'/> event.</para>
-/// </summary>
-public class EventArrivedEventArgs : ManagementEventArgs
-{
-    private readonly ManagementBaseObject eventObject;
+        /// <summary>
+        ///    <para> Gets the total
+        ///       amount of work required to be done by the operation.</para>
+        /// </summary>
+        /// <value>
+        ///    An integer representing the total
+        ///    amount of work for the operation.
+        /// </value>
+        public int UpperBound
+        {
+            get
+            {
+                return upperBound;
+            }
+        }
 
-    internal EventArrivedEventArgs (
-                object context,
-                ManagementBaseObject eventObject) : base (context)
-    {
-        this.eventObject = eventObject;
+        /// <summary>
+        ///    <para> Gets the current amount of work
+        ///       done by the operation. This is always less than or equal to <see cref='System.Management.ProgressEventArgs.UpperBound'/>.</para>
+        /// </summary>
+        /// <value>
+        ///    <para>An integer representing the current amount of work
+        ///       already completed by the operation.</para>
+        /// </value>
+        public int Current
+        {
+            get
+            {
+                return current;
+            }
+        }
+
+        /// <summary>
+        ///    <para>Gets or sets optional additional information regarding the operation's progress.</para>
+        /// </summary>
+        /// <value>
+        ///    A string containing additional
+        ///    information regarding the operation's progress.
+        /// </value>
+        public string Message
+        {
+            get
+            {
+                return (null != message) ? message : string.Empty;
+            }
+        }
     }
 
     /// <summary>
-    ///    <para> Gets the WMI event that was delivered.</para>
+    /// <para>Holds event data for the <see cref='System.Management.ManagementEventWatcher.EventArrived'/> event.</para>
     /// </summary>
-    /// <value>
-    ///    The object representing the WMI event.
-    /// </value>
-    public ManagementBaseObject NewEvent
+    public class EventArrivedEventArgs : ManagementEventArgs
     {
-        get { return this.eventObject; }
-    }
-}
+        private readonly ManagementBaseObject eventObject;
 
-/// <summary>
-/// <para>Holds event data for the <see cref='System.Management.ManagementEventWatcher.Stopped'/> event.</para>
-/// </summary>
-public class StoppedEventArgs : ManagementEventArgs
-{
-    private readonly int status;
+        internal EventArrivedEventArgs(object context, ManagementBaseObject eventObject) : base(context)
+        {
+            this.eventObject = eventObject;
+        }
 
-    internal StoppedEventArgs (
-                object context,
-                int status) : base (context)
-    {
-        this.status = status;
+        /// <summary>
+        ///    <para> Gets the WMI event that was delivered.</para>
+        /// </summary>
+        /// <value>
+        ///    The object representing the WMI event.
+        /// </value>
+        public ManagementBaseObject NewEvent
+        {
+            get { return this.eventObject; }
+        }
     }
 
     /// <summary>
-    ///    <para> Gets the completion status of the operation.</para>
+    /// <para>Holds event data for the <see cref='System.Management.ManagementEventWatcher.Stopped'/> event.</para>
     /// </summary>
-    /// <value>
-    /// <para>A <see cref='System.Management.ManagementStatus'/> value representing the status of the
-    ///    operation.</para>
-    /// </value>
-    public ManagementStatus Status
+    public class StoppedEventArgs : ManagementEventArgs
     {
-        get {
-            return (ManagementStatus) status;
+        private readonly int status;
+
+        internal StoppedEventArgs(object context, int status) : base(context)
+        {
+            this.status = status;
+        }
+
+        /// <summary>
+        ///    <para> Gets the completion status of the operation.</para>
+        /// </summary>
+        /// <value>
+        /// <para>A <see cref='System.Management.ManagementStatus'/> value representing the status of the
+        ///    operation.</para>
+        /// </value>
+        public ManagementStatus Status
+        {
+            get
+            {
+                return (ManagementStatus)status;
+            }
         }
     }
-}
 
 }
index 3c5618f..793f1b6 100644 (file)
@@ -16,7 +16,7 @@ namespace System.Management
     /// <summary>
     /// <para>Represents the method that will handle the <see cref='System.Management.ManagementEventWatcher.Stopped'/> event.</para>
     /// </summary>
-    public delegate void StoppedEventHandler (object sender, StoppedEventArgs e);
+    public delegate void StoppedEventHandler(object sender, StoppedEventArgs e);
 
     //CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC//
     /// <summary>
@@ -114,15 +114,15 @@ namespace System.Management
     public class ManagementEventWatcher : Component
     {
         //fields
-        private ManagementScope         scope;
-        private EventQuery              query;
-        private EventWatcherOptions     options;
-        private IEnumWbemClassObject    enumWbem;
-        private IWbemClassObjectFreeThreaded[]      cachedObjects; //points to objects currently available in cache
-        private uint                    cachedCount; //says how many objects are in the cache (when using BlockSize option)
-        private uint                    cacheIndex; //used to walk the cache
-        private SinkForEventQuery       sink; // the sink implementation for event queries
-        private readonly WmiDelegateInvoker      delegateInvoker;
+        private ManagementScope scope;
+        private EventQuery query;
+        private EventWatcherOptions options;
+        private IEnumWbemClassObject enumWbem;
+        private IWbemClassObjectFreeThreaded[] cachedObjects; //points to objects currently available in cache
+        private uint cachedCount; //says how many objects are in the cache (when using BlockSize option)
+        private uint cacheIndex; //used to walk the cache
+        private SinkForEventQuery sink; // the sink implementation for event queries
+        private readonly WmiDelegateInvoker delegateInvoker;
 
         //Called when IdentifierChanged() event fires
         private void HandleIdentifierChange(object sender,
@@ -140,7 +140,7 @@ namespace System.Management
         /// <para> Initializes a new instance of the <see cref='System.Management.ManagementEventWatcher'/> class. For further
         ///    initialization, set the properties on the object. This is the default constructor.</para>
         /// </summary>
-        public ManagementEventWatcher() : this((ManagementScope)null, null, null) {}
+        public ManagementEventWatcher() : this((ManagementScope)null, null, null) { }
 
         //parameterized constructors
         /// <summary>
@@ -151,8 +151,8 @@ namespace System.Management
         ///    <para>The namespace in which the watcher will be listening for
         ///       events is the default namespace that is currently set.</para>
         /// </remarks>
-        public ManagementEventWatcher (
-            EventQuery query) : this(null, query, null) {}
+        public ManagementEventWatcher(
+            EventQuery query) : this(null, query, null) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementEventWatcher'/> class when given a WMI event query in the
@@ -163,8 +163,8 @@ namespace System.Management
         ///    <para>The namespace in which the watcher will be listening for
         ///       events is the default namespace that is currently set.</para>
         /// </remarks>
-        public ManagementEventWatcher (
-            string query) : this(null, new EventQuery(query), null) {}
+        public ManagementEventWatcher(
+            string query) : this(null, new EventQuery(query), null) { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.ManagementEventWatcher'/>
@@ -174,7 +174,7 @@ namespace System.Management
         /// <param name=' query'>An <see cref='System.Management.EventQuery'/> object representing a WMI event query, which determines the events for which the watcher will listen.</param>
         public ManagementEventWatcher(
             ManagementScope scope,
-            EventQuery query) : this(scope, query, null) {}
+            EventQuery query) : this(scope, query, null) { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.ManagementEventWatcher'/>
@@ -185,7 +185,7 @@ namespace System.Management
         /// <param name=' query'> The query that defines the events for which the watcher will listen.</param>
         public ManagementEventWatcher(
             string scope,
-            string query) : this(new ManagementScope(scope), new EventQuery(query), null) {}
+            string query) : this(new ManagementScope(scope), new EventQuery(query), null) { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.ManagementEventWatcher'/> class that listens for
@@ -199,7 +199,7 @@ namespace System.Management
         public ManagementEventWatcher(
             string scope,
             string query,
-            EventWatcherOptions options) : this(new ManagementScope(scope), new EventQuery(query), options) {}
+            EventWatcherOptions options) : this(new ManagementScope(scope), new EventQuery(query), options) { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.ManagementEventWatcher'/> class
@@ -236,25 +236,25 @@ namespace System.Management
             cachedCount = 0;
             cacheIndex = 0;
             sink = null;
-            delegateInvoker = new WmiDelegateInvoker (this);
+            delegateInvoker = new WmiDelegateInvoker(this);
         }
 
         /// <summary>
         ///    <para>Ensures that outstanding calls are cleared. This is the destructor for the object.</para>
         /// </summary>
-        ~ManagementEventWatcher ()
+        ~ManagementEventWatcher()
         {
             // Ensure any outstanding calls are cleared
-            Stop ();
+            Stop();
 
             if (null != scope)
-                scope.IdentifierChanged -= new IdentifierChangedEventHandler (HandleIdentifierChange);
+                scope.IdentifierChanged -= new IdentifierChangedEventHandler(HandleIdentifierChange);
 
             if (null != options)
-                options.IdentifierChanged -= new IdentifierChangedEventHandler (HandleIdentifierChange);
+                options.IdentifierChanged -= new IdentifierChangedEventHandler(HandleIdentifierChange);
 
             if (null != query)
-                query.IdentifierChanged -= new IdentifierChangedEventHandler (HandleIdentifierChange);
+                query.IdentifierChanged -= new IdentifierChangedEventHandler(HandleIdentifierChange);
         }
 
         //
@@ -264,12 +264,12 @@ namespace System.Management
         /// <summary>
         ///    <para> Occurs when a new event arrives.</para>
         /// </summary>
-        public event EventArrivedEventHandler       EventArrived;
+        public event EventArrivedEventHandler EventArrived;
 
         /// <summary>
         ///    <para> Occurs when a subscription is canceled.</para>
         /// </summary>
-        public event StoppedEventHandler            Stopped;
+        public event StoppedEventHandler Stopped;
 
         //
         //Public Properties
@@ -292,7 +292,7 @@ namespace System.Management
                 if (null != value)
                 {
                     ManagementScope oldScope = scope;
-                    scope = (ManagementScope)value.Clone ();
+                    scope = (ManagementScope)value.Clone();
 
                     // Unregister ourselves from the previous scope object
                     if (null != oldScope)
@@ -325,7 +325,7 @@ namespace System.Management
                 if (null != value)
                 {
                     ManagementQuery oldQuery = query;
-                    query = (EventQuery)value.Clone ();
+                    query = (EventQuery)value.Clone();
 
                     // Unregister ourselves from the previous query object
                     if (null != oldQuery)
@@ -358,7 +358,7 @@ namespace System.Management
                 if (null != value)
                 {
                     EventWatcherOptions oldOptions = options;
-                    options = (EventWatcherOptions)value.Clone ();
+                    options = (EventWatcherOptions)value.Clone();
 
                     // Unregister ourselves from the previous scope object
                     if (null != oldOptions)
@@ -392,7 +392,7 @@ namespace System.Management
         {
             ManagementBaseObject obj = null;
 
-            Initialize ();
+            Initialize();
 
 #pragma warning disable CA2002
             lock (this)
@@ -407,11 +407,11 @@ namespace System.Management
                     if (null == enumWbem)   //don't have an enumerator yet - get it
                     {
                         //Execute the query
-                        status = scope.GetSecuredIWbemServicesHandler( Scope.GetIWbemServices() ).ExecNotificationQuery_(
+                        status = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).ExecNotificationQuery_(
                             query.QueryLanguage,
                             query.QueryString,
                             options.Flags,
-                            options.GetContext (),
+                            options.GetContext(),
                             ref enumWbem);
                     }
 
@@ -425,8 +425,8 @@ namespace System.Management
                             IWbemClassObject_DoNotMarshal[] tempArray = new IWbemClassObject_DoNotMarshal[options.BlockSize];
 
                             int timeout = (ManagementOptions.InfiniteTimeout == options.Timeout)
-                                ? (int) tag_WBEM_TIMEOUT_TYPE.WBEM_INFINITE :
-                                (int) options.Timeout.TotalMilliseconds;
+                                ? (int)tag_WBEM_TIMEOUT_TYPE.WBEM_INFINITE :
+                                (int)options.Timeout.TotalMilliseconds;
 
                             status = scope.GetSecuredIEnumWbemClassObjectHandler(enumWbem).Next_(timeout, (uint)options.BlockSize, tempArray, ref cachedCount);
                             cacheIndex = 0;
@@ -478,10 +478,10 @@ namespace System.Management
         /// </summary>
         public void Start()
         {
-            Initialize ();
+            Initialize();
 
             // Cancel any current event query
-            Stop ();
+            Stop();
 
             // Submit a new query
             SecurityHandler securityHandler = Scope.GetSecurityHandler();
@@ -539,26 +539,26 @@ namespace System.Management
             {
                 Marshal.ReleaseComObject(enumWbem);
                 enumWbem = null;
-                FireStopped (new StoppedEventArgs (options.Context, (int)ManagementStatus.OperationCanceled));
+                FireStopped(new StoppedEventArgs(options.Context, (int)ManagementStatus.OperationCanceled));
             }
 
             // In async mode cancel the call to the sink - this will
             // unwind the operation and cause a Stopped message
             if (null != sink)
             {
-                sink.Cancel ();
+                sink.Cancel();
                 sink = null;
             }
         }
 
-        private void Initialize ()
+        private void Initialize()
         {
             //If the query is not set yet we can't do it
             if (null == query)
                 throw new InvalidOperationException();
 
             if (null == options)
-                Options = new EventWatcherOptions ();
+                Options = new EventWatcherOptions();
 
             //If we're not connected yet, this is the time to do it...
 #pragma warning disable CA2002
@@ -566,7 +566,7 @@ namespace System.Management
 #pragma warning restore CA2002
             {
                 if (null == scope)
-                    Scope = new ManagementScope ();
+                    Scope = new ManagementScope();
 
                 if (null == cachedObjects)
                     cachedObjects = new IWbemClassObjectFreeThreaded[options.BlockSize];
@@ -574,27 +574,27 @@ namespace System.Management
 
             lock (scope)
             {
-                scope.Initialize ();
+                scope.Initialize();
             }
         }
 
 
-        internal void FireStopped (StoppedEventArgs args)
+        internal void FireStopped(StoppedEventArgs args)
         {
             try
             {
-                delegateInvoker.FireEventToDelegates (Stopped, args);
+                delegateInvoker.FireEventToDelegates(Stopped, args);
             }
             catch
             {
             }
         }
 
-        internal void FireEventArrived (EventArrivedEventArgs args)
+        internal void FireEventArrived(EventArrivedEventArgs args)
         {
             try
             {
-                delegateInvoker.FireEventToDelegates (EventArrived, args);
+                delegateInvoker.FireEventToDelegates(EventArrived, args);
             }
             catch
             {
@@ -607,16 +607,16 @@ namespace System.Management
 
     internal class SinkForEventQuery : IWmiEventSource
     {
-        private readonly ManagementEventWatcher          eventWatcher;
-        private readonly object                          context;
-        private readonly IWbemServices                   services;
+        private readonly ManagementEventWatcher eventWatcher;
+        private readonly object context;
+        private readonly IWbemServices services;
         private IWbemObjectSink stub;           // The secured IWbemObjectSink
         private int status;
         private readonly bool isLocal;
 
-        public int Status {get {return status; } set {status=value; }}
+        public int Status { get { return status; } set { status = value; } }
 
-        public SinkForEventQuery (ManagementEventWatcher eventWatcher,
+        public SinkForEventQuery(ManagementEventWatcher eventWatcher,
             object context,
             IWbemServices services)
         {
@@ -627,8 +627,8 @@ namespace System.Management
             this.isLocal = false;
 
             // determine if the server is local, and if so don't create a real stub using unsecap
-            if ((0==string.Compare(eventWatcher.Scope.Path.Server, ".", StringComparison.OrdinalIgnoreCase)) ||
-                (0==string.Compare(eventWatcher.Scope.Path.Server, System.Environment.MachineName, StringComparison.OrdinalIgnoreCase)))
+            if ((0 == string.Compare(eventWatcher.Scope.Path.Server, ".", StringComparison.OrdinalIgnoreCase)) ||
+                (0 == string.Compare(eventWatcher.Scope.Path.Server, System.Environment.MachineName, StringComparison.OrdinalIgnoreCase)))
             {
                 this.isLocal = true;
             }
@@ -640,19 +640,19 @@ namespace System.Management
                 //
                 // Ensure we are able to trap exceptions from worker thread.
                 //
-                ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethodWithParam ( HackToCreateStubInMTA ) );
+                ThreadDispatch disp = new ThreadDispatch(new ThreadDispatch.ThreadWorkerMethodWithParam(HackToCreateStubInMTA));
                 disp.Parameter = this;
-                disp.Start ( );
+                disp.Start();
             }
 
         }
 
         private void HackToCreateStubInMTA(object param)
         {
-            SinkForEventQuery obj = (SinkForEventQuery) param;
+            SinkForEventQuery obj = (SinkForEventQuery)param;
             object dmuxStub = null;
-            obj.Status = WmiNetUtilsHelper.GetDemultiplexedStub_f (obj, obj.isLocal, out dmuxStub);
-            obj.stub = (IWbemObjectSink) dmuxStub;
+            obj.Status = WmiNetUtilsHelper.GetDemultiplexedStub_f(obj, obj.isLocal, out dmuxStub);
+            obj.stub = (IWbemObjectSink)dmuxStub;
         }
 
         internal IWbemObjectSink Stub
@@ -676,7 +676,7 @@ namespace System.Management
             }
         }
 
-        public void SetStatus (
+        public void SetStatus(
             int flags,
             int hResult,
             string message,
@@ -717,7 +717,7 @@ namespace System.Management
             }
         }
 
-        internal void Cancel ()
+        internal void Cancel()
         {
             if (null != stub)
             {
@@ -745,7 +745,7 @@ namespace System.Management
             }
         }
 
-        internal void ReleaseStub ()
+        internal void ReleaseStub()
         {
             if (null != stub)
             {
index c591ea2..2717cf0 100644 (file)
@@ -46,7 +46,7 @@ namespace System.Management
         ///    and <see cref='System.Runtime.Serialization.StreamingContext'/>.</para>
         /// </summary>
         /// <param name='info'>The <see cref='System.Runtime.Serialization.SerializationInfo'/> to populate with data.</param>
-    /// <param name='context'>The destination (see <see cref='System.Runtime.Serialization.StreamingContext'/> ) for this serialization.</param>
+        /// <param name='context'>The destination (see <see cref='System.Runtime.Serialization.StreamingContext'/> ) for this serialization.</param>
         protected ManagementNamedValueCollection(SerializationInfo info, StreamingContext context) : base(info, context)
         {
             throw new PlatformNotSupportedException();
@@ -65,19 +65,21 @@ namespace System.Management
             {
                 int status = (int)ManagementStatus.NoError;
 
-                try {
-                    wbemContext = (IWbemContext) new WbemContext ();
+                try
+                {
+                    wbemContext = (IWbemContext)new WbemContext();
 
                     foreach (string name in this)
                     {
                         object val = base.BaseGet(name);
-                        status = wbemContext.SetValue_ (name, 0, ref val);
+                        status = wbemContext.SetValue_(name, 0, ref val);
                         if ((status & 0x80000000) != 0)
                         {
                             break;
                         }
                     }
-                } catch {}
+                }
+                catch { }
             }
 
             return wbemContext;
@@ -88,16 +90,17 @@ namespace System.Management
         /// </summary>
         /// <param name=' name'>The name of the new value.</param>
         /// <param name=' value'>The value to be associated with the name.</param>
-        public void Add (string name, object value)
+        public void Add(string name, object value)
         {
             // Remove any old entry
             try
             {
-                base.BaseRemove (name);
-            } catch {}
+                base.BaseRemove(name);
+            }
+            catch { }
 
-            base.BaseAdd (name, value);
-            FireIdentifierChanged ();
+            base.BaseAdd(name, value);
+            FireIdentifierChanged();
         }
 
         /// <summary>
@@ -107,19 +110,19 @@ namespace System.Management
         ///       exception is thrown.</para>
         /// </summary>
         /// <param name=' name'>The name of the value to be removed.</param>
-        public void Remove (string name)
+        public void Remove(string name)
         {
-            base.BaseRemove (name);
-            FireIdentifierChanged ();
+            base.BaseRemove(name);
+            FireIdentifierChanged();
         }
 
         /// <summary>
         ///    <para>Removes all entries from the collection.</para>
         /// </summary>
-        public void RemoveAll ()
+        public void RemoveAll()
         {
-            base.BaseClear ();
-            FireIdentifierChanged ();
+            base.BaseClear();
+            FireIdentifierChanged();
         }
 
         /// <summary>
@@ -130,38 +133,40 @@ namespace System.Management
         /// <returns>
         ///    The new copy of the collection.
         /// </returns>
-        public ManagementNamedValueCollection Clone ()
+        public ManagementNamedValueCollection Clone()
         {
             ManagementNamedValueCollection nvc = new ManagementNamedValueCollection();
 
             foreach (string name in this)
             {
                 // If we can clone the value, do so. Otherwise throw.
-                object val = base.BaseGet (name);
+                object val = base.BaseGet(name);
 
                 if (null != val)
                 {
-                    Type valueType = val.GetType ();
+                    Type valueType = val.GetType();
 
                     if (valueType.IsByRef)
                     {
                         try
                         {
-                            object clonedValue = ((ICloneable)val).Clone ();
-                            nvc.Add (name, clonedValue);
+                            object clonedValue = ((ICloneable)val).Clone();
+                            nvc.Add(name, clonedValue);
                         }
                         catch
                         {
-                            throw new NotSupportedException ();
+                            throw new NotSupportedException();
                         }
                     }
                     else
                     {
-                        nvc.Add (name, val);
+                        nvc.Add(name, val);
                     }
                 }
                 else
-                    nvc.Add (name, null);
+                {
+                    nvc.Add(name, null);
+                }
             }
 
             return nvc;
@@ -177,7 +182,8 @@ namespace System.Management
         /// </value>
         public object this[string name]
         {
-            get {
+            get
+            {
                 return base.BaseGet(name);
             }
         }
index adf603d..6b4db02 100644 (file)
@@ -69,10 +69,10 @@ namespace System.Management
 
         //Fields
 
-        private    IWbemClassObjectFreeThreaded    wmiClass;
-        internal ManagementScope                scope;
-        internal ManagementPath                    path;
-        internal ObjectGetOptions                options;
+        private IWbemClassObjectFreeThreaded wmiClass;
+        internal ManagementScope scope;
+        internal ManagementPath path;
+        internal ObjectGetOptions options;
 
         //Used to represent whether this managementObject is currently bound to a wbemObject
         //or not - whenever an "identifying" property is changed (Path, Scope...) the object
@@ -227,7 +227,7 @@ namespace System.Management
         /// Console.WriteLine(o("FreeSpace"))
         ///    </code>
         /// </example>
-        public ManagementObject() : this ((ManagementScope)null, null, null) {}
+        public ManagementObject() : this((ManagementScope)null, null, null) { }
 
         //parameterized constructors
         /// <summary>
@@ -243,7 +243,7 @@ namespace System.Management
         /// Dim o As New ManagementObject(p)
         ///    </code>
         /// </example>
-        public ManagementObject(ManagementPath path) : this(null, path, null) {}
+        public ManagementObject(ManagementPath path) : this(null, path, null) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementObject'/> class for the specified WMI object path. The path
@@ -271,7 +271,7 @@ namespace System.Management
         /// Dim o As New ManagementObject("\\\\MyServer\\root\\MyApp:MyClass.Key=""abc""");
         ///    </code>
         /// </example>
-        public ManagementObject(string path) : this(null, new ManagementPath(path), null) {}
+        public ManagementObject(string path) : this(null, new ManagementPath(path), null) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementObject'/> class bound to the specified
@@ -301,7 +301,7 @@ namespace System.Management
         /// Console.WriteLine(o.GetQualifierValue("Description"));
         ///    </code>
         /// </example>
-        public ManagementObject(ManagementPath path, ObjectGetOptions options) : this(null, path, options) {}
+        public ManagementObject(ManagementPath path, ObjectGetOptions options) : this(null, path, options) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementObject'/> class bound to the specified WMI path, including the
@@ -329,7 +329,8 @@ namespace System.Management
         ///    </code>
         /// </example>
         public ManagementObject(string path, ObjectGetOptions options) :
-            this(new ManagementPath(path), options) {}
+            this(new ManagementPath(path), options)
+        { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.ManagementObject'/>
@@ -370,7 +371,7 @@ namespace System.Management
         ///    </code>
         /// </example>
         public ManagementObject(ManagementScope scope, ManagementPath path, ObjectGetOptions options)
-            : base (null)
+            : base(null)
         {
             ManagementObjectCTOR(scope, path, options);
         }
@@ -393,7 +394,7 @@ namespace System.Management
                 // we don't have a scope
                 nsPath = path.GetNamespacePath((int)tag_WBEM_GET_TEXT_FLAGS.WBEMPATH_GET_SERVER_AND_NAMESPACE_ONLY);
 
-                if ((null != scope) && (scope.Path.NamespacePath.Length>0))
+                if ((null != scope) && (scope.Path.NamespacePath.Length > 0))
                 {
                     // If the scope has a path too, the namespace portion of
                     // scope.path takes precedence over what is specified in path
@@ -418,7 +419,7 @@ namespace System.Management
             else
             {
                 // Use the path if possible, otherwise let it default
-                if (nsPath.Length>0)
+                if (nsPath.Length > 0)
                 {
                     this.scope = new ManagementScope(nsPath);
                     this.scope.IdentifierChanged += new IdentifierChangedEventHandler(HandleIdentifierChange);
@@ -455,13 +456,13 @@ namespace System.Management
         ///    </code>
         /// </example>
         public ManagementObject(string scopeString, string pathString, ObjectGetOptions options)
-            : this(new ManagementScope(scopeString), new ManagementPath(pathString), options) {}
+            : this(new ManagementScope(scopeString), new ManagementPath(pathString), options) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementObject'/> class that is serializable.</para>
         /// </summary>
         /// <param name='info'>The <see cref='System.Runtime.Serialization.SerializationInfo'/> to populate with data.</param>
-    /// <param name='context'>The destination (see <see cref='System.Runtime.Serialization.StreamingContext'/> ) for this serialization.</param>
+        /// <param name='context'>The destination (see <see cref='System.Runtime.Serialization.StreamingContext'/> ) for this serialization.</param>
         protected ManagementObject(SerializationInfo info, StreamingContext context) : base(info, context)
         {
             ManagementObjectCTOR(null, null, null);
@@ -579,7 +580,7 @@ namespace System.Management
                     newPath.IsEmpty)
                 {
                     if (null != path)
-                        path.IdentifierChanged -=  new IdentifierChangedEventHandler(HandleIdentifierChange);
+                        path.IdentifierChanged -= new IdentifierChangedEventHandler(HandleIdentifierChange);
 
                     path = ManagementPath._Clone((ManagementPath)value, new IdentifierChangedEventHandler(HandleIdentifierChange));
 
@@ -772,9 +773,9 @@ namespace System.Management
         {
             IWbemClassObjectFreeThreaded tempObj = null;
 
-            Initialize ( false ); // this may throw
+            Initialize(false); // this may throw
 
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
             else
             {
@@ -782,17 +783,17 @@ namespace System.Management
                     (null == options) ? new ObjectGetOptions() : options;
 
                 SecurityHandler securityHandler = null;
-                int status                        = (int)ManagementStatus.NoError;
+                int status = (int)ManagementStatus.NoError;
 
                 try
                 {
                     securityHandler = scope.GetSecurityHandler();
 
-                    status = scope.GetSecuredIWbemServicesHandler( scope.GetIWbemServices() ).GetObject_(path.RelativePath,
+                    status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices()).GetObject_(path.RelativePath,
                                                             gOptions.Flags,
                                                             gOptions.GetContext(),
                                                             ref tempObj,
-                                                            IntPtr.Zero );
+                                                            IntPtr.Zero);
 
                     if (status < 0)
                     {
@@ -894,9 +895,9 @@ namespace System.Management
         /// </example>
         public void Get(ManagementOperationObserver watcher)
         {
-            Initialize ( false );
+            Initialize(false);
 
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
             else if (null == watcher)
                 throw new ArgumentNullException(nameof(watcher));
@@ -916,7 +917,7 @@ namespace System.Management
                     o.SendStatus = true;
 
                 SecurityHandler securityHandler = null;
-                int status                        = (int)ManagementStatus.NoError;
+                int status = (int)ManagementStatus.NoError;
 
                 securityHandler = scope.GetSecurityHandler();
 
@@ -1032,10 +1033,10 @@ namespace System.Management
             bool classDefinitionsOnly,
             EnumerationOptions options)
         {
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
 
-            Initialize ( false );
+            Initialize(false);
 
             IEnumWbemClassObject enumWbem = null;
             EnumerationOptions o = (null != options) ? options : new EnumerationOptions();
@@ -1052,13 +1053,13 @@ namespace System.Management
             o.EnumerateDeep = true; //note this turns the FLAG to 0 !!
 
             SecurityHandler securityHandler = null;
-            int status                        = (int)ManagementStatus.NoError;
+            int status = (int)ManagementStatus.NoError;
 
             try
             {
                 securityHandler = scope.GetSecurityHandler();
 
-                status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices() ).ExecQuery_(
+                status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices()).ExecQuery_(
                                                         q.QueryLanguage,
                                                         q.QueryString,
                                                         o.Flags,
@@ -1149,10 +1150,10 @@ namespace System.Management
             bool classDefinitionsOnly,
             EnumerationOptions options)
         {
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
 
-            Initialize ( true );
+            Initialize(true);
 
             if (null == watcher)
                 throw new ArgumentNullException(nameof(watcher));
@@ -1180,12 +1181,12 @@ namespace System.Management
                 //Make sure the EnumerateDeep flag bit is turned off because it's invalid for queries
                 o.EnumerateDeep = true; //note this turns the FLAG to 0 !!
 
-                SecurityHandler securityHandler    = null;
-                int status                        = (int)ManagementStatus.NoError;
+                SecurityHandler securityHandler = null;
+                int status = (int)ManagementStatus.NoError;
 
                 securityHandler = scope.GetSecurityHandler();
 
-                status = scope.GetSecuredIWbemServicesHandler( scope.GetIWbemServices() ).ExecQueryAsync_(
+                status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices()).ExecQueryAsync_(
                                                         q.QueryLanguage,
                                                         q.QueryString,
                                                         o.Flags,
@@ -1270,10 +1271,10 @@ namespace System.Management
             bool classDefinitionsOnly,
             EnumerationOptions options)
         {
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
 
-            Initialize ( false );
+            Initialize(false);
 
             IEnumWbemClassObject enumWbem = null;
             EnumerationOptions o =
@@ -1286,7 +1287,7 @@ namespace System.Management
             o.EnumerateDeep = true; //note this turns the FLAG to 0 !!
 
             SecurityHandler securityHandler = null;
-            int status                        = (int)ManagementStatus.NoError;
+            int status = (int)ManagementStatus.NoError;
 
             try
             {
@@ -1297,7 +1298,7 @@ namespace System.Management
                                                     q.QueryString,
                                                     o.Flags,
                                                     o.GetContext(),
-                                                    ref enumWbem );
+                                                    ref enumWbem);
 
 
                 if (status < 0)
@@ -1378,13 +1379,13 @@ namespace System.Management
             bool classDefinitionsOnly,
             EnumerationOptions options)
         {
-            if ((null == path)  || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
             if (null == watcher)
                 throw new ArgumentNullException(nameof(watcher));
             else
             {
-                Initialize ( false );
+                Initialize(false);
 
                 // Ensure we switch off ReturnImmediately as this is invalid for async calls
                 EnumerationOptions o =
@@ -1406,16 +1407,16 @@ namespace System.Management
                 o.EnumerateDeep = true; //note this turns the FLAG to 0 !!
 
                 SecurityHandler securityHandler = null;
-                int status                        = (int)ManagementStatus.NoError;
+                int status = (int)ManagementStatus.NoError;
 
                 securityHandler = scope.GetSecurityHandler();
 
-                status = scope.GetSecuredIWbemServicesHandler( scope.GetIWbemServices() ).ExecQueryAsync_(
+                status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices()).ExecQueryAsync_(
                                                         q.QueryLanguage,
                                                         q.QueryString,
                                                         o.Flags,
                                                         o.GetContext(),
-                                                        sink.Stub );
+                                                        sink.Stub);
 
 
                 if (securityHandler != null)
@@ -1447,7 +1448,7 @@ namespace System.Management
         /// </returns>
         public ManagementPath Put()
         {
-            return Put((PutOptions) null);
+            return Put((PutOptions)null);
         }
 
 
@@ -1464,7 +1465,7 @@ namespace System.Management
         public ManagementPath Put(PutOptions options)
         {
             ManagementPath newPath = null;
-            Initialize ( true );
+            Initialize(true);
             PutOptions o = (null != options) ? options : new PutOptions();
 
             IWbemServices wbemServices = scope.GetIWbemServices();
@@ -1474,11 +1475,11 @@ namespace System.Management
             // has been redefined to be an IntPtr.  Due to the fact that it wasn't possible to
             // pass NULL for the optional argument.
             //
-            IntPtr ppwbemCallResult            = IntPtr.Zero;
-            IntPtr pwbemCallResult            = IntPtr.Zero;
-            IWbemCallResult wbemCallResult    = null;
-            SecurityHandler securityHandler    = null;
-            int status                        = (int)ManagementStatus.NoError;
+            IntPtr ppwbemCallResult = IntPtr.Zero;
+            IntPtr pwbemCallResult = IntPtr.Zero;
+            IWbemCallResult wbemCallResult = null;
+            SecurityHandler securityHandler = null;
+            int status = (int)ManagementStatus.NoError;
 
             try
             {
@@ -1489,10 +1490,10 @@ namespace System.Management
 
                 if (IsClass)
                 {
-                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).PutClass_( wbemObject,
+                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).PutClass_(wbemObject,
                         o.Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_RETURN_IMMEDIATELY,
                         o.GetContext(),
-                        ppwbemCallResult );
+                        ppwbemCallResult);
                 }
                 else
                 {
@@ -1597,8 +1598,8 @@ namespace System.Management
 
             }
             catch
-           {
-           }
+            {
+            }
 
             if (newPath == null)
                 newPath = new ManagementPath();
@@ -1627,7 +1628,7 @@ namespace System.Management
                 throw new ArgumentNullException(nameof(watcher));
             else
             {
-                Initialize ( false );
+                Initialize(false);
 
                 PutOptions o = (null == options) ?
                     new PutOptions() : (PutOptions)options.Clone();
@@ -1644,16 +1645,16 @@ namespace System.Management
                 sink.InternalObjectPut +=
                     new InternalObjectPutEventHandler(this.HandleObjectPut);
 
-                SecurityHandler securityHandler    = null;
+                SecurityHandler securityHandler = null;
                 // Assign to error initially to insure internal event handler cleanup
                 // on non-management exception.
-                int status                        = (int)ManagementStatus.Failed;
+                int status = (int)ManagementStatus.Failed;
 
                 securityHandler = scope.GetSecurityHandler();
 
                 if (IsClass)
                 {
-                    status = scope.GetSecuredIWbemServicesHandler( wbemServices ).PutClassAsync_(
+                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).PutClassAsync_(
                         wbemObject,
                         o.Flags,
                         o.GetContext(),
@@ -1661,7 +1662,7 @@ namespace System.Management
                 }
                 else
                 {
-                    status = scope.GetSecuredIWbemServicesHandler( wbemServices ).PutInstanceAsync_(
+                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).PutInstanceAsync_(
                         wbemObject,
                         o.Flags,
                         o.GetContext(),
@@ -1753,7 +1754,7 @@ namespace System.Management
         /// </returns>
         public ManagementPath CopyTo(ManagementPath path, PutOptions options)
         {
-            Initialize ( false );
+            Initialize(false);
 
             ManagementScope destinationScope = null;
 
@@ -1772,11 +1773,11 @@ namespace System.Management
             // has been redefined to be an IntPtr.  Due to the fact that it wasn't possible to
             // pass NULL for the optional argument.
             //
-            IntPtr ppwbemCallResult            = IntPtr.Zero;
-            IntPtr pwbemCallResult            = IntPtr.Zero;
-            IWbemCallResult wbemCallResult    = null;
-            SecurityHandler securityHandler    = null;
-            int status                        = (int)ManagementStatus.NoError;
+            IntPtr ppwbemCallResult = IntPtr.Zero;
+            IntPtr pwbemCallResult = IntPtr.Zero;
+            IWbemCallResult wbemCallResult = null;
+            SecurityHandler securityHandler = null;
+            int status = (int)ManagementStatus.NoError;
 
             try
             {
@@ -1787,7 +1788,7 @@ namespace System.Management
 
                 if (IsClass)
                 {
-                    status = scope.GetSecuredIWbemServicesHandler( wbemServices ).PutClass_(
+                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).PutClass_(
                         wbemObject,
                         o.Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_RETURN_IMMEDIATELY,
                         o.GetContext(),
@@ -1795,7 +1796,7 @@ namespace System.Management
                 }
                 else
                 {
-                    status = scope.GetSecuredIWbemServicesHandler( wbemServices ).PutInstance_(
+                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).PutInstance_(
                         wbemObject,
                         o.Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_RETURN_IMMEDIATELY,
                         o.GetContext(),
@@ -1888,13 +1889,13 @@ namespace System.Management
                 throw new ArgumentNullException(nameof(watcher));
             else
             {
-                Initialize ( false );
+                Initialize(false);
                 ManagementScope destinationScope = null;
 
                 destinationScope = new ManagementScope(path, scope);
                 destinationScope.Initialize();
 
-                PutOptions o = (null != options) ? (PutOptions) options.Clone() : new PutOptions();
+                PutOptions o = (null != options) ? (PutOptions)options.Clone() : new PutOptions();
 
                 // If someone has registered for progress, make sure we flag it
                 if (watcher.HaveListenersForProgress)
@@ -1905,13 +1906,13 @@ namespace System.Management
                 IWbemServices destWbemServices = destinationScope.GetIWbemServices();
 
                 SecurityHandler securityHandler = null;
-                int status                        = (int)ManagementStatus.NoError;
+                int status = (int)ManagementStatus.NoError;
 
                 securityHandler = destinationScope.GetSecurityHandler();
 
                 if (IsClass)
                 {
-                    status = destinationScope.GetSecuredIWbemServicesHandler( destWbemServices ).PutClassAsync_(
+                    status = destinationScope.GetSecuredIWbemServicesHandler(destWbemServices).PutClassAsync_(
                                                     wbemObject,
                                                     o.Flags,
                                                     o.GetContext(),
@@ -1920,7 +1921,7 @@ namespace System.Management
                 }
                 else
                 {
-                    status = destinationScope.GetSecuredIWbemServicesHandler( destWbemServices ).PutInstanceAsync_(
+                    status = destinationScope.GetSecuredIWbemServicesHandler(destWbemServices).PutInstanceAsync_(
                                                     wbemObject,
                                                     o.Flags,
                                                     o.GetContext(),
@@ -1953,7 +1954,7 @@ namespace System.Management
         /// </summary>
         public void Delete()
         {
-            Delete((DeleteOptions) null);
+            Delete((DeleteOptions)null);
         }
 
         /// <summary>
@@ -1962,15 +1963,15 @@ namespace System.Management
         /// <param name='options'>The options for how to delete the object. </param>
         public void Delete(DeleteOptions options)
         {
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
 
-            Initialize ( false );
+            Initialize(false);
             DeleteOptions o = (null != options) ? options : new DeleteOptions();
             IWbemServices wbemServices = scope.GetIWbemServices();
 
             SecurityHandler securityHandler = null;
-            int status                        = (int)ManagementStatus.NoError;
+            int status = (int)ManagementStatus.NoError;
 
             try
             {
@@ -1978,7 +1979,7 @@ namespace System.Management
 
                 if (IsClass)
                 {
-                    status = scope.GetSecuredIWbemServicesHandler( wbemServices ).DeleteClass_(
+                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).DeleteClass_(
                         path.RelativePath,
                         o.Flags,
                         o.GetContext(),
@@ -1986,7 +1987,7 @@ namespace System.Management
                 }
                 else
                 {
-                    status = scope.GetSecuredIWbemServicesHandler( wbemServices ).DeleteInstance_(
+                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).DeleteInstance_(
                         path.RelativePath,
                         o.Flags,
                         o.GetContext(),
@@ -2026,14 +2027,14 @@ namespace System.Management
         /// <param name='options'>The options for how to delete the object.</param>
         public void Delete(ManagementOperationObserver watcher, DeleteOptions options)
         {
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
             else if (null == watcher)
                 throw new ArgumentNullException(nameof(watcher));
             else
             {
-                Initialize ( false );
-                DeleteOptions o = (null != options) ? (DeleteOptions) options.Clone() : new DeleteOptions();
+                Initialize(false);
+                DeleteOptions o = (null != options) ? (DeleteOptions)options.Clone() : new DeleteOptions();
 
                 // If someone has registered for progress, make sure we flag it
                 if (watcher.HaveListenersForProgress)
@@ -2043,20 +2044,20 @@ namespace System.Management
                 WmiEventSink sink = watcher.GetNewSink(scope, o.Context);
 
                 SecurityHandler securityHandler = null;
-                int status                        = (int)ManagementStatus.NoError;
+                int status = (int)ManagementStatus.NoError;
 
                 securityHandler = scope.GetSecurityHandler();
 
                 if (IsClass)
                 {
-                    status = scope.GetSecuredIWbemServicesHandler( wbemServices ).DeleteClassAsync_(path.RelativePath,
+                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).DeleteClassAsync_(path.RelativePath,
                         o.Flags,
                         o.GetContext(),
                         sink.Stub);
                 }
                 else
                 {
-                    status = scope.GetSecuredIWbemServicesHandler( wbemServices ).DeleteInstanceAsync_(path.RelativePath,
+                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).DeleteInstanceAsync_(path.RelativePath,
                         o.Flags,
                         o.GetContext(),
                         sink.Stub);
@@ -2150,13 +2151,13 @@ namespace System.Management
         {
             object result = null;
 
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
             else if (null == methodName)
                 throw new ArgumentNullException(nameof(methodName));
             else
             {
-                Initialize ( false );
+                Initialize(false);
 
                 // Map args into a inparams structure
                 ManagementBaseObject inParameters;
@@ -2195,7 +2196,7 @@ namespace System.Management
             string methodName,
             object[] args)
         {
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
             else if (null == watcher)
                 throw new ArgumentNullException(nameof(watcher));
@@ -2203,13 +2204,13 @@ namespace System.Management
                 throw new ArgumentNullException(nameof(methodName));
             else
             {
-                Initialize ( false );
+                Initialize(false);
 
                 // Map args into a inparams structure
                 ManagementBaseObject inParameters;
                 IWbemClassObjectFreeThreaded inParametersClass, outParametersClass;
                 GetMethodParameters(methodName, out inParameters,
-                    out inParametersClass,    out outParametersClass);
+                    out inParametersClass, out outParametersClass);
 
                 MapInParameters(args, inParameters, inParametersClass);
 
@@ -2296,18 +2297,18 @@ namespace System.Management
         {
             ManagementBaseObject outParameters = null;
 
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
             else if (null == methodName)
                 throw new ArgumentNullException(nameof(methodName));
             else
             {
-                Initialize ( false );
+                Initialize(false);
                 InvokeMethodOptions o = (null != options) ? options : new InvokeMethodOptions();
                 IWbemServices wbemServices = scope.GetIWbemServices();
 
                 SecurityHandler securityHandler = null;
-                int status                        = (int)ManagementStatus.NoError;
+                int status = (int)ManagementStatus.NoError;
 
                 try
                 {
@@ -2316,7 +2317,7 @@ namespace System.Management
                     IWbemClassObjectFreeThreaded inParams = (null == inParameters) ? null : inParameters.wbemObject;
                     IWbemClassObjectFreeThreaded outParams = null;
 
-                    status = scope.GetSecuredIWbemServicesHandler( scope.GetIWbemServices() ).ExecMethod_(
+                    status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices()).ExecMethod_(
                         path.RelativePath,
                         methodName,
                         o.Flags,
@@ -2364,7 +2365,7 @@ namespace System.Management
             ManagementBaseObject inParameters,
             InvokeMethodOptions options)
         {
-            if ((null == path) || (path.Path.Length==0))
+            if ((null == path) || (path.Path.Length == 0))
                 throw new InvalidOperationException();
             else if (null == watcher)
                 throw new ArgumentNullException(nameof(watcher));
@@ -2372,9 +2373,9 @@ namespace System.Management
                 throw new ArgumentNullException(nameof(methodName));
             else
             {
-                Initialize ( false );
+                Initialize(false);
                 InvokeMethodOptions o = (null != options) ?
-                    (InvokeMethodOptions) options.Clone() : new InvokeMethodOptions();
+                    (InvokeMethodOptions)options.Clone() : new InvokeMethodOptions();
 
                 // If someone has registered for progress, make sure we flag it
                 if (watcher.HaveListenersForProgress)
@@ -2383,7 +2384,7 @@ namespace System.Management
                 WmiEventSink sink = watcher.GetNewSink(scope, o.Context);
 
                 SecurityHandler securityHandler = null;
-                int status                        = (int)ManagementStatus.NoError;
+                int status = (int)ManagementStatus.NoError;
 
                 securityHandler = scope.GetSecurityHandler();
 
@@ -2392,13 +2393,13 @@ namespace System.Management
                 if (null != inParameters)
                     inParams = inParameters.wbemObject;
 
-                status = scope.GetSecuredIWbemServicesHandler( scope.GetIWbemServices() ).ExecMethodAsync_(
+                status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices()).ExecMethodAsync_(
                     path.RelativePath,
                     methodName,
                     o.Flags,
                     o.GetContext(),
                     inParams,
-                    sink.Stub );
+                    sink.Stub);
 
                 if (securityHandler != null)
                     securityHandler.Reset();
@@ -2454,7 +2455,7 @@ namespace System.Management
                 throw new ArgumentNullException(nameof(methodName));
             else
             {
-                Initialize ( false );
+                Initialize(false);
 
                 // Do we have the class?
                 if (null == wmiClass)
@@ -2559,7 +2560,7 @@ namespace System.Management
         // The prototype of Initialize has been changed to accept a bool, indicating whether or not
         // the caller wants to bind to the underlying WMI object in the Initialize call or not.
         //
-        internal override void Initialize( bool getObject )
+        internal override void Initialize(bool getObject)
         {
             bool needToGetObject = false;
 
@@ -2580,7 +2581,7 @@ namespace System.Management
                 }
 
                 //Have we already got this object
-                if (!IsBound && ( getObject == true ) )
+                if (!IsBound && (getObject == true))
                     needToGetObject = true;
 
                 if (null == scope)
@@ -2620,7 +2621,7 @@ namespace System.Management
                         scope.Initialize();
 
                         // If we have just connected, make sure we get the object
-                        if ( getObject == true )
+                        if (getObject == true)
                         {
                             needToGetObject = true;
                         }
@@ -2642,7 +2643,7 @@ namespace System.Management
                         IWbemServices wbemServices = scope.GetIWbemServices();
 
                         SecurityHandler securityHandler = null;
-                        int status                        = (int)ManagementStatus.NoError;
+                        int status = (int)ManagementStatus.NoError;
 
                         try
                         {
@@ -2651,9 +2652,9 @@ namespace System.Management
                             string objectPath = null;
                             string curPath = path.RelativePath;
 
-                            if (curPath.Length>0)
+                            if (curPath.Length > 0)
                                 objectPath = curPath;
-                            status = scope.GetSecuredIWbemServicesHandler( wbemServices ).GetObject_(objectPath, options.Flags, options.GetContext(), ref tempObj, IntPtr.Zero);
+                            status = scope.GetSecuredIWbemServicesHandler(wbemServices).GetObject_(objectPath, options.Flags, options.GetContext(), ref tempObj, IntPtr.Zero);
 
                             if (status >= 0)
                             {
@@ -2674,7 +2675,7 @@ namespace System.Management
 
                                 if (status >= 0)
                                 {
-                                    path = (System.DBNull.Value != val) ? (new ManagementPath((string)val)) : (new ManagementPath ());
+                                    path = (System.DBNull.Value != val) ? (new ManagementPath((string)val)) : (new ManagementPath());
                                     path.IdentifierChanged += new IdentifierChangedEventHandler(HandleIdentifierChange);
                                 }
                             }
@@ -2699,7 +2700,7 @@ namespace System.Management
 
 
         private static void MapInParameters(
-            object [] args,
+            object[] args,
             ManagementBaseObject inParams,
             IWbemClassObjectFreeThreaded inParamsClass)
         {
@@ -2727,9 +2728,9 @@ namespace System.Management
                     {
                         while (true)
                         {
-                            object                          val = null;
-                            int                              dummy = 0;
-                            string                          propertyName = null;
+                            object val = null;
+                            int dummy = 0;
+                            string propertyName = null;
                             IWbemQualifierSetFreeThreaded qualifierSet = null;
 
                             status = inParamsClass.Next_(0, ref propertyName, ref val, ref dummy, ref dummy);
@@ -2751,7 +2752,7 @@ namespace System.Management
                                         // If the id is in range, map the value into the args array
                                         int idIndex = (int)id;
                                         if ((0 <= idIndex) && (topId >= idIndex))
-                                            inParams[propertyName] = args [minIndex + idIndex];
+                                            inParams[propertyName] = args[minIndex + idIndex];
                                     }
                                     finally
                                     {
@@ -2780,7 +2781,7 @@ namespace System.Management
         }
 
         private static object MapOutParameters(
-            object [] args,
+            object[] args,
             ManagementBaseObject outParams,
             IWbemClassObjectFreeThreaded outParamsClass)
         {
@@ -2811,9 +2812,9 @@ namespace System.Management
                 {
                     while (true)
                     {
-                        object                          val = null;
-                        int                              dummy = 0;
-                        string                          propertyName = null;
+                        object val = null;
+                        int dummy = 0;
+                        string propertyName = null;
                         IWbemQualifierSetFreeThreaded qualifierSet = null;
 
                         status = outParamsClass.Next_(0, ref propertyName, ref val, ref dummy, ref dummy);
@@ -2842,7 +2843,7 @@ namespace System.Management
                                         // If the id is in range, map the value into the args array
                                         int idIndex = (int)id;
                                         if ((0 <= idIndex) && (topId >= idIndex))
-                                            args [minIndex + idIndex] = outParams[propertyName];
+                                            args[minIndex + idIndex] = outParams[propertyName];
                                     }
                                     finally
                                     {
index b6a5967..047f728 100644 (file)
@@ -73,12 +73,12 @@ namespace System.Management
             IEnumWbemClassObject enumWbem)
         {
             if (null != options)
-                this.options = (EnumerationOptions) options.Clone();
+                this.options = (EnumerationOptions)options.Clone();
             else
-                this.options = new EnumerationOptions ();
+                this.options = new EnumerationOptions();
 
             if (null != scope)
-                this.scope = (ManagementScope)scope.Clone ();
+                this.scope = (ManagementScope)scope.Clone();
             else
                 this.scope = ManagementScope._Clone(null);
 
@@ -88,9 +88,9 @@ namespace System.Management
         /// <summary>
         /// <para>Disposes of resources the object is holding. This is the destructor for the object.</para>
         /// </summary>
-        ~ManagementObjectCollection ()
+        ~ManagementObjectCollection()
         {
-            Dispose ( false );
+            Dispose(false);
         }
 
         /// <summary>
@@ -98,22 +98,22 @@ namespace System.Management
         /// method has been called, an attempt to use this object will
         /// result in an ObjectDisposedException being thrown.
         /// </summary>
-        public void Dispose ()
+        public void Dispose()
         {
             if (!isDisposed)
             {
-                Dispose ( true );
+                Dispose(true);
             }
         }
 
-        private void Dispose ( bool disposing )
+        private void Dispose(bool disposing)
         {
-            if ( disposing )
+            if (disposing)
             {
-                GC.SuppressFinalize (this);
+                GC.SuppressFinalize(this);
                 isDisposed = true;
             }
-            Marshal.ReleaseComObject (enumWbem);
+            Marshal.ReleaseComObject(enumWbem);
         }
 
 
@@ -145,8 +145,8 @@ namespace System.Management
                 //
                 int count = 0;
 
-                IEnumerator enumCol = this.GetEnumerator ( );
-                while ( enumCol.MoveNext() == true )
+                IEnumerator enumCol = this.GetEnumerator();
+                while (enumCol.MoveNext() == true)
                 {
                     count++;
                 }
@@ -197,16 +197,16 @@ namespace System.Management
         /// </summary>
         /// <param name='array'>An array to copy to. </param>
         /// <param name='index'>The index to start from. </param>
-        public void CopyTo (Array array, int index)
+        public void CopyTo(Array array, int index)
         {
             if (isDisposed)
                 throw new ObjectDisposedException(name);
 
             if (null == array)
-                throw new ArgumentNullException (nameof(array));
+                throw new ArgumentNullException(nameof(array));
 
-            if ((index < array.GetLowerBound (0)) || (index > array.GetUpperBound(0)))
-                throw new ArgumentOutOfRangeException (nameof(index));
+            if ((index < array.GetLowerBound(0)) || (index > array.GetUpperBound(0)))
+                throw new ArgumentOutOfRangeException(nameof(index));
 
             // Since we don't know the size until we've enumerated
             // we'll have to dump the objects in a list first then
@@ -214,7 +214,7 @@ namespace System.Management
 
             int capacity = array.Length - index;
             int numObjects = 0;
-            ArrayList arrList = new ArrayList ();
+            ArrayList arrList = new ArrayList();
 
             ManagementObjectEnumerator en = this.GetEnumerator();
             ManagementBaseObject obj;
@@ -227,11 +227,11 @@ namespace System.Management
                 numObjects++;
 
                 if (numObjects > capacity)
-                    throw new ArgumentException (null, nameof(index));
+                    throw new ArgumentException(null, nameof(index));
             }
 
             // If we get here we are OK. Now copy the list to the array
-            arrList.CopyTo (array, index);
+            arrList.CopyTo(array, index);
 
             return;
         }
@@ -242,9 +242,9 @@ namespace System.Management
         /// </summary>
         /// <param name='objectCollection'>The target array.</param>
         /// <param name=' index'>The index to start from.</param>
-        public void CopyTo (ManagementBaseObject[] objectCollection, int index)
+        public void CopyTo(ManagementBaseObject[] objectCollection, int index)
         {
-            CopyTo ((Array)objectCollection, index);
+            CopyTo((Array)objectCollection, index);
         }
 
         //
@@ -288,25 +288,25 @@ namespace System.Management
 
             // Unless this is the first enumerator, we have
             // to clone. This may throw if we are non-rewindable.
-            if ( this.options.Rewindable == true )
+            if (this.options.Rewindable == true)
             {
                 IEnumWbemClassObject enumWbemClone = null;
                 int status = (int)ManagementStatus.NoError;
 
                 try
                 {
-                    status = scope.GetSecuredIEnumWbemClassObjectHandler(enumWbem ).Clone_( ref enumWbemClone);
+                    status = scope.GetSecuredIEnumWbemClassObjectHandler(enumWbem).Clone_(ref enumWbemClone);
 
                     if ((status & 0x80000000) == 0)
                     {
                         //since the original enumerator might not be reset, we need
                         //to reset the new one.
-                        status = scope.GetSecuredIEnumWbemClassObjectHandler(enumWbemClone ).Reset_( );
+                        status = scope.GetSecuredIEnumWbemClassObjectHandler(enumWbemClone).Reset_();
                     }
                 }
                 catch (COMException e)
                 {
-                    ManagementException.ThrowWithExtendedInfo (e);
+                    ManagementException.ThrowWithExtendedInfo(e);
                 }
 
                 if ((status & 0xfffff000) == 0x80041000)
@@ -317,7 +317,7 @@ namespace System.Management
                 {
                     Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
                 }
-                return new ManagementObjectEnumerator (this, enumWbemClone);
+                return new ManagementObjectEnumerator(this, enumWbemClone);
             }
             else
             {
@@ -342,7 +342,7 @@ namespace System.Management
         /// </returns>
         IEnumerator IEnumerable.GetEnumerator()
         {
-            return GetEnumerator ();
+            return GetEnumerator();
         }
 
 
@@ -426,9 +426,9 @@ namespace System.Management
             /// <summary>
             /// <para>Disposes of resources the object is holding. This is the destructor for the object.</para>
             /// </summary>
-            ~ManagementObjectEnumerator ()
+            ~ManagementObjectEnumerator()
             {
-                Dispose ();
+                Dispose();
             }
 
 
@@ -437,13 +437,13 @@ namespace System.Management
             /// method has been called, an attempt to use this object will
             /// result in an ObjectDisposedException being thrown.
             /// </summary>
-            public void Dispose ()
+            public void Dispose()
             {
                 if (!isDisposed)
                 {
                     if (null != enumWbem)
                     {
-                        Marshal.ReleaseComObject (enumWbem);
+                        Marshal.ReleaseComObject(enumWbem);
                         enumWbem = null;
                     }
 
@@ -457,7 +457,7 @@ namespace System.Management
 
                     isDisposed = true;
 
-                    GC.SuppressFinalize (this);
+                    GC.SuppressFinalize(this);
                 }
             }
 
@@ -479,7 +479,7 @@ namespace System.Management
                     if (cacheIndex < 0)
                         throw new InvalidOperationException();
 
-                    return ManagementBaseObject.GetBaseObject (cachedObjects[cacheIndex],
+                    return ManagementBaseObject.GetBaseObject(cachedObjects[cacheIndex],
                         collectionObject.scope);
                 }
             }
@@ -511,7 +511,7 @@ namespace System.Management
             ///    successfully advanced to the next element; <see langword='false'/> if the enumerator has
             ///    passed the end of the collection.</para>
             /// </returns>
-            public bool MoveNext ()
+            public bool MoveNext()
             {
                 if (isDisposed)
                     throw new ObjectDisposedException(name);
@@ -538,7 +538,7 @@ namespace System.Management
                     //counterparts afterwards.
                     IWbemClassObject_DoNotMarshal[] tempArray = new IWbemClassObject_DoNotMarshal[collectionObject.options.BlockSize];
 
-                    int status = collectionObject.scope.GetSecuredIEnumWbemClassObjectHandler(enumWbem ).Next_(timeout, (uint)collectionObject.options.BlockSize, tempArray, ref cachedCount);
+                    int status = collectionObject.scope.GetSecuredIEnumWbemClassObjectHandler(enumWbem).Next_(timeout, (uint)collectionObject.options.BlockSize, tempArray, ref cachedCount);
 
                     securityHandler.Reset();
 
@@ -596,7 +596,7 @@ namespace System.Management
             /// <summary>
             ///    <para>Resets the enumerator to the beginning of the collection.</para>
             /// </summary>
-            public void Reset ()
+            public void Reset()
             {
                 if (isDisposed)
                     throw new ObjectDisposedException(name);
@@ -616,11 +616,11 @@ namespace System.Management
                     }
                     catch (COMException e)
                     {
-                        ManagementException.ThrowWithExtendedInfo (e);
+                        ManagementException.ThrowWithExtendedInfo(e);
                     }
                     finally
                     {
-                        securityHandler.Reset ();
+                        securityHandler.Reset();
                     }
 
                     if ((status & 0xfffff000) == 0x80041000)
@@ -633,7 +633,7 @@ namespace System.Management
                     }
 
                     //Flush the current enumeration cache
-                    for (int i=(cacheIndex >= 0 ? cacheIndex : 0); i<cachedCount; i++)
+                    for (int i = (cacheIndex >= 0 ? cacheIndex : 0); i < cachedCount; i++)
                         Marshal.ReleaseComObject((IWbemClassObject_DoNotMarshal)(Marshal.GetObjectForIUnknown(cachedObjects[i])));
 
                     cachedCount = 0;
index 201a4f2..f0576e7 100644 (file)
@@ -84,7 +84,7 @@ namespace System.Management
         ///    <code lang='VB'>Dim s As New ManagementObjectSearcher()
         ///    </code>
         /// </example>
-        public ManagementObjectSearcher() : this((ManagementScope)null, null, null) {}
+        public ManagementObjectSearcher() : this((ManagementScope)null, null, null) { }
 
         //parameterized constructors
         /// <summary>
@@ -99,7 +99,7 @@ namespace System.Management
         ///    <code lang='VB'>Dim s As New ManagementObjectSearcher("SELECT * FROM Win32_Service")
         ///    </code>
         /// </example>
-        public ManagementObjectSearcher(string queryString) : this(null, new ObjectQuery(queryString), null) {}
+        public ManagementObjectSearcher(string queryString) : this(null, new ObjectQuery(queryString), null) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementObjectSearcher'/> class used to invoke the
@@ -114,7 +114,7 @@ namespace System.Management
         /// Dim s As New ManagementObjectSearcher(q)
         ///    </code>
         /// </example>
-        public ManagementObjectSearcher(ObjectQuery query) : this (null, query, null) {}
+        public ManagementObjectSearcher(ObjectQuery query) : this(null, query, null) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementObjectSearcher'/> class used to invoke the
@@ -136,7 +136,8 @@ namespace System.Management
         ///    </code>
         /// </example>
         public ManagementObjectSearcher(string scope, string queryString) :
-            this(new ManagementScope(scope), new ObjectQuery(queryString), null) {}
+            this(new ManagementScope(scope), new ObjectQuery(queryString), null)
+        { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementObjectSearcher'/> class used to invoke the
@@ -158,7 +159,7 @@ namespace System.Management
         /// Dim s As New ManagementObjectSearcher(myScope,q)
         ///    </code>
         /// </example>
-        public ManagementObjectSearcher(ManagementScope scope, ObjectQuery query) : this(scope, query, null) {}
+        public ManagementObjectSearcher(ManagementScope scope, ObjectQuery query) : this(scope, query, null) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementObjectSearcher'/> class used to invoke the specified
@@ -180,7 +181,8 @@ namespace System.Management
         ///    </code>
         /// </example>
         public ManagementObjectSearcher(string scope, string queryString, EnumerationOptions options) :
-            this(new ManagementScope(scope), new ObjectQuery(queryString), options) {}
+            this(new ManagementScope(scope), new ObjectQuery(queryString), options)
+        { }
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementObjectSearcher'/> class to be
         ///    used to invoke the specified query in the specified scope, with the specified
@@ -250,9 +252,9 @@ namespace System.Management
             set
             {
                 if (null != value)
-                    scope = (ManagementScope) value.Clone ();
+                    scope = (ManagementScope)value.Clone();
                 else
-                    throw new ArgumentNullException (nameof(value));
+                    throw new ArgumentNullException(nameof(value));
             }
         }
 
@@ -276,9 +278,9 @@ namespace System.Management
             set
             {
                 if (null != value)
-                    query = (ObjectQuery)value.Clone ();
+                    query = (ObjectQuery)value.Clone();
                 else
-                    throw new ArgumentNullException (nameof(value));
+                    throw new ArgumentNullException(nameof(value));
             }
         }
 
@@ -297,7 +299,7 @@ namespace System.Management
             set
             {
                 if (null != value)
-                    options = (EnumerationOptions) value.Clone ();
+                    options = (EnumerationOptions)value.Clone();
                 else
                     throw new ArgumentNullException(nameof(value));
             }
@@ -319,7 +321,7 @@ namespace System.Management
         /// </returns>
         public ManagementObjectCollection Get()
         {
-            Initialize ();
+            Initialize();
             IEnumWbemClassObject ew = null;
             SecurityHandler securityHandler = scope.GetSecurityHandler();
             EnumerationOptions enumOptions = (EnumerationOptions)options.Clone();
@@ -342,7 +344,7 @@ namespace System.Management
 
                     if (((SelectQuery)query).IsSchemaQuery == false) //deep instance enumeration
                     {
-                        status = scope.GetSecuredIWbemServicesHandler( scope.GetIWbemServices()  ).CreateInstanceEnum_(
+                        status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices()).CreateInstanceEnum_(
                             ((SelectQuery)query).ClassName,
                             enumOptions.Flags,
                             enumOptions.GetContext(),
@@ -350,22 +352,22 @@ namespace System.Management
                     }
                     else //deep class enumeration
                     {
-                        status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices() ).CreateClassEnum_(((SelectQuery)query).ClassName,
+                        status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices()).CreateClassEnum_(((SelectQuery)query).ClassName,
                             enumOptions.Flags,
                             enumOptions.GetContext(),
-                            ref ew );
+                            ref ew);
                     }
                 }
                 else //we can use ExecQuery
                 {
                     //Make sure the EnumerateDeep flag bit is turned off because it's invalid for queries
                     enumOptions.EnumerateDeep = true;
-                    status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices() ).ExecQuery_(
+                    status = scope.GetSecuredIWbemServicesHandler(scope.GetIWbemServices()).ExecQuery_(
                         query.QueryLanguage,
                         query.QueryString,
                         enumOptions.Flags,
                         enumOptions.GetContext(),
-                        ref ew );
+                        ref ew);
                 }
             }
             catch (COMException e)
@@ -402,10 +404,10 @@ namespace System.Management
         public void Get(ManagementOperationObserver watcher)
         {
             if (null == watcher)
-                throw new ArgumentNullException (nameof(watcher));
+                throw new ArgumentNullException(nameof(watcher));
 
-            Initialize ();
-            IWbemServices wbemServices = scope.GetIWbemServices ();
+            Initialize();
+            IWbemServices wbemServices = scope.GetIWbemServices();
 
             EnumerationOptions enumOptions = (EnumerationOptions)options.Clone();
             // Ensure we switch off ReturnImmediately as this is invalid for async calls
@@ -414,7 +416,7 @@ namespace System.Management
             if (watcher.HaveListenersForProgress)
                 enumOptions.SendStatus = true;
 
-            WmiEventSink sink = watcher.GetNewSink (scope, enumOptions.Context);
+            WmiEventSink sink = watcher.GetNewSink(scope, enumOptions.Context);
             SecurityHandler securityHandler = scope.GetSecurityHandler();
 
             int status = (int)ManagementStatus.NoError;
@@ -435,14 +437,14 @@ namespace System.Management
 
                     if (((SelectQuery)query).IsSchemaQuery == false) //deep instance enumeration
                     {
-                        status = scope.GetSecuredIWbemServicesHandler( wbemServices ).CreateInstanceEnumAsync_(((SelectQuery)query).ClassName,
+                        status = scope.GetSecuredIWbemServicesHandler(wbemServices).CreateInstanceEnumAsync_(((SelectQuery)query).ClassName,
                             enumOptions.Flags,
                             enumOptions.GetContext(),
                             sink.Stub);
                     }
                     else
                     {
-                        status = scope.GetSecuredIWbemServicesHandler( wbemServices ).CreateClassEnumAsync_(((SelectQuery)query).ClassName,
+                        status = scope.GetSecuredIWbemServicesHandler(wbemServices).CreateClassEnumAsync_(((SelectQuery)query).ClassName,
                             enumOptions.Flags,
                             enumOptions.GetContext(),
                             sink.Stub);
@@ -452,7 +454,7 @@ namespace System.Management
                 {
                     //Make sure the EnumerateDeep flag bit is turned off because it's invalid for queries
                     enumOptions.EnumerateDeep = true;
-                    status = scope.GetSecuredIWbemServicesHandler( wbemServices ).ExecQueryAsync_(
+                    status = scope.GetSecuredIWbemServicesHandler(wbemServices).ExecQueryAsync_(
                         query.QueryLanguage,
                         query.QueryString,
                         enumOptions.Flags,
@@ -463,8 +465,8 @@ namespace System.Management
             }
             catch (COMException e)
             {
-                watcher.RemoveSink (sink);
-                ManagementException.ThrowWithExtendedInfo (e);
+                watcher.RemoveSink(sink);
+                ManagementException.ThrowWithExtendedInfo(e);
             }
             finally
             {
index 2999278..1a423bc 100644 (file)
@@ -16,12 +16,12 @@ namespace System.Management
     /// <summary>
     /// <para>Represents the method that will handle the <see cref='System.Management.ManagementOperationObserver.Completed'/> event.</para>
     /// </summary>
-    public delegate void CompletedEventHandler (object sender, CompletedEventArgs e);
+    public delegate void CompletedEventHandler(object sender, CompletedEventArgs e);
 
     /// <summary>
     /// <para>Represents the method that will handle the <see cref='System.Management.ManagementOperationObserver.Progress'/> event.</para>
     /// </summary>
-    public delegate void ProgressEventHandler (object sender, ProgressEventArgs e);
+    public delegate void ProgressEventHandler(object sender, ProgressEventArgs e);
 
     /// <summary>
     /// <para>Represents the method that will handle the <see cref='System.Management.ManagementOperationObserver.ObjectPut'/> event.</para>
@@ -131,41 +131,41 @@ namespace System.Management
         /// <summary>
         ///    <para> Occurs when a new object is available.</para>
         /// </summary>
-        public event ObjectReadyEventHandler        ObjectReady;
+        public event ObjectReadyEventHandler ObjectReady;
 
         /// <summary>
         ///    <para> Occurs when an operation has completed.</para>
         /// </summary>
-        public event CompletedEventHandler          Completed;
+        public event CompletedEventHandler Completed;
 
         /// <summary>
         ///    <para> Occurs to indicate the progress of an ongoing operation.</para>
         /// </summary>
-        public event ProgressEventHandler           Progress;
+        public event ProgressEventHandler Progress;
 
         /// <summary>
         ///    <para> Occurs when an object has been successfully committed.</para>
         /// </summary>
-        public event ObjectPutEventHandler          ObjectPut;
+        public event ObjectPutEventHandler ObjectPut;
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementOperationObserver'/> class. This is the default constructor.</para>
         /// </summary>
-        public ManagementOperationObserver ()
+        public ManagementOperationObserver()
         {
             // We make our sink collection synchronized
-            m_sinkCollection = new Hashtable ();
-            delegateInvoker = new WmiDelegateInvoker (this);
+            m_sinkCollection = new Hashtable();
+            delegateInvoker = new WmiDelegateInvoker(this);
         }
 
         /// <summary>
         ///    <para> Cancels all outstanding operations.</para>
         /// </summary>
-        public void Cancel ()
+        public void Cancel()
         {
             // Cancel all the sinks we have - make a copy to avoid things
             // changing under our feet
-            Hashtable copiedSinkTable =  new Hashtable ();
+            Hashtable copiedSinkTable = new Hashtable();
 
             lock (m_sinkCollection)
             {
@@ -173,12 +173,12 @@ namespace System.Management
 
                 try
                 {
-                    sinkEnum.Reset ();
+                    sinkEnum.Reset();
 
-                    while (sinkEnum.MoveNext ())
+                    while (sinkEnum.MoveNext())
                     {
-                        DictionaryEntry entry = (DictionaryEntry) sinkEnum.Current;
-                        copiedSinkTable.Add (entry.Key, entry.Value);
+                        DictionaryEntry entry = (DictionaryEntry)sinkEnum.Current;
+                        copiedSinkTable.Add(entry.Key, entry.Value);
                     }
                 }
                 catch
@@ -190,16 +190,16 @@ namespace System.Management
             try
             {
                 IDictionaryEnumerator copiedSinkEnum = copiedSinkTable.GetEnumerator();
-                copiedSinkEnum.Reset ();
+                copiedSinkEnum.Reset();
 
-                while (copiedSinkEnum.MoveNext ())
+                while (copiedSinkEnum.MoveNext())
                 {
-                    DictionaryEntry entry = (DictionaryEntry) copiedSinkEnum.Current;
-                    WmiEventSink eventSink = (WmiEventSink) entry.Value;
+                    DictionaryEntry entry = (DictionaryEntry)copiedSinkEnum.Current;
+                    WmiEventSink eventSink = (WmiEventSink)entry.Value;
 
                     try
                     {
-                        eventSink.Cancel ();
+                        eventSink.Cancel();
                     }
                     catch
                     {
@@ -211,7 +211,7 @@ namespace System.Management
             }
         }
 
-        internal WmiEventSink GetNewSink (
+        internal WmiEventSink GetNewSink(
             ManagementScope scope,
             object context)
         {
@@ -222,7 +222,7 @@ namespace System.Management
                 // Add it to our collection
                 lock (m_sinkCollection)
                 {
-                    m_sinkCollection.Add (eventSink.GetHashCode(), eventSink);
+                    m_sinkCollection.Add(eventSink.GetHashCode(), eventSink);
                 }
 
                 return eventSink;
@@ -242,7 +242,7 @@ namespace System.Management
                 try
                 {
                     if (Progress != null)
-                        result = ((Progress.GetInvocationList ()).Length > 0);
+                        result = ((Progress.GetInvocationList()).Length > 0);
                 }
                 catch
                 {
@@ -251,7 +251,7 @@ namespace System.Management
                 return result;
             }
         }
-        internal WmiEventSink GetNewPutSink (
+        internal WmiEventSink GetNewPutSink(
             ManagementScope scope,
             object context,
             string path,
@@ -264,7 +264,7 @@ namespace System.Management
                 // Add it to our collection
                 lock (m_sinkCollection)
                 {
-                    m_sinkCollection.Add (eventSink.GetHashCode(), eventSink);
+                    m_sinkCollection.Add(eventSink.GetHashCode(), eventSink);
                 }
 
                 return eventSink;
@@ -275,7 +275,7 @@ namespace System.Management
             }
         }
 
-        internal WmiGetEventSink GetNewGetSink (
+        internal WmiGetEventSink GetNewGetSink(
             ManagementScope scope,
             object context,
             ManagementObject managementObject)
@@ -288,7 +288,7 @@ namespace System.Management
                 // Add it to our collection
                 lock (m_sinkCollection)
                 {
-                    m_sinkCollection.Add (eventSink.GetHashCode(), eventSink);
+                    m_sinkCollection.Add(eventSink.GetHashCode(), eventSink);
                 }
 
                 return eventSink;
@@ -299,17 +299,17 @@ namespace System.Management
             }
         }
 
-        internal void RemoveSink (WmiEventSink eventSink)
+        internal void RemoveSink(WmiEventSink eventSink)
         {
             try
             {
                 lock (m_sinkCollection)
                 {
-                    m_sinkCollection.Remove (eventSink.GetHashCode ());
+                    m_sinkCollection.Remove(eventSink.GetHashCode());
                 }
 
                 // Release the stub as we are now disconnected
-                eventSink.ReleaseStub ();
+                eventSink.ReleaseStub();
             }
             catch
             {
@@ -320,44 +320,44 @@ namespace System.Management
         /// Fires the ObjectReady event to whomsoever is listening
         /// </summary>
         /// <param name="args"> </param>
-        internal void FireObjectReady (ObjectReadyEventArgs args)
+        internal void FireObjectReady(ObjectReadyEventArgs args)
         {
             try
             {
-                delegateInvoker.FireEventToDelegates (ObjectReady, args);
+                delegateInvoker.FireEventToDelegates(ObjectReady, args);
             }
             catch
             {
             }
         }
 
-        internal void FireCompleted (CompletedEventArgs args)
+        internal void FireCompleted(CompletedEventArgs args)
         {
             try
             {
-                delegateInvoker.FireEventToDelegates (Completed, args);
+                delegateInvoker.FireEventToDelegates(Completed, args);
             }
             catch
             {
             }
         }
 
-        internal void FireProgress (ProgressEventArgs args)
+        internal void FireProgress(ProgressEventArgs args)
         {
             try
             {
-                delegateInvoker.FireEventToDelegates (Progress, args);
+                delegateInvoker.FireEventToDelegates(Progress, args);
             }
             catch
             {
             }
         }
 
-        internal void FireObjectPut (ObjectPutEventArgs args)
+        internal void FireObjectPut(ObjectPutEventArgs args)
         {
             try
             {
-                delegateInvoker.FireEventToDelegates (ObjectPut, args);
+                delegateInvoker.FireEventToDelegates(ObjectPut, args);
             }
             catch
             {
@@ -371,7 +371,7 @@ namespace System.Management
         private readonly ManagementEventArgs args;
         private readonly AutoResetEvent h;
 
-        internal WmiEventState (Delegate d, ManagementEventArgs args, AutoResetEvent h)
+        internal WmiEventState(Delegate d, ManagementEventArgs args, AutoResetEvent h)
         {
             this.d = d;
             this.args = args;
@@ -407,7 +407,7 @@ namespace System.Management
     {
         internal object sender;
 
-        internal WmiDelegateInvoker (object sender)
+        internal WmiDelegateInvoker(object sender)
         {
             this.sender = sender;
         }
@@ -419,7 +419,7 @@ namespace System.Management
         /// <param name="md">The MulticastDelegate representing the collection
         /// of targets for the event</param>
         /// <param name="args">The accompanying event arguments</param>
-        internal void FireEventToDelegates (MulticastDelegate md, ManagementEventArgs args)
+        internal void FireEventToDelegates(MulticastDelegate md, ManagementEventArgs args)
         {
             try
             {
@@ -429,7 +429,7 @@ namespace System.Management
                     {
                         try
                         {
-                            d.DynamicInvoke (new object [] {this.sender, args});
+                            d.DynamicInvoke(new object[] { this.sender, args });
                         }
                         catch
                         {
index 834cad1..16012de 100644 (file)
@@ -15,35 +15,35 @@ namespace System.Management
         /// <summary>
         ///    <para>The default COM authentication level. WMI uses the default Windows Authentication setting.</para>
         /// </summary>
-        Default=0,
+        Default = 0,
         /// <summary>
         ///    <para> No COM authentication.</para>
         /// </summary>
-        None=1,
+        None = 1,
         /// <summary>
         ///    <para> Connect-level COM authentication.</para>
         /// </summary>
-        Connect=2,
+        Connect = 2,
         /// <summary>
         ///    <para> Call-level COM authentication.</para>
         /// </summary>
-        Call=3,
+        Call = 3,
         /// <summary>
         ///    <para> Packet-level COM authentication.</para>
         /// </summary>
-        Packet=4,
+        Packet = 4,
         /// <summary>
         ///    <para>Packet Integrity-level COM authentication.</para>
         /// </summary>
-        PacketIntegrity=5,
+        PacketIntegrity = 5,
         /// <summary>
         ///    <para>Packet Privacy-level COM authentication.</para>
         /// </summary>
-        PacketPrivacy=6,
+        PacketPrivacy = 6,
         /// <summary>
         ///    <para>The default COM authentication level. WMI uses the default Windows Authentication setting.</para>
         /// </summary>
-        Unchanged=-1
+        Unchanged = -1
     }
 
     /// <summary>
@@ -54,31 +54,31 @@ namespace System.Management
         /// <summary>
         ///    <para>Default impersonation.</para>
         /// </summary>
-        Default=0,
+        Default = 0,
         /// <summary>
         ///    <para> Anonymous COM impersonation level that hides the
         ///       identity of the caller. Calls to WMI may fail
         ///       with this impersonation level.</para>
         /// </summary>
-        Anonymous=1,
+        Anonymous = 1,
         /// <summary>
         ///    <para> Identify-level COM impersonation level that allows objects
         ///       to query the credentials of the caller. Calls to
         ///       WMI may fail with this impersonation level.</para>
         /// </summary>
-        Identify=2,
+        Identify = 2,
         /// <summary>
         ///    <para> Impersonate-level COM impersonation level that allows
         ///       objects to use the credentials of the caller. This is the recommended impersonation level for WMI calls.</para>
         /// </summary>
-        Impersonate=3,
+        Impersonate = 3,
         /// <summary>
         ///    <para> Delegate-level COM impersonation level that allows objects
         ///       to permit other objects to use the credentials of the caller. This
         ///       level, which will work with WMI calls but may constitute an unnecessary
         ///       security risk, is supported only under Windows 2000.</para>
         /// </summary>
-        Delegate=4
+        Delegate = 4
     }
 
     /// <summary>
@@ -95,17 +95,17 @@ namespace System.Management
         ///    <para> Updates an existing object
         ///       only; does not create a new object.</para>
         /// </summary>
-        UpdateOnly=1,
+        UpdateOnly = 1,
         /// <summary>
         ///    <para> Creates an object only;
         ///       does not update an existing object.</para>
         /// </summary>
-        CreateOnly=2,
+        CreateOnly = 2,
         /// <summary>
         ///    <para> Saves the object, whether
         ///       updating an existing object or creating a new object.</para>
         /// </summary>
-        UpdateOrCreate=3
+        UpdateOrCreate = 3
     }
 
     //CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC//
@@ -149,7 +149,8 @@ namespace System.Management
             FireIdentifierChanged();
         }
 
-        internal int Flags {
+        internal int Flags
+        {
             get { return flags; }
             set { flags = value; }
         }
@@ -177,9 +178,9 @@ namespace System.Management
                 ManagementNamedValueCollection oldContext = context;
 
                 if (null != value)
-                    context = (ManagementNamedValueCollection) value.Clone();
+                    context = (ManagementNamedValueCollection)value.Clone();
                 else
-                    context = new ManagementNamedValueCollection ();
+                    context = new ManagementNamedValueCollection();
 
                 if (null != oldContext)
                     oldContext.IdentifierChanged -= new IdentifierChangedEventHandler(HandleIdentifierChange);
@@ -221,8 +222,8 @@ namespace System.Management
         }
 
 
-        internal ManagementOptions() : this(null, InfiniteTimeout) {}
-        internal ManagementOptions(ManagementNamedValueCollection context, TimeSpan timeout) : this(context, timeout, 0) {}
+        internal ManagementOptions() : this(null, InfiniteTimeout) { }
+        internal ManagementOptions(ManagementNamedValueCollection context, TimeSpan timeout) : this(context, timeout, 0) { }
         internal ManagementOptions(ManagementNamedValueCollection context, TimeSpan timeout, int flags)
         {
             this.flags = flags;
@@ -234,7 +235,8 @@ namespace System.Management
         }
 
 
-        internal IWbemContext GetContext () {
+        internal IWbemContext GetContext()
+        {
             if (context != null)
                 return context.GetContext();
             else
@@ -330,7 +332,8 @@ namespace System.Management
         public bool ReturnImmediately
         {
             get { return (((Flags & (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_RETURN_IMMEDIATELY) != 0) ? true : false); }
-            set {
+            set
+            {
                 Flags = (value == false) ? (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_RETURN_IMMEDIATELY) :
                             (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_RETURN_IMMEDIATELY);
             }
@@ -347,7 +350,8 @@ namespace System.Management
         public int BlockSize
         {
             get { return blockSize; }
-            set {
+            set
+            {
                 //Unfortunately BlockSize was defined as int, but valid values are only  > 0
                 if (value <= 0)
                     throw new ArgumentOutOfRangeException(nameof(value));
@@ -377,7 +381,8 @@ namespace System.Management
         public bool Rewindable
         {
             get { return (((Flags & (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_FORWARD_ONLY) != 0) ? false : true); }
-            set {
+            set
+            {
                 Flags = (value == true) ? (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_FORWARD_ONLY) :
                                             (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_FORWARD_ONLY);
             }
@@ -403,7 +408,8 @@ namespace System.Management
         public bool UseAmendedQualifiers
         {
             get { return (((Flags & (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS) != 0) ? true : false); }
-            set {
+            set
+            {
                 Flags = (value == true) ? (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS) :
                                             (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS);
             }
@@ -426,8 +432,10 @@ namespace System.Management
             get
             { return (((Flags & (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_ENSURE_LOCATABLE) != 0) ? true : false); }
             set
-            { Flags = (value == true) ? (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_ENSURE_LOCATABLE) :
-                      (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_ENSURE_LOCATABLE); }
+            {
+                Flags = (value == true) ? (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_ENSURE_LOCATABLE) :
+                        (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_ENSURE_LOCATABLE);
+            }
         }
 
 
@@ -447,8 +455,10 @@ namespace System.Management
             get
             { return (((Flags & (int)tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_PROTOTYPE) != 0) ? true : false); }
             set
-            { Flags = (value == true) ? (Flags | (int)tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_PROTOTYPE) :
-                      (Flags & (int)~tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_PROTOTYPE); }
+            {
+                Flags = (value == true) ? (Flags | (int)tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_PROTOTYPE) :
+                        (Flags & (int)~tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_PROTOTYPE);
+            }
         }
 
         /// <summary>
@@ -466,8 +476,10 @@ namespace System.Management
             get
             { return (((Flags & (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_DIRECT_READ) != 0) ? true : false); }
             set
-            { Flags = (value == true) ? (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_DIRECT_READ) :
-                      (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_DIRECT_READ); }
+            {
+                Flags = (value == true) ? (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_DIRECT_READ) :
+                        (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_DIRECT_READ);
+            }
         }
 
 
@@ -487,8 +499,10 @@ namespace System.Management
             get
             { return (((Flags & (int)tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_SHALLOW) != 0) ? false : true); }
             set
-            { Flags = (value == false) ? (Flags | (int)tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_SHALLOW) :
-                      (Flags & (int)~tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_SHALLOW); }
+            {
+                Flags = (value == false) ? (Flags | (int)tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_SHALLOW) :
+                        (Flags & (int)~tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_SHALLOW);
+            }
         }
 
 
@@ -502,7 +516,7 @@ namespace System.Management
         /// class with default values (see the individual property descriptions
         /// for what the default values are). This is the default constructor. </para>
         /// </summary>
-        public EnumerationOptions() : this (null, InfiniteTimeout, 1, true, true, false, false, false, false, false) {}
+        public EnumerationOptions() : this(null, InfiniteTimeout, 1, true, true, false, false, false, false, false) { }
 
 
 
@@ -549,14 +563,14 @@ namespace System.Management
         /// <returns>
         ///    <para>The cloned object.</para>
         /// </returns>
-        public override object Clone ()
+        public override object Clone()
         {
             ManagementNamedValueCollection newContext = null;
 
             if (null != Context)
                 newContext = (ManagementNamedValueCollection)Context.Clone();
 
-            return new EnumerationOptions (newContext, Timeout, blockSize, Rewindable,
+            return new EnumerationOptions(newContext, Timeout, blockSize, Rewindable,
                             ReturnImmediately, UseAmendedQualifiers, EnsureLocatable, PrototypeOnly, DirectRead, EnumerateDeep);
         }
 
@@ -666,7 +680,7 @@ namespace System.Management
             set
             {
                 blockSize = value;
-                FireIdentifierChanged ();
+                FireIdentifierChanged();
             }
 
         }
@@ -679,7 +693,7 @@ namespace System.Management
         ///    This is the default constructor.</para>
         /// </summary>
         public EventWatcherOptions()
-            : this (null, InfiniteTimeout, 1) {}
+            : this(null, InfiniteTimeout, 1) { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.EventWatcherOptions'/> class with the given
@@ -691,7 +705,7 @@ namespace System.Management
         public EventWatcherOptions(ManagementNamedValueCollection context, TimeSpan timeout, int blockSize)
             : base(context, timeout)
         {
-            Flags = (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_RETURN_IMMEDIATELY|(int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_FORWARD_ONLY;
+            Flags = (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_RETURN_IMMEDIATELY | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_FORWARD_ONLY;
             BlockSize = blockSize;
         }
 
@@ -701,14 +715,14 @@ namespace System.Management
         /// <returns>
         ///    The cloned object.
         /// </returns>
-        public override object Clone ()
+        public override object Clone()
         {
             ManagementNamedValueCollection newContext = null;
 
             if (null != Context)
                 newContext = (ManagementNamedValueCollection)Context.Clone();
 
-            return new EventWatcherOptions (newContext, Timeout, blockSize);
+            return new EventWatcherOptions(newContext, Timeout, blockSize);
         }
     }//EventWatcherOptions
 
@@ -803,7 +817,8 @@ namespace System.Management
         public bool UseAmendedQualifiers
         {
             get { return (((Flags & (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS) != 0) ? true : false); }
-            set {
+            set
+            {
                 Flags = (value == true) ? (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS) :
                                             (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS);
                 FireIdentifierChanged();
@@ -817,14 +832,14 @@ namespace System.Management
         /// <para>Initializes a new instance of the <see cref='System.Management.ObjectGetOptions'/> class for getting a WMI object, using
         ///    default values. This is the default constructor.</para>
         /// </summary>
-        public ObjectGetOptions() : this(null, InfiniteTimeout, false) {}
+        public ObjectGetOptions() : this(null, InfiniteTimeout, false) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ObjectGetOptions'/> class for getting a WMI object, using the
         ///    specified provider-specific context.</para>
         /// </summary>
         /// <param name='context'>A provider-specific, named-value pairs context object to be passed through to the provider.</param>
-        public ObjectGetOptions(ManagementNamedValueCollection context) : this(context, InfiniteTimeout, false) {}
+        public ObjectGetOptions(ManagementNamedValueCollection context) : this(context, InfiniteTimeout, false) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ObjectGetOptions'/> class for getting a WMI object,
@@ -844,14 +859,14 @@ namespace System.Management
         /// <returns>
         ///    <para>The cloned object.</para>
         /// </returns>
-        public override object Clone ()
+        public override object Clone()
         {
             ManagementNamedValueCollection newContext = null;
 
             if (null != Context)
                 newContext = (ManagementNamedValueCollection)Context.Clone();
 
-            return new ObjectGetOptions (newContext, Timeout, UseAmendedQualifiers);
+            return new ObjectGetOptions(newContext, Timeout, UseAmendedQualifiers);
         }
     }
 
@@ -935,8 +950,11 @@ namespace System.Management
         public bool UseAmendedQualifiers
         {
             get { return (((Flags & (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS) != 0) ? true : false); }
-            set { Flags = (value == true) ? (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS) :
-                                            (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS); }
+            set
+            {
+                Flags = (value == true) ? (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS) :
+                                          (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_USE_AMENDED_QUALIFIERS);
+            }
         }
 
         /// <summary>
@@ -947,11 +965,14 @@ namespace System.Management
         /// </value>
         public PutType Type
         {
-            get { return (((Flags & (int)tag_WBEM_CHANGE_FLAG_TYPE.WBEM_FLAG_UPDATE_ONLY) != 0) ? PutType.UpdateOnly :
-                          ((Flags & (int)tag_WBEM_CHANGE_FLAG_TYPE.WBEM_FLAG_CREATE_ONLY) != 0) ? PutType.CreateOnly :
-                                                                                PutType.UpdateOrCreate);
+            get
+            {
+                return (((Flags & (int)tag_WBEM_CHANGE_FLAG_TYPE.WBEM_FLAG_UPDATE_ONLY) != 0) ? PutType.UpdateOnly :
+                        ((Flags & (int)tag_WBEM_CHANGE_FLAG_TYPE.WBEM_FLAG_CREATE_ONLY) != 0) ? PutType.CreateOnly :
+                                                                              PutType.UpdateOrCreate);
             }
-            set {
+            set
+            {
                 Flags |= value switch
                 {
                     PutType.UpdateOnly => (int)tag_WBEM_CHANGE_FLAG_TYPE.WBEM_FLAG_UPDATE_ONLY,
@@ -969,14 +990,14 @@ namespace System.Management
         /// <para>Initializes a new instance of the <see cref='System.Management.PutOptions'/> class for put operations, using default values.
         ///    This is the default constructor.</para>
         /// </summary>
-        public PutOptions() : this(null, InfiniteTimeout, false, PutType.UpdateOrCreate) {}
+        public PutOptions() : this(null, InfiniteTimeout, false, PutType.UpdateOrCreate) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.PutOptions'/> class for committing a WMI object, using the
         ///    specified provider-specific context.</para>
         /// </summary>
         /// <param name='context'>A provider-specific, named-value pairs context object to be passed through to the provider.</param>
-        public PutOptions(ManagementNamedValueCollection context) : this(context, InfiniteTimeout, false, PutType.UpdateOrCreate) {}
+        public PutOptions(ManagementNamedValueCollection context) : this(context, InfiniteTimeout, false, PutType.UpdateOrCreate) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.PutOptions'/> class for committing a WMI object, using
@@ -998,14 +1019,14 @@ namespace System.Management
         /// <returns>
         ///    <para>The cloned object.</para>
         /// </returns>
-        public override object Clone ()
+        public override object Clone()
         {
             ManagementNamedValueCollection newContext = null;
 
             if (null != Context)
                 newContext = (ManagementNamedValueCollection)Context.Clone();
 
-            return new PutOptions (newContext, Timeout, UseAmendedQualifiers, Type);
+            return new PutOptions(newContext, Timeout, UseAmendedQualifiers, Type);
         }
     }
 
@@ -1069,7 +1090,7 @@ namespace System.Management
         /// <para>Initializes a new instance of the <see cref='System.Management.DeleteOptions'/> class for the delete operation, using default values.
         ///    This is the default constructor.</para>
         /// </summary>
-        public DeleteOptions() : base () {}
+        public DeleteOptions() : base() { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.DeleteOptions'/> class for a delete operation, using
@@ -1077,7 +1098,7 @@ namespace System.Management
         /// </summary>
         /// <param name='context'>A provider-specific, named-value pairs object to be passed through to the provider. </param>
         /// <param name='timeout'>The length of time to let the operation perform before it times out. The default value is <see cref='System.Management.ManagementOptions.InfiniteTimeout'/> . Setting this parameter will invoke the operation semisynchronously.</param>
-        public DeleteOptions(ManagementNamedValueCollection context, TimeSpan timeout) : base(context, timeout) {}
+        public DeleteOptions(ManagementNamedValueCollection context, TimeSpan timeout) : base(context, timeout) { }
 
         /// <summary>
         ///    <para> Returns a copy of the object.</para>
@@ -1085,14 +1106,14 @@ namespace System.Management
         /// <returns>
         ///    <para>A cloned object.</para>
         /// </returns>
-        public override object Clone ()
+        public override object Clone()
         {
             ManagementNamedValueCollection newContext = null;
 
             if (null != Context)
                 newContext = (ManagementNamedValueCollection)Context.Clone();
 
-            return new DeleteOptions (newContext, Timeout);
+            return new DeleteOptions(newContext, Timeout);
         }
     }
 
@@ -1156,7 +1177,7 @@ namespace System.Management
         /// <para>Initializes a new instance of the <see cref='System.Management.InvokeMethodOptions'/> class for the <see cref='System.Management.ManagementObject.InvokeMethod(string, ManagementBaseObject, InvokeMethodOptions) '/> operation, using default values.
         ///    This is the default constructor.</para>
         /// </summary>
-        public InvokeMethodOptions() : base () {}
+        public InvokeMethodOptions() : base() { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.InvokeMethodOptions'/> class for an invoke operation using
@@ -1164,7 +1185,7 @@ namespace System.Management
         /// </summary>
         /// <param name=' context'>A provider-specific, named-value pairs object to be passed through to the provider. </param>
         /// <param name='timeout'>The length of time to let the operation perform before it times out. The default value is <see cref='System.Management.ManagementOptions.InfiniteTimeout'/> . Setting this parameter will invoke the operation semisynchronously.</param>
-        public InvokeMethodOptions(ManagementNamedValueCollection context, TimeSpan timeout) : base(context, timeout) {}
+        public InvokeMethodOptions(ManagementNamedValueCollection context, TimeSpan timeout) : base(context, timeout) { }
 
         /// <summary>
         ///    <para> Returns a copy of the object.</para>
@@ -1172,14 +1193,14 @@ namespace System.Management
         /// <returns>
         ///    <para>The cloned object.</para>
         /// </returns>
-        public override object Clone ()
+        public override object Clone()
         {
             ManagementNamedValueCollection newContext = null;
 
             if (null != Context)
                 newContext = (ManagementNamedValueCollection)Context.Clone();
 
-            return new InvokeMethodOptions (newContext, Timeout);
+            return new InvokeMethodOptions(newContext, Timeout);
         }
     }
 
@@ -1277,7 +1298,8 @@ namespace System.Management
         public string Locale
         {
             get { return (null != locale) ? locale : string.Empty; }
-            set {
+            set
+            {
                 if (locale != value)
                 {
                     locale = value;
@@ -1302,7 +1324,8 @@ namespace System.Management
         public string Username
         {
             get { return username; }
-            set {
+            set
+            {
                 if (username != value)
                 {
                     username = value;
@@ -1324,13 +1347,14 @@ namespace System.Management
         /// </remarks>
         public string Password
         {
-            set {
-                if ( value != null)
+            set
+            {
+                if (value != null)
                 {
                     if (securePassword == null)
                     {
                         securePassword = new SecureString();
-                        for ( int i=0; i <value.Length; i++)
+                        for (int i = 0; i < value.Length; i++)
                         {
                             securePassword.AppendChar(value[i]);
                         }
@@ -1338,14 +1362,14 @@ namespace System.Management
                     else
                     {
                         SecureString tempStr = new SecureString();
-                        for ( int i=0; i <value.Length; i++)
+                        for (int i = 0; i < value.Length; i++)
                         {
                             tempStr.AppendChar(value[i]);
                         }
                         securePassword.Clear();
                         securePassword = tempStr.Copy();
                         FireIdentifierChanged();
-                         tempStr.Dispose();
+                        tempStr.Dispose();
                     }
                 }
                 else
@@ -1372,10 +1396,11 @@ namespace System.Management
         /// </remarks>
         public SecureString SecurePassword
         {
-            set{
-                if ( value != null)
+            set
+            {
+                if (value != null)
                 {
-                    if ( securePassword == null)
+                    if (securePassword == null)
                     {
                         securePassword = value.Copy();
                     }
@@ -1421,7 +1446,8 @@ namespace System.Management
         public string Authority
         {
             get { return (null != authority) ? authority : string.Empty; }
-            set {
+            set
+            {
                 if (authority != value)
                 {
                     authority = value;
@@ -1452,7 +1478,8 @@ namespace System.Management
         public ImpersonationLevel Impersonation
         {
             get { return impersonation; }
-            set {
+            set
+            {
                 if (impersonation != value)
                 {
                     impersonation = value;
@@ -1482,7 +1509,8 @@ namespace System.Management
         public AuthenticationLevel Authentication
         {
             get { return authentication; }
-            set {
+            set
+            {
                 if (authentication != value)
                 {
                     authentication = value;
@@ -1505,7 +1533,8 @@ namespace System.Management
         public bool EnablePrivileges
         {
             get { return enablePrivileges; }
-            set {
+            set
+            {
                 if (enablePrivileges != value)
                 {
                     enablePrivileges = value;
@@ -1526,10 +1555,11 @@ namespace System.Management
         /// <para>Initializes a new instance of the <see cref='System.Management.ConnectionOptions'/> class for the connection operation, using default values. This is the
         ///    default constructor.</para>
         /// </summary>
-        public ConnectionOptions () :
-            this (DEFAULTLOCALE, null, (string)null, DEFAULTAUTHORITY,
+        public ConnectionOptions() :
+            this(DEFAULTLOCALE, null, (string)null, DEFAULTAUTHORITY,
                     DEFAULTIMPERSONATION, DEFAULTAUTHENTICATION,
-                    DEFAULTENABLEPRIVILEGES, null, InfiniteTimeout) {}
+                    DEFAULTENABLEPRIVILEGES, null, InfiniteTimeout)
+        { }
 
 
         //parameterized
@@ -1546,11 +1576,11 @@ namespace System.Management
         /// <param name=' enablePrivileges'><see langword='true'/>to enable special user privileges; otherwise, <see langword='false'/> . This parameter should only be used when performing an operation that requires special Windows NT user privileges.</param>
         /// <param name=' context'>A provider-specific, named value pairs object to be passed through to the provider.</param>
         /// <param name=' timeout'>Reserved for future use.</param>
-        public ConnectionOptions (string locale,
+        public ConnectionOptions(string locale,
                 string username, string password, string authority,
                 ImpersonationLevel impersonation, AuthenticationLevel authentication,
                 bool enablePrivileges,
-                ManagementNamedValueCollection context, TimeSpan timeout) : base (context, timeout)
+                ManagementNamedValueCollection context, TimeSpan timeout) : base(context, timeout)
         {
             if (locale != null)
                 this.locale = locale;
@@ -1561,7 +1591,7 @@ namespace System.Management
             if (password != null)
             {
                 this.securePassword = new SecureString();
-                for ( int i=0; i <password.Length; i++)
+                for (int i = 0; i < password.Length; i++)
                 {
                     securePassword.AppendChar(password[i]);
                 }
@@ -1590,11 +1620,11 @@ namespace System.Management
         /// <param name='enablePrivileges'><see langword='true'/>to enable special user privileges; otherwise, <see langword='false'/> . This parameter should only be used when performing an operation that requires special Windows NT user privileges.</param>
         /// <param name='context'>A provider-specific, named value pairs object to be passed through to the provider.</param>
         /// <param name='timeout'>Reserved for future use.</param>
-        public ConnectionOptions (string locale,
+        public ConnectionOptions(string locale,
                 string username, SecureString password, string authority,
                 ImpersonationLevel impersonation, AuthenticationLevel authentication,
                 bool enablePrivileges,
-                ManagementNamedValueCollection context, TimeSpan timeout) : base (context, timeout)
+                ManagementNamedValueCollection context, TimeSpan timeout) : base(context, timeout)
         {
             if (locale != null)
                 this.locale = locale;
@@ -1623,13 +1653,13 @@ namespace System.Management
         /// <returns>
         ///    <para>The cloned object.</para>
         /// </returns>
-        public override object Clone ()
+        public override object Clone()
         {
             ManagementNamedValueCollection newContext = null;
 
             if (null != Context)
                 newContext = (ManagementNamedValueCollection)Context.Clone();
-            return new ConnectionOptions (locale, username, GetSecurePassword (),
+            return new ConnectionOptions(locale, username, GetSecurePassword(),
                     authority, impersonation, authentication, enablePrivileges, newContext, Timeout);
         }
 
@@ -1641,7 +1671,8 @@ namespace System.Management
         {
             if (securePassword != null)
             {
-                try{
+                try
+                {
                     return System.Runtime.InteropServices.Marshal.SecureStringToBSTR(securePassword);
                 }
                 catch (OutOfMemoryException)
@@ -1652,7 +1683,7 @@ namespace System.Management
             else
                 return IntPtr.Zero;
         }
-         internal SecureString GetSecurePassword()
+        internal SecureString GetSecurePassword()
         {
             if (securePassword != null)
                 return securePassword.Copy();
@@ -1660,9 +1691,9 @@ namespace System.Management
                 return null;
         }
 
-        internal ConnectionOptions(ManagementNamedValueCollection context, TimeSpan timeout, int flags) : base(context, timeout, flags) {}
+        internal ConnectionOptions(ManagementNamedValueCollection context, TimeSpan timeout, int flags) : base(context, timeout, flags) { }
 
-        internal ConnectionOptions(ManagementNamedValueCollection context) : base(context, InfiniteTimeout) {}
+        internal ConnectionOptions(ManagementNamedValueCollection context) : base(context, InfiniteTimeout) { }
 
         internal static ConnectionOptions _Clone(ConnectionOptions options)
         {
index 42d81a1..1f385e2 100644 (file)
@@ -70,14 +70,14 @@ namespace System.Management
     /// End Class
     ///    </code>
     /// </example>
-    [TypeConverter(typeof(ManagementPathConverter ))]
+    [TypeConverter(typeof(ManagementPathConverter))]
     public class ManagementPath : ICloneable
     {
         private static ManagementPath defaultPath = new ManagementPath("//./root/cimv2");
 
         //Used to minimize the cases in which new wbemPath (WMI object path parser) objects need to be constructed
         //This is done for performance reasons.
-        private bool   isWbemPathShared = false;
+        private bool isWbemPathShared = false;
 
         internal event IdentifierChangedEventHandler IdentifierChanged;
 
@@ -95,21 +95,21 @@ namespace System.Management
         /// </summary>
         /// <param name="wbemObject">The WMI object whose __PATH property will
         /// be used to supply the returned object</param>
-        internal static string GetManagementPath (
+        internal static string GetManagementPath(
             IWbemClassObjectFreeThreaded wbemObject)
         {
             string path = null;
-            int status  = (int)ManagementStatus.Failed;
+            int status = (int)ManagementStatus.Failed;
 
             if (null != wbemObject)
             {
                 int dummy1 = 0, dummy2 = 0;
                 object val = null;
-                status = wbemObject.Get_ ("__PATH", 0, ref val, ref dummy1, ref dummy2);
+                status = wbemObject.Get_("__PATH", 0, ref val, ref dummy1, ref dummy2);
                 if ((status < 0) || (val == System.DBNull.Value))
                 {
                     //try to get the relpath instead
-                    status = wbemObject.Get_ ("__RELPATH", 0, ref val, ref dummy1, ref dummy2);
+                    status = wbemObject.Get_("__RELPATH", 0, ref val, ref dummy1, ref dummy2);
                     if (status < 0)
                     {
                         if ((status & 0xfffff000) == 0x80041000)
@@ -183,7 +183,7 @@ namespace System.Management
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.ManagementPath'/> class that is empty. This is the default constructor.</para>
         /// </summary>
-        public ManagementPath () : this ((string) null) {}
+        public ManagementPath() : this((string)null) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementPath'/> class for the given path.</para>
@@ -203,7 +203,7 @@ namespace System.Management
         ///    path represented by this object. This value is equivalent to the value of the
         /// <see cref='System.Management.ManagementPath.Path'/> property.
         /// </returns>
-        public override string ToString ()
+        public override string ToString()
         {
             return this.Path;
         }
@@ -214,9 +214,9 @@ namespace System.Management
         /// <returns>
         ///    The cloned object.
         /// </returns>
-        public ManagementPath Clone ()
+        public ManagementPath Clone()
         {
-            return new ManagementPath (Path);
+            return new ManagementPath(Path);
         }
 
         /// <summary>
@@ -225,9 +225,9 @@ namespace System.Management
         /// <returns>
         ///    The cloned object.
         /// </returns>
-        object ICloneable.Clone ()
+        object ICloneable.Clone()
         {
-            return Clone ();
+            return Clone();
         }
 
         /// <summary>
@@ -245,7 +245,7 @@ namespace System.Management
         }
 
         //private members
-        private IWbemPath       wmiPath;
+        private IWbemPath wmiPath;
 
         private IWbemPath CreateWbemPath(string path)
         {
@@ -267,13 +267,13 @@ namespace System.Management
         {
             if (null != wbemPath)
             {
-                uint flags = (uint) tag_WBEM_PATH_CREATE_FLAG.WBEMPATH_CREATE_ACCEPT_ALL;
+                uint flags = (uint)tag_WBEM_PATH_CREATE_FLAG.WBEMPATH_CREATE_ACCEPT_ALL;
 
                 //For now we have to special-case the "root" namespace -
                 //  this is because in the case of "root", the path parser cannot tell whether
                 //  this is a namespace name or a class name
                 if (string.Equals(path, "root", StringComparison.OrdinalIgnoreCase))
-                    flags = flags | (uint) tag_WBEM_PATH_CREATE_FLAG.WBEMPATH_TREAT_SINGLE_IDENT_AS_NS;
+                    flags = flags | (uint)tag_WBEM_PATH_CREATE_FLAG.WBEMPATH_TREAT_SINGLE_IDENT_AS_NS;
 
                 int status = wbemPath.SetText_(flags, path);
 
@@ -345,7 +345,7 @@ namespace System.Management
             return pathStr;
         }
 
-        private void ClearKeys (bool setAsSingleton)
+        private void ClearKeys(bool setAsSingleton)
         {
             // Test/utilize isWbemPathShared *only* on public + internal members!
             int status = (int)ManagementStatus.NoError;
@@ -364,7 +364,7 @@ namespace System.Management
                         {
                             sbyte bSingleton = (setAsSingleton) ? (sbyte)(-1) : (sbyte)0;
                             status = keyList.MakeSingleton_(bSingleton);
-                            FireIdentifierChanged ();
+                            FireIdentifierChanged();
                         }
                     }
                 }
@@ -388,7 +388,7 @@ namespace System.Management
         {
             get
             {
-                return (Path.Length == 0 );
+                return (Path.Length == 0);
             }
         }
 
@@ -401,7 +401,7 @@ namespace System.Management
         ///    <para> Sets the path as a new class path. This means that the path must have
         ///       a class name but not key values.</para>
         /// </summary>
-        public void SetAsClass ()
+        public void SetAsClass()
         {
             if (IsClass || IsInstance)
             {
@@ -413,17 +413,17 @@ namespace System.Management
                     isWbemPathShared = false;
                 }
 
-                ClearKeys (false);
+                ClearKeys(false);
             }
             else
-                throw new ManagementException (ManagementStatus.InvalidOperation, null, null);
+                throw new ManagementException(ManagementStatus.InvalidOperation, null, null);
         }
 
         /// <summary>
         ///    <para> Sets the path as a new singleton object path. This means that it is a path to an instance but
         ///       there are no key values.</para>
         /// </summary>
-        public void SetAsSingleton ()
+        public void SetAsSingleton()
         {
             if (IsClass || IsInstance)
             {
@@ -435,10 +435,10 @@ namespace System.Management
                     isWbemPathShared = false;
                 }
 
-                ClearKeys (true);
+                ClearKeys(true);
             }
             else
-                throw new ManagementException (ManagementStatus.InvalidOperation, null, null);
+                throw new ManagementException(ManagementStatus.InvalidOperation, null, null);
         }
 
         //
@@ -478,7 +478,7 @@ namespace System.Management
                 }
                 catch
                 {
-                    throw new ArgumentOutOfRangeException (nameof(value));
+                    throw new ArgumentOutOfRangeException(nameof(value));
                 }
                 FireIdentifierChanged();
             }
@@ -504,7 +504,7 @@ namespace System.Management
                     // Get the space we need to reserve
                     uint bufLen = 0;
                     int status = wmiPath.GetText_(
-                        (int) tag_WBEM_GET_TEXT_FLAGS.WBEMPATH_GET_RELATIVE_ONLY,
+                        (int)tag_WBEM_GET_TEXT_FLAGS.WBEMPATH_GET_RELATIVE_ONLY,
                         ref bufLen,
                         null);
 
@@ -512,7 +512,7 @@ namespace System.Management
                     {
                         char[] pathChars = new char[(int)bufLen];
                         status = wmiPath.GetText_(
-                            (int) tag_WBEM_GET_TEXT_FLAGS.WBEMPATH_GET_RELATIVE_ONLY,
+                            (int)tag_WBEM_GET_TEXT_FLAGS.WBEMPATH_GET_RELATIVE_ONLY,
                             ref bufLen,
                             pathChars);
                         pathStr = new string(pathChars, 0, Array.IndexOf(pathChars, '\0'));
@@ -540,21 +540,21 @@ namespace System.Management
                 {
                     // No need for isWbemPathShared here since internal SetRelativePath
                     // always creates a new copy.
-                    SetRelativePath (value);
+                    SetRelativePath(value);
                 }
                 catch (COMException)
                 {
-                    throw new ArgumentOutOfRangeException (nameof(value));
+                    throw new ArgumentOutOfRangeException(nameof(value));
                 }
                 FireIdentifierChanged();
             }
         }
 
-        internal void SetRelativePath (string relPath)
+        internal void SetRelativePath(string relPath)
         {
             // No need for isWbemPathShared here since internal SetRelativePath
             // always creates a new copy.
-            ManagementPath newPath = new ManagementPath (relPath);
+            ManagementPath newPath = new ManagementPath(relPath);
             newPath.NamespacePath = this.GetNamespacePath((int)tag_WBEM_GET_TEXT_FLAGS.WBEMPATH_GET_SERVER_AND_NAMESPACE_ONLY);
             newPath.Server = this.Server;
             wmiPath = newPath.wmiPath;
@@ -571,7 +571,7 @@ namespace System.Management
             string newPath = string.Empty;
             string nsPath = this.GetNamespacePath((int)tag_WBEM_GET_TEXT_FLAGS.WBEMPATH_GET_SERVER_AND_NAMESPACE_ONLY);
 
-            if (nsPath.Length>0 )
+            if (nsPath.Length > 0)
                 newPath = string.Concat(nsPath, ":", relPath);
             else
                 newPath = relPath;
@@ -664,10 +664,10 @@ namespace System.Management
 
         internal string SetNamespacePath(string nsPath, out bool bChange)
         {
-            int         status = (int)ManagementStatus.NoError;
-            string      nsOrg = null;
-            string      nsNew = null;
-            IWbemPath   wmiPathTmp = null;
+            int status = (int)ManagementStatus.NoError;
+            string nsOrg = null;
+            string nsNew = null;
+            IWbemPath wmiPathTmp = null;
             bChange = false;
 
             Debug.Assert(nsPath != null);
@@ -735,7 +735,7 @@ namespace System.Management
             //
             if (status >= 0 && nsPath.Length > 1 &&
                 (nsPath[0] == '\\' && nsPath[1] == '\\' ||
-                nsPath[0] == '/'  && nsPath[1] == '/'))
+                nsPath[0] == '/' && nsPath[1] == '/'))
             {
                 uint uLen = 0;
                 status = wmiPathTmp.GetServer_(ref uLen, null);
@@ -862,7 +862,7 @@ namespace System.Management
                 }
                 catch (COMException)
                 {
-                    throw new ArgumentOutOfRangeException (nameof(value));
+                    throw new ArgumentOutOfRangeException(nameof(value));
                 }
 
                 if (bChange)
@@ -943,7 +943,7 @@ namespace System.Management
                 }
                 catch (COMException)
                 {
-                    throw new ArgumentOutOfRangeException (nameof(value));
+                    throw new ArgumentOutOfRangeException(nameof(value));
                 }
 
                 if (status < 0)
@@ -1107,10 +1107,10 @@ namespace System.Management
             if (value is ManagementPath && destinationType == typeof(InstanceDescriptor))
             {
                 ManagementPath obj = ((ManagementPath)(value));
-                ConstructorInfo ctor = typeof(ManagementPath).GetConstructor(new Type[] {typeof(string)});
+                ConstructorInfo ctor = typeof(ManagementPath).GetConstructor(new Type[] { typeof(string) });
                 if (ctor != null)
                 {
-                    return new InstanceDescriptor(ctor, new object[] {obj.Path});
+                    return new InstanceDescriptor(ctor, new object[] { obj.Path });
                 }
             }
             return base.ConvertTo(context, culture, value, destinationType);
index 55b327f..9e93670 100644 (file)
@@ -19,7 +19,7 @@ namespace System.Management
     ///       derivatives of it are actually used in the API.</para>
     /// </remarks>
     //CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC//
-    [TypeConverter(typeof(ManagementQueryConverter ))]
+    [TypeConverter(typeof(ManagementQueryConverter))]
     public abstract class ManagementQuery : ICloneable
     {
         internal const string DEFAULTQUERYLANGUAGE = "WQL";
@@ -39,16 +39,16 @@ namespace System.Management
         private string queryLanguage;
         private string queryString;
 
-        internal void SetQueryString (string qString)
+        internal void SetQueryString(string qString)
         {
             queryString = qString;
         }
 
         //default constructor
-        internal ManagementQuery() : this(DEFAULTQUERYLANGUAGE, null) {}
+        internal ManagementQuery() : this(DEFAULTQUERYLANGUAGE, null) { }
 
         //parameterized constructors
-        internal ManagementQuery(string query) : this(DEFAULTQUERYLANGUAGE, query) {}
+        internal ManagementQuery(string query) : this(DEFAULTQUERYLANGUAGE, query) { }
         internal ManagementQuery(string language, string query)
         {
             QueryLanguage = language;
@@ -59,7 +59,7 @@ namespace System.Management
         ///  Parses the query string and sets the property values accordingly.
         /// </summary>
         /// <param name="query">The query string to be parsed.</param>
-        protected internal virtual void ParseQuery (string query) {}
+        protected internal virtual void ParseQuery(string query) { }
 
         //
         //properties
@@ -75,12 +75,14 @@ namespace System.Management
         /// </value>
         public virtual string QueryString
         {
-            get {return (null != queryString) ? queryString : string.Empty; }
-            set {
-                if (queryString != value) {
-                    ParseQuery (value); // this may throw
+            get { return (null != queryString) ? queryString : string.Empty; }
+            set
+            {
+                if (queryString != value)
+                {
+                    ParseQuery(value); // this may throw
                     queryString = value;
-                    FireIdentifierChanged ();
+                    FireIdentifierChanged();
                 }
             }
         }
@@ -95,11 +97,13 @@ namespace System.Management
         /// </value>
         public virtual string QueryLanguage
         {
-            get {return (null != queryLanguage) ? queryLanguage : string.Empty; }
-            set {
-                if (queryLanguage != value) {
+            get { return (null != queryLanguage) ? queryLanguage : string.Empty; }
+            set
+            {
+                if (queryLanguage != value)
+                {
                     queryLanguage = value;
-                    FireIdentifierChanged ();
+                    FireIdentifierChanged();
                 }
             }
         }
@@ -113,13 +117,13 @@ namespace System.Management
         /// </returns>
         public abstract object Clone();
 
-        internal static void ParseToken (ref string q, string token, string op, ref bool bTokenFound, ref string tokenValue)
+        internal static void ParseToken(ref string q, string token, string op, ref bool bTokenFound, ref string tokenValue)
         {
             if (bTokenFound)
-                throw new ArgumentException (SR.InvalidQueryDuplicatedToken);    // Invalid query - duplicate token
+                throw new ArgumentException(SR.InvalidQueryDuplicatedToken);    // Invalid query - duplicate token
 
             bTokenFound = true;
-            q = q.Remove (0, token.Length).TrimStart (null);
+            q = q.Remove(0, token.Length).TrimStart(null);
 
             // Next character should be the operator if any
             if (op != null)
@@ -132,25 +136,25 @@ namespace System.Management
             }
 
             if (0 == q.Length)
-                throw new ArgumentException (SR.InvalidQueryNullToken);        // Invalid query - token has no value
+                throw new ArgumentException(SR.InvalidQueryNullToken);        // Invalid query - token has no value
 
             // Next token should be the token value - look for terminating WS
             // or end of string
             int i;
-            if (-1 == (i = q.IndexOf (' ')))
+            if (-1 == (i = q.IndexOf(' ')))
                 i = q.Length;            // No WS => consume entire string
 
-            tokenValue = q.Substring (0, i);
-            q = q.Remove (0, tokenValue.Length).TrimStart(null);
+            tokenValue = q.Substring(0, i);
+            q = q.Remove(0, tokenValue.Length).TrimStart(null);
         }
 
-        internal static void ParseToken (ref string q, string token, ref bool bTokenFound)
+        internal static void ParseToken(ref string q, string token, ref bool bTokenFound)
         {
             if (bTokenFound)
-                throw new ArgumentException (SR.InvalidQueryDuplicatedToken);    // Invalid query - duplicate token
+                throw new ArgumentException(SR.InvalidQueryDuplicatedToken);    // Invalid query - duplicate token
 
             bTokenFound = true;
-            q = q.Remove (0, token.Length).TrimStart (null);
+            q = q.Remove(0, token.Length).TrimStart(null);
         }
 
     }//ManagementQuery
@@ -216,14 +220,14 @@ namespace System.Management
         /// class with no initialized values. This
         /// is the default constructor.</para>
         /// </summary>
-        public ObjectQuery() : base() {}
+        public ObjectQuery() : base() { }
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.ObjectQuery'/>
         /// class
         /// for a specific query string.</para>
         /// </summary>
         /// <param name='query'>The string representation of the query.</param>
-        public ObjectQuery(string query) : base(query) {}
+        public ObjectQuery(string query) : base(query) { }
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.ObjectQuery'/>
         /// class for a specific
@@ -231,7 +235,7 @@ namespace System.Management
         /// </summary>
         /// <param name='language'>The query language in which this query is specified.</param>
         /// <param name=' query'>The string representation of the query.</param>
-        public ObjectQuery(string language, string query) : base(language, query) {}
+        public ObjectQuery(string language, string query) : base(language, query) { }
 
         //ICloneable
         /// <summary>
@@ -240,7 +244,7 @@ namespace System.Management
         /// <returns>
         ///    The cloned object.
         /// </returns>
-        public override object Clone ()
+        public override object Clone()
         {
             return new ObjectQuery(QueryLanguage, QueryString);
         }
@@ -429,13 +433,13 @@ namespace System.Management
         /// class. This is the
         /// default constructor.</para>
         /// </summary>
-        public EventQuery() : base() {}
+        public EventQuery() : base() { }
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.EventQuery'/>
         /// class for the specified query.</para>
         /// </summary>
         /// <param name='query'>A textual representation of the event query.</param>
-        public EventQuery(string query) : base(query) {}
+        public EventQuery(string query) : base(query) { }
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.EventQuery'/>
         /// class for the specified
@@ -443,7 +447,7 @@ namespace System.Management
         /// </summary>
         /// <param name='language'>The language in which the query string is specified. </param>
         /// <param name=' query'>The string representation of the query.</param>
-        public EventQuery(string language, string query) : base(language, query) {}
+        public EventQuery(string language, string query) : base(language, query) { }
 
         //ICloneable
         /// <summary>
@@ -518,14 +522,14 @@ namespace System.Management
         /// <para>Initializes a new instance of the <see cref='System.Management.WqlObjectQuery'/> class. This is the
         ///    default constructor.</para>
         /// </summary>
-        public WqlObjectQuery() : base(null) {}
+        public WqlObjectQuery() : base(null) { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.WqlObjectQuery'/> class initialized to the
         ///    specified query.</para>
         /// </summary>
         /// <param name='query'><para> The representation of the data query.</para></param>
-        public WqlObjectQuery(string query) : base(query) {}
+        public WqlObjectQuery(string query) : base(query) { }
 
         //QueryLanguage property is read-only in this class (does this work ??)
         /// <summary>
@@ -538,7 +542,7 @@ namespace System.Management
         public override string QueryLanguage
         {
             get
-            {return base.QueryLanguage; }
+            { return base.QueryLanguage; }
         }
 
         //ICloneable
@@ -621,7 +625,7 @@ namespace System.Management
         /// class. This is the
         /// default constructor.</para>
         /// </summary>
-        public SelectQuery() :this(null) {}
+        public SelectQuery() : this(null) { }
 
         //parameterized constructors
         //ISSUE : We have 2 possible constructors that take a single string :
@@ -651,7 +655,7 @@ namespace System.Management
         /// </example>
         public SelectQuery(string queryOrClassName)
         {
-            selectedProperties = new StringCollection ();
+            selectedProperties = new StringCollection();
 
             if (null != queryOrClassName)
             {
@@ -668,12 +672,12 @@ namespace System.Management
                     // Do some basic sanity checking on whether it's a class name
                     //
 
-                    ManagementPath p = new ManagementPath (queryOrClassName);
+                    ManagementPath p = new ManagementPath(queryOrClassName);
 
-                    if (p.IsClass && (p.NamespacePath.Length==0))
+                    if (p.IsClass && (p.NamespacePath.Length == 0))
                         ClassName = queryOrClassName;
                     else
-                        throw new ArgumentException (SR.InvalidQuery, nameof(queryOrClassName));
+                        throw new ArgumentException(SR.InvalidQuery, nameof(queryOrClassName));
 
                 }
             }
@@ -692,7 +696,7 @@ namespace System.Management
         ///    <code lang='VB'>Dim s As New SelectQuery("Win32_Process", "HandleID=1234")
         ///    </code>
         /// </example>
-        public SelectQuery(string className, string condition) : this(className, condition, null) {}
+        public SelectQuery(string className, string condition) : this(className, condition, null) { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.SelectQuery'/>
@@ -716,15 +720,15 @@ namespace System.Management
         ///                          properties)
         ///    </code>
         /// </example>
-        public SelectQuery(string className, string condition, string[] selectedProperties) : base ()
+        public SelectQuery(string className, string condition, string[] selectedProperties) : base()
         {
             this.isSchemaQuery = false;
             this.className = className;
             this.condition = condition;
-            this.selectedProperties = new StringCollection ();
+            this.selectedProperties = new StringCollection();
 
             if (null != selectedProperties)
-                this.selectedProperties.AddRange (selectedProperties);
+                this.selectedProperties.AddRange(selectedProperties);
 
             BuildQuery();
         }
@@ -742,7 +746,7 @@ namespace System.Management
         ///    <code lang='VB'>Dim s As New SelectQuery(true, "__CLASS = ""Win32_Service""")
         ///    </code>
         /// </example>
-        public SelectQuery(bool isSchemaQuery, string condition) : base ()
+        public SelectQuery(bool isSchemaQuery, string condition) : base()
         {
             if (isSchemaQuery == false)
                 throw new ArgumentException(SR.InvalidQuery, nameof(isSchemaQuery));
@@ -778,12 +782,15 @@ namespace System.Management
         /// </example>
         public override string QueryString
         {
-            get {
+            get
+            {
                 // We need to force a rebuild as we may not have detected
                 // a change to selected properties
-                BuildQuery ();
-                return base.QueryString; }
-            set {
+                BuildQuery();
+                return base.QueryString;
+            }
+            set
+            {
                 base.QueryString = value;
             }
         }
@@ -877,20 +884,21 @@ namespace System.Management
         public StringCollection SelectedProperties
         {
             get { return selectedProperties; }
-            set {
+            set
+            {
                 if (null != value)
                 {
                     // A tad painful since StringCollection doesn't support ICloneable
                     StringCollection src = (StringCollection)value;
-                    StringCollection dst = new StringCollection ();
+                    StringCollection dst = new StringCollection();
 
                     foreach (string s in src)
-                        dst.Add (s);
+                        dst.Add(s);
 
                     selectedProperties = dst;
                 }
                 else
-                    selectedProperties = new StringCollection ();
+                    selectedProperties = new StringCollection();
 
                 BuildQuery();
                 FireIdentifierChanged();
@@ -909,9 +917,9 @@ namespace System.Management
                 //If the class name is not set we can't build a query
                 //Shouldn't throw here because the user may be in the process of filling in the properties...
                 if (className == null)
-                    SetQueryString (string.Empty);
+                    SetQueryString(string.Empty);
 
-                if ((className == null) || (className.Length==0))
+                if ((className == null) || (className.Length == 0))
                     return;
 
                 //Select clause
@@ -945,7 +953,7 @@ namespace System.Management
             //Set the queryString member to the built query (NB: note we set
             //by accessing the internal helper function rather than the property,
             //since we do not want to force a parse of a query we just built).
-            SetQueryString (s);
+            SetQueryString(s);
         }
 
 
@@ -971,13 +979,13 @@ namespace System.Management
                 string keyword = TokenSelect;
                 if ((q.Length >= keyword.Length) && (string.Compare(q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase) == 0)) //select clause found
                 {
-                    ParseToken (ref q, keyword, ref bFound);
+                    ParseToken(ref q, keyword, ref bFound);
                     if (q[0] != '*') //we have properties
                     {
                         if (null != selectedProperties)
-                            selectedProperties.Clear ();
+                            selectedProperties.Clear();
                         else
-                            selectedProperties = new StringCollection ();
+                            selectedProperties = new StringCollection();
 
                         //get the property list
                         while (true)
@@ -985,9 +993,9 @@ namespace System.Management
                             if ((i = q.IndexOf(',')) > 0)
                             {
                                 tempProp = q.Substring(0, i);
-                                q = q.Remove(0, i+1).TrimStart(null);
+                                q = q.Remove(0, i + 1).TrimStart(null);
                                 tempProp = tempProp.Trim();
-                                if (tempProp.Length>0)
+                                if (tempProp.Length > 0)
                                     selectedProperties.Add(tempProp);
                             }
                             else
@@ -1031,34 +1039,34 @@ namespace System.Management
 
                 // Should start with "select"
                 if ((q.Length < keyword.Length) ||
-                    (0 != string.Compare (q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
-                    throw new ArgumentException (SR.InvalidQuery, "select");
+                    (0 != string.Compare(q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
+                    throw new ArgumentException(SR.InvalidQuery, "select");
 
-                q = q.Remove (0, keyword.Length).TrimStart (null);
+                q = q.Remove(0, keyword.Length).TrimStart(null);
 
                 // Next should be a '*'
-                if (0 != q.IndexOf ('*', 0))
-                    throw new ArgumentException (SR.InvalidQuery, "*");
+                if (0 != q.IndexOf('*', 0))
+                    throw new ArgumentException(SR.InvalidQuery, "*");
 
-                q = q.Remove (0, 1).TrimStart (null);
+                q = q.Remove(0, 1).TrimStart(null);
 
                 // Next should be "from"
                 keyword = "from";
 
                 if ((q.Length < keyword.Length) ||
-                    (0 != string.Compare (q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
-                    throw new ArgumentException (SR.InvalidQuery, "from");
+                    (0 != string.Compare(q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
+                    throw new ArgumentException(SR.InvalidQuery, "from");
 
-                q = q.Remove (0, keyword.Length).TrimStart (null);
+                q = q.Remove(0, keyword.Length).TrimStart(null);
 
                 // Next should be "meta_class"
                 keyword = "meta_class";
 
                 if ((q.Length < keyword.Length) ||
-                    (0 != string.Compare (q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
-                    throw new ArgumentException (SR.InvalidQuery, "meta_class");
+                    (0 != string.Compare(q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
+                    throw new ArgumentException(SR.InvalidQuery, "meta_class");
 
-                q = q.Remove (0, keyword.Length).TrimStart (null);
+                q = q.Remove(0, keyword.Length).TrimStart(null);
 
                 // There may be a where clause
                 if (0 < q.Length)
@@ -1067,13 +1075,13 @@ namespace System.Management
                     keyword = "where";
 
                     if ((q.Length < keyword.Length) ||
-                        (0 != string.Compare (q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
-                        throw new ArgumentException (SR.InvalidQuery, "where");
+                        (0 != string.Compare(q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
+                        throw new ArgumentException(SR.InvalidQuery, "where");
 
-                    q = q.Remove (0, keyword.Length);
+                    q = q.Remove(0, keyword.Length);
 
                     // Must be some white space next
-                    if ((0 == q.Length) || !char.IsWhiteSpace (q[0]))
+                    if ((0 == q.Length) || !char.IsWhiteSpace(q[0]))
                         throw new ArgumentException(SR.InvalidQuery);    // Invalid query
 
                     q = q.TrimStart(null);    // Remove the leading whitespace
@@ -1095,7 +1103,7 @@ namespace System.Management
         /// <returns>
         ///    The copied object.
         /// </returns>
-        public override object Clone ()
+        public override object Clone()
         {
             string[] strArray = null;
 
@@ -1105,8 +1113,8 @@ namespace System.Management
 
                 if (0 < count)
                 {
-                    strArray = new string [count];
-                    selectedProperties.CopyTo (strArray, 0);
+                    strArray = new string[count];
+                    selectedProperties.CopyTo(strArray, 0);
                 }
             }
 
@@ -1207,7 +1215,7 @@ namespace System.Management
         /// <para>Initializes a new instance of the <see cref='System.Management.RelatedObjectQuery'/> class. This is the
         ///    default constructor.</para>
         /// </summary>
-        public RelatedObjectQuery() :this(null) {}
+        public RelatedObjectQuery() : this(null) { }
 
         //parameterized constructor
         //ISSUE : We have 2 possible constructors that take a single string :
@@ -1264,15 +1272,15 @@ namespace System.Management
                     // Do some basic sanity checking on whether it's a class/instance name
                     //
 
-                    ManagementPath p = new ManagementPath (queryOrSourceObject);
+                    ManagementPath p = new ManagementPath(queryOrSourceObject);
 
-                    if ((p.IsClass || p.IsInstance) && (p.NamespacePath.Length==0))
+                    if ((p.IsClass || p.IsInstance) && (p.NamespacePath.Length == 0))
                     {
                         SourceObject = queryOrSourceObject;
                         isSchemaQuery = false;
                     }
                     else
-                        throw new ArgumentException (SR.InvalidQuery, nameof(queryOrSourceObject));
+                        throw new ArgumentException(SR.InvalidQuery, nameof(queryOrSourceObject));
                 }
             }
         }
@@ -1284,7 +1292,8 @@ namespace System.Management
         /// <param name='sourceObject'>The path of the source object for this query.</param>
         /// <param name='relatedClass'>The related objects class.</param>
         public RelatedObjectQuery(string sourceObject, string relatedClass) : this(sourceObject, relatedClass,
-                                                                                    null, null, null, null, null, false) {}
+                                                                                    null, null, null, null, null, false)
+        { }
 
         //Do we need additional variants of constructors here ??
         /// <summary>
@@ -1556,48 +1565,48 @@ namespace System.Management
             //If the source object is not set we can't build a query
             //Shouldn't throw here because the user may be in the process of filling in the properties...
             if (sourceObject == null)
-                SetQueryString (string.Empty);
+                SetQueryString(string.Empty);
 
-            if ((sourceObject == null) || (sourceObject.Length==0))
+            if ((sourceObject == null) || (sourceObject.Length == 0))
                 return;
 
             //"associators" clause
             string s = TokenAssociators + " " + TokenOf + " {" + sourceObject + "}";
 
             //If any of the other parameters are set we need a "where" clause
-            if (!(RelatedClass.Length==0) ||
-                !(RelationshipClass.Length==0) ||
-                !(RelatedQualifier.Length==0) ||
-                !(RelationshipQualifier.Length==0) ||
-                !(RelatedRole.Length==0) ||
-                !(ThisRole.Length==0) ||
+            if (!(RelatedClass.Length == 0) ||
+                !(RelationshipClass.Length == 0) ||
+                !(RelatedQualifier.Length == 0) ||
+                !(RelationshipQualifier.Length == 0) ||
+                !(RelatedRole.Length == 0) ||
+                !(ThisRole.Length == 0) ||
                 classDefinitionsOnly ||
                 isSchemaQuery)
             {
                 s = s + " " + TokenWhere;
 
                 //"ResultClass"
-                if (!(RelatedClass.Length==0))
+                if (!(RelatedClass.Length == 0))
                     s = s + " " + TokenResultClass + " = " + relatedClass;
 
                 //"AssocClass"
-                if (!(RelationshipClass.Length==0))
+                if (!(RelationshipClass.Length == 0))
                     s = s + " " + TokenAssocClass + " = " + relationshipClass;
 
                 //"ResultRole"
-                if (!(RelatedRole.Length==0))
+                if (!(RelatedRole.Length == 0))
                     s = s + " " + TokenResultRole + " = " + relatedRole;
 
                 //"Role"
-                if (!(ThisRole.Length==0))
+                if (!(ThisRole.Length == 0))
                     s = s + " " + TokenRole + " = " + thisRole;
 
                 //"RequiredQualifier"
-                if (!(RelatedQualifier.Length==0))
+                if (!(RelatedQualifier.Length == 0))
                     s = s + " " + TokenRequiredQualifier + " = " + relatedQualifier;
 
                 //"RequiredAssocQualifier"
-                if (!(RelationshipQualifier.Length==0))
+                if (!(RelationshipQualifier.Length == 0))
                     s = s + " " + TokenRequiredAssocQualifier + " = " + relationshipQualifier;
 
                 //"SchemaOnly" and "ClassDefsOnly"
@@ -1613,7 +1622,7 @@ namespace System.Management
             //Set the queryString member to the built query (NB: note we set
             //by accessing the internal helper function rather than the property,
             //since we do not want to force a parse of a query we just built).
-            SetQueryString (s);
+            SetQueryString(s);
 
         }//BuildQuery()
 
@@ -1632,8 +1641,8 @@ namespace System.Management
             string tempThisRole = null;
             string tempRelatedQualifier = null;
             string tempRelationshipQualifier = null;
-            bool   tempClassDefsOnly = false;
-            bool   tempIsSchemaQuery = false;
+            bool tempClassDefsOnly = false;
+            bool tempIsSchemaQuery = false;
 
             //Trim whitespaces
             string q = query.Trim();
@@ -1647,7 +1656,7 @@ namespace System.Management
             q = q.Remove(0, TokenAssociators.Length);
 
             // Must be some white space next
-            if ((0 == q.Length) || !char.IsWhiteSpace (q[0]))
+            if ((0 == q.Length) || !char.IsWhiteSpace(q[0]))
                 throw new ArgumentException(SR.InvalidQuery);    // Invalid query
 
             q = q.TrimStart(null);    // Remove the leading whitespace
@@ -1657,7 +1666,7 @@ namespace System.Management
                 throw new ArgumentException(SR.InvalidQuery, "of");    // Invalid query
 
             // Strip off the clause and leading WS
-            q = q.Remove(0, TokenOf.Length).TrimStart (null);
+            q = q.Remove(0, TokenOf.Length).TrimStart(null);
 
             // Next character should be "{"
             if (0 != q.IndexOf('{'))
@@ -1671,19 +1680,19 @@ namespace System.Management
                 throw new ArgumentException(SR.InvalidQuery);    // Invalid query
 
             tempSourceObject = q.Substring(0, i).TrimEnd(null);
-            q = q.Remove(0, i+1).TrimStart(null);
+            q = q.Remove(0, i + 1).TrimStart(null);
 
             // At this point we may or may not have a "where" clause
             if (0 < q.Length)
             {
                 // Next should be the "where" clause
-                if (0 != string.Compare (q, 0, TokenWhere, 0, TokenWhere.Length, StringComparison.OrdinalIgnoreCase))
+                if (0 != string.Compare(q, 0, TokenWhere, 0, TokenWhere.Length, StringComparison.OrdinalIgnoreCase))
                     throw new ArgumentException(SR.InvalidQuery, "where");    // Invalid query
 
-                q = q.Remove (0, TokenWhere.Length);
+                q = q.Remove(0, TokenWhere.Length);
 
                 // Must be some white space next
-                if ((0 == q.Length) || !char.IsWhiteSpace (q[0]))
+                if ((0 == q.Length) || !char.IsWhiteSpace(q[0]))
                     throw new ArgumentException(SR.InvalidQuery);    // Invalid query
 
                 q = q.TrimStart(null);    // Remove the leading whitespace
@@ -1701,26 +1710,26 @@ namespace System.Management
                 // Keep looking for tokens until we are done
                 while (true)
                 {
-                    if ((q.Length >= TokenResultClass.Length) && (0 == string.Compare (q, 0, TokenResultClass, 0, TokenResultClass.Length, StringComparison.OrdinalIgnoreCase)))
-                        ParseToken (ref q, TokenResultClass, "=", ref bResultClassFound, ref tempRelatedClass);
-                    else if ((q.Length >= TokenAssocClass.Length) && (0 == string.Compare (q, 0, TokenAssocClass, 0, TokenAssocClass.Length, StringComparison.OrdinalIgnoreCase)))
-                        ParseToken (ref q, TokenAssocClass, "=", ref bAssocClassFound, ref tempRelationshipClass);
-                    else if ((q.Length >= TokenResultRole.Length) && (0 == string.Compare (q, 0, TokenResultRole, 0, TokenResultRole.Length, StringComparison.OrdinalIgnoreCase)))
-                        ParseToken (ref q, TokenResultRole, "=", ref bResultRoleFound, ref tempRelatedRole);
-                    else if ((q.Length >= TokenRole.Length) && (0 == string.Compare (q, 0, TokenRole, 0, TokenRole.Length, StringComparison.OrdinalIgnoreCase)))
-                        ParseToken (ref q, TokenRole, "=", ref bRoleFound, ref tempThisRole);
-                    else if ((q.Length >= TokenRequiredQualifier.Length) && (0 == string.Compare (q, 0, TokenRequiredQualifier, 0, TokenRequiredQualifier.Length, StringComparison.OrdinalIgnoreCase)))
-                        ParseToken (ref q, TokenRequiredQualifier, "=", ref bRequiredQualifierFound, ref tempRelatedQualifier);
-                    else if ((q.Length >= TokenRequiredAssocQualifier.Length) && (0 == string.Compare (q, 0, TokenRequiredAssocQualifier, 0, TokenRequiredAssocQualifier.Length, StringComparison.OrdinalIgnoreCase)))
-                        ParseToken (ref q, TokenRequiredAssocQualifier, "=", ref bRequiredAssocQualifierFound, ref tempRelationshipQualifier);
-                    else if ((q.Length >= TokenSchemaOnly.Length) && (0 == string.Compare (q, 0, TokenSchemaOnly, 0, TokenSchemaOnly.Length, StringComparison.OrdinalIgnoreCase)))
+                    if ((q.Length >= TokenResultClass.Length) && (0 == string.Compare(q, 0, TokenResultClass, 0, TokenResultClass.Length, StringComparison.OrdinalIgnoreCase)))
+                        ParseToken(ref q, TokenResultClass, "=", ref bResultClassFound, ref tempRelatedClass);
+                    else if ((q.Length >= TokenAssocClass.Length) && (0 == string.Compare(q, 0, TokenAssocClass, 0, TokenAssocClass.Length, StringComparison.OrdinalIgnoreCase)))
+                        ParseToken(ref q, TokenAssocClass, "=", ref bAssocClassFound, ref tempRelationshipClass);
+                    else if ((q.Length >= TokenResultRole.Length) && (0 == string.Compare(q, 0, TokenResultRole, 0, TokenResultRole.Length, StringComparison.OrdinalIgnoreCase)))
+                        ParseToken(ref q, TokenResultRole, "=", ref bResultRoleFound, ref tempRelatedRole);
+                    else if ((q.Length >= TokenRole.Length) && (0 == string.Compare(q, 0, TokenRole, 0, TokenRole.Length, StringComparison.OrdinalIgnoreCase)))
+                        ParseToken(ref q, TokenRole, "=", ref bRoleFound, ref tempThisRole);
+                    else if ((q.Length >= TokenRequiredQualifier.Length) && (0 == string.Compare(q, 0, TokenRequiredQualifier, 0, TokenRequiredQualifier.Length, StringComparison.OrdinalIgnoreCase)))
+                        ParseToken(ref q, TokenRequiredQualifier, "=", ref bRequiredQualifierFound, ref tempRelatedQualifier);
+                    else if ((q.Length >= TokenRequiredAssocQualifier.Length) && (0 == string.Compare(q, 0, TokenRequiredAssocQualifier, 0, TokenRequiredAssocQualifier.Length, StringComparison.OrdinalIgnoreCase)))
+                        ParseToken(ref q, TokenRequiredAssocQualifier, "=", ref bRequiredAssocQualifierFound, ref tempRelationshipQualifier);
+                    else if ((q.Length >= TokenSchemaOnly.Length) && (0 == string.Compare(q, 0, TokenSchemaOnly, 0, TokenSchemaOnly.Length, StringComparison.OrdinalIgnoreCase)))
                     {
-                        ParseToken (ref q, TokenSchemaOnly, ref bSchemaOnlyFound);
+                        ParseToken(ref q, TokenSchemaOnly, ref bSchemaOnlyFound);
                         tempIsSchemaQuery = true;
                     }
-                    else if ((q.Length >= TokenClassDefsOnly.Length) && (0 == string.Compare (q, 0, TokenClassDefsOnly, 0, TokenClassDefsOnly.Length, StringComparison.OrdinalIgnoreCase)))
+                    else if ((q.Length >= TokenClassDefsOnly.Length) && (0 == string.Compare(q, 0, TokenClassDefsOnly, 0, TokenClassDefsOnly.Length, StringComparison.OrdinalIgnoreCase)))
                     {
-                        ParseToken (ref q, TokenClassDefsOnly, ref bClassDefsOnlyFound);
+                        ParseToken(ref q, TokenClassDefsOnly, ref bClassDefsOnlyFound);
                         tempClassDefsOnly = true;
                     }
                     else if (0 == q.Length)
@@ -1843,7 +1852,7 @@ namespace System.Management
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.RelationshipQuery'/> class. This is the default constructor.</para>
         /// </summary>
-        public RelationshipQuery() :this(null) {}
+        public RelationshipQuery() : this(null) { }
 
         //parameterized constructor
         //ISSUE : We have 2 possible constructors that take a single string :
@@ -1890,15 +1899,15 @@ namespace System.Management
 
                     // Do some basic sanity checking on whether it's a class/instance name
                     //
-                    ManagementPath p = new ManagementPath (queryOrSourceObject);
+                    ManagementPath p = new ManagementPath(queryOrSourceObject);
 
-                    if ((p.IsClass || p.IsInstance) && (p.NamespacePath.Length==0))
+                    if ((p.IsClass || p.IsInstance) && (p.NamespacePath.Length == 0))
                     {
                         SourceObject = queryOrSourceObject;
                         isSchemaQuery = false;
                     }
                     else
-                        throw new ArgumentException (SR.InvalidQuery, nameof(queryOrSourceObject));
+                        throw new ArgumentException(SR.InvalidQuery, nameof(queryOrSourceObject));
 
                 }
             }
@@ -1911,7 +1920,9 @@ namespace System.Management
         /// <param name='sourceObject'> The path of the source object for this query.</param>
         /// <param name='relationshipClass'> The type of relationship for which to query.</param>
         public RelationshipQuery(string sourceObject, string relationshipClass) : this(sourceObject, relationshipClass,
-                                                                                        null, null, false) {}
+                                                                                        null, null, false)
+        { }
+
         //Do we need additional variants of constructors here ??
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.RelationshipQuery'/> class for the given set of parameters.
@@ -2091,31 +2102,31 @@ namespace System.Management
             if (sourceObject == null)
                 SetQueryString(string.Empty);
 
-            if ((sourceObject == null) || (sourceObject.Length==0))
+            if ((sourceObject == null) || (sourceObject.Length == 0))
                 return;
 
             //"references" clause
             string s = TokenReferences + " " + TokenOf + " {" + sourceObject + "}";
 
             //If any of the other parameters are set we need a "where" clause
-            if (!(RelationshipClass.Length==0) ||
-                !(RelationshipQualifier.Length==0) ||
-                !(ThisRole.Length==0) ||
+            if (!(RelationshipClass.Length == 0) ||
+                !(RelationshipQualifier.Length == 0) ||
+                !(ThisRole.Length == 0) ||
                 classDefinitionsOnly ||
                 isSchemaQuery)
             {
                 s = s + " " + TokenWhere;
 
                 //"ResultClass"
-                if (!(RelationshipClass.Length==0))
+                if (!(RelationshipClass.Length == 0))
                     s = s + " " + TokenResultClass + " = " + relationshipClass;
 
                 //"Role"
-                if (!(ThisRole.Length==0))
+                if (!(ThisRole.Length == 0))
                     s = s + " " + TokenRole + " = " + thisRole;
 
                 //"RequiredQualifier"
-                if (!(RelationshipQualifier.Length==0))
+                if (!(RelationshipQualifier.Length == 0))
                     s = s + " " + TokenRequiredQualifier + " = " + relationshipQualifier;
 
                 //"SchemaOnly" and "ClassDefsOnly"
@@ -2132,7 +2143,7 @@ namespace System.Management
             //Set the queryString member to the built query (NB: note we set
             //by accessing the internal helper function rather than the property,
             //since we do not want to force a parse of a query we just built).
-            SetQueryString (s);
+            SetQueryString(s);
         } //BuildQuery()
 
 
@@ -2147,8 +2158,8 @@ namespace System.Management
             string tempRelationshipClass = null;
             string tempThisRole = null;
             string tempRelationshipQualifier = null;
-            bool   tempClassDefsOnly = false;
-            bool   tempSchemaOnly = false;
+            bool tempClassDefsOnly = false;
+            bool tempSchemaOnly = false;
 
             //Trim whitespaces
             string q = query.Trim();
@@ -2162,7 +2173,7 @@ namespace System.Management
             q = q.Remove(0, TokenReferences.Length);
 
             // Must be some white space next
-            if ((0 == q.Length) || !char.IsWhiteSpace (q[0]))
+            if ((0 == q.Length) || !char.IsWhiteSpace(q[0]))
                 throw new ArgumentException(SR.InvalidQuery);    // Invalid query
 
             q = q.TrimStart(null);    // Remove the leading whitespace
@@ -2172,7 +2183,7 @@ namespace System.Management
                 throw new ArgumentException(SR.InvalidQuery, "of");    // Invalid query
 
             // Strip off the clause and leading WS
-            q = q.Remove(0, TokenOf.Length).TrimStart (null);
+            q = q.Remove(0, TokenOf.Length).TrimStart(null);
 
             // Next character should be "{"
             if (0 != q.IndexOf('{'))
@@ -2186,19 +2197,19 @@ namespace System.Management
                 throw new ArgumentException(SR.InvalidQuery);    // Invalid query
 
             tempSourceObject = q.Substring(0, i).TrimEnd(null);
-            q = q.Remove(0, i+1).TrimStart(null);
+            q = q.Remove(0, i + 1).TrimStart(null);
 
             // At this point we may or may not have a "where" clause
             if (0 < q.Length)
             {
                 // Next should be the "where" clause
-                if (0 != string.Compare (q, 0, TokenWhere, 0, TokenWhere.Length, StringComparison.OrdinalIgnoreCase))
+                if (0 != string.Compare(q, 0, TokenWhere, 0, TokenWhere.Length, StringComparison.OrdinalIgnoreCase))
                     throw new ArgumentException(SR.InvalidQuery, "where");    // Invalid query
 
-                q = q.Remove (0, TokenWhere.Length);
+                q = q.Remove(0, TokenWhere.Length);
 
                 // Must be some white space next
-                if ((0 == q.Length) || !char.IsWhiteSpace (q[0]))
+                if ((0 == q.Length) || !char.IsWhiteSpace(q[0]))
                     throw new ArgumentException(SR.InvalidQuery);    // Invalid query
 
                 q = q.TrimStart(null);    // Remove the leading whitespace
@@ -2213,20 +2224,20 @@ namespace System.Management
                 // Keep looking for tokens until we are done
                 while (true)
                 {
-                    if ((q.Length >= TokenResultClass.Length) && (0 == string.Compare (q, 0, TokenResultClass, 0, TokenResultClass.Length, StringComparison.OrdinalIgnoreCase)))
-                        ParseToken (ref q, TokenResultClass, "=", ref bResultClassFound, ref tempRelationshipClass);
-                    else if ((q.Length >= TokenRole.Length) && (0 == string.Compare (q, 0, TokenRole, 0, TokenRole.Length, StringComparison.OrdinalIgnoreCase)))
-                        ParseToken (ref q, TokenRole, "=", ref bRoleFound, ref tempThisRole);
-                    else if ((q.Length >= TokenRequiredQualifier.Length) && (0 == string.Compare (q, 0, TokenRequiredQualifier, 0, TokenRequiredQualifier.Length, StringComparison.OrdinalIgnoreCase)))
-                        ParseToken (ref q, TokenRequiredQualifier, "=", ref bRequiredQualifierFound, ref tempRelationshipQualifier);
-                    else if ((q.Length >= TokenClassDefsOnly.Length) && (0 == string.Compare (q, 0, TokenClassDefsOnly, 0, TokenClassDefsOnly.Length, StringComparison.OrdinalIgnoreCase)))
+                    if ((q.Length >= TokenResultClass.Length) && (0 == string.Compare(q, 0, TokenResultClass, 0, TokenResultClass.Length, StringComparison.OrdinalIgnoreCase)))
+                        ParseToken(ref q, TokenResultClass, "=", ref bResultClassFound, ref tempRelationshipClass);
+                    else if ((q.Length >= TokenRole.Length) && (0 == string.Compare(q, 0, TokenRole, 0, TokenRole.Length, StringComparison.OrdinalIgnoreCase)))
+                        ParseToken(ref q, TokenRole, "=", ref bRoleFound, ref tempThisRole);
+                    else if ((q.Length >= TokenRequiredQualifier.Length) && (0 == string.Compare(q, 0, TokenRequiredQualifier, 0, TokenRequiredQualifier.Length, StringComparison.OrdinalIgnoreCase)))
+                        ParseToken(ref q, TokenRequiredQualifier, "=", ref bRequiredQualifierFound, ref tempRelationshipQualifier);
+                    else if ((q.Length >= TokenClassDefsOnly.Length) && (0 == string.Compare(q, 0, TokenClassDefsOnly, 0, TokenClassDefsOnly.Length, StringComparison.OrdinalIgnoreCase)))
                     {
-                        ParseToken (ref q, TokenClassDefsOnly, ref bClassDefsOnlyFound);
+                        ParseToken(ref q, TokenClassDefsOnly, ref bClassDefsOnlyFound);
                         tempClassDefsOnly = true;
                     }
-                    else if ((q.Length >= TokenSchemaOnly.Length) && (0 == string.Compare (q, 0, TokenSchemaOnly, 0, TokenSchemaOnly.Length, StringComparison.OrdinalIgnoreCase)))
+                    else if ((q.Length >= TokenSchemaOnly.Length) && (0 == string.Compare(q, 0, TokenSchemaOnly, 0, TokenSchemaOnly.Length, StringComparison.OrdinalIgnoreCase)))
                     {
-                        ParseToken (ref q, TokenSchemaOnly, ref bSchemaOnlyFound);
+                        ParseToken(ref q, TokenSchemaOnly, ref bSchemaOnlyFound);
                         tempSchemaOnly = true;
                     }
                     else if (0 == q.Length)
@@ -2432,7 +2443,7 @@ namespace System.Management
         /// class. This is the default
         /// constructor.</para>
         /// </summary>
-        public WqlEventQuery() : this(null, TimeSpan.Zero, null, TimeSpan.Zero, null, null) {}
+        public WqlEventQuery() : this(null, TimeSpan.Zero, null, TimeSpan.Zero, null, null) { }
 
         //parameterized constructors
         //ISSUE : We have 2 possible constructors that take a single string :
@@ -2476,14 +2487,14 @@ namespace System.Management
                 {
                     // Do some basic sanity checking on whether it's a class name
                     //
-                    ManagementPath p = new ManagementPath (queryOrEventClassName);
+                    ManagementPath p = new ManagementPath(queryOrEventClassName);
 
-                    if (p.IsClass && (p.NamespacePath.Length==0))
+                    if (p.IsClass && (p.NamespacePath.Length == 0))
                     {
                         EventClassName = queryOrEventClassName;
                     }
                     else
-                        throw new ArgumentException (SR.InvalidQuery, nameof(queryOrEventClassName));
+                        throw new ArgumentException(SR.InvalidQuery, nameof(queryOrEventClassName));
                 }
             }
         }
@@ -2507,7 +2518,7 @@ namespace System.Management
         /// Dim q As New WqlEventQuery("MyEvent", "FirstProp &lt; 20 and SecondProp = 'red'")
         ///    </code>
         /// </example>
-        public WqlEventQuery(string eventClassName, string condition) : this(eventClassName, TimeSpan.Zero, condition, TimeSpan.Zero, null, null) {}
+        public WqlEventQuery(string eventClassName, string condition) : this(eventClassName, TimeSpan.Zero, condition, TimeSpan.Zero, null, null) { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.WqlEventQuery'/>
@@ -2531,8 +2542,9 @@ namespace System.Management
         /// Dim q As New WqlEventQuery("__InstanceCreationEvent", t)
         ///    </code>
         /// </example>
-        public WqlEventQuery(string eventClassName, TimeSpan withinInterval):
-                                        this(eventClassName, withinInterval, null, TimeSpan.Zero, null, null) {}
+        public WqlEventQuery(string eventClassName, TimeSpan withinInterval) :
+                                        this(eventClassName, withinInterval, null, TimeSpan.Zero, null, null)
+        { }
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.WqlEventQuery'/>
         /// class with the specified
@@ -2563,7 +2575,8 @@ namespace System.Management
         ///    </code>
         /// </example>
         public WqlEventQuery(string eventClassName, TimeSpan withinInterval, string condition) :
-                                        this(eventClassName, withinInterval, condition, TimeSpan.Zero, null, null) {}
+                                        this(eventClassName, withinInterval, condition, TimeSpan.Zero, null, null)
+        { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.WqlEventQuery'/>
@@ -2594,7 +2607,8 @@ namespace System.Management
         ///    </code>
         /// </example>
         public WqlEventQuery(string eventClassName, string condition, TimeSpan groupWithinInterval) :
-                                        this(eventClassName, TimeSpan.Zero, condition, groupWithinInterval, null, null) {}
+                                        this(eventClassName, TimeSpan.Zero, condition, groupWithinInterval, null, null)
+        { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.WqlEventQuery'/>
@@ -2632,7 +2646,8 @@ namespace System.Management
         /// </code>
         /// </example>
         public WqlEventQuery(string eventClassName, string condition, TimeSpan groupWithinInterval, string[] groupByPropertyList) :
-            this(eventClassName, TimeSpan.Zero, condition, groupWithinInterval, groupByPropertyList, null) {}
+            this(eventClassName, TimeSpan.Zero, condition, groupWithinInterval, groupByPropertyList, null)
+        { }
 
         /// <summary>
         /// <para> Initializes a new instance of the <see cref='System.Management.WqlEventQuery'/>
@@ -2678,10 +2693,10 @@ namespace System.Management
             this.withinInterval = withinInterval;
             this.condition = condition;
             this.groupWithinInterval = groupWithinInterval;
-            this.groupByPropertyList = new StringCollection ();
+            this.groupByPropertyList = new StringCollection();
 
             if (null != groupByPropertyList)
-                this.groupByPropertyList.AddRange (groupByPropertyList);
+                this.groupByPropertyList.AddRange(groupByPropertyList);
 
             this.havingCondition = havingCondition;
             BuildQuery();
@@ -2699,7 +2714,7 @@ namespace System.Management
         public override string QueryLanguage
         {
             get
-            {return base.QueryLanguage; }
+            { return base.QueryLanguage; }
         }
 
         /// <summary>
@@ -2714,7 +2729,7 @@ namespace System.Management
             {
                 // We need to force a rebuild as we may not have detected
                 // a change to selected properties
-                BuildQuery ();
+                BuildQuery();
                 return base.QueryString;
             }
             set
@@ -2892,13 +2907,14 @@ namespace System.Management
         public StringCollection GroupByPropertyList
         {
             get { return groupByPropertyList; }
-            set {
+            set
+            {
                 // A tad painful since StringCollection doesn't support ICloneable
                 StringCollection src = (StringCollection)value;
-                StringCollection dst = new StringCollection ();
+                StringCollection dst = new StringCollection();
 
                 foreach (string s in src)
-                    dst.Add (s);
+                    dst.Add(s);
 
                 groupByPropertyList = dst;
                 BuildQuery();
@@ -2950,9 +2966,9 @@ namespace System.Management
         {
             //If the event class name is not set we can't build a query
             //This shouldn't throw because the user may be in the process of setting properties...
-            if ((eventClassName == null) || (eventClassName.Length==0))
+            if ((eventClassName == null) || (eventClassName.Length == 0))
             {
-                SetQueryString (string.Empty);
+                SetQueryString(string.Empty);
                 return;
             }
 
@@ -2967,7 +2983,7 @@ namespace System.Management
                 s = s + " within " + withinInterval.TotalSeconds.ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(double)));
 
             //Where clause
-            if (!(Condition.Length==0))
+            if (!(Condition.Length == 0))
                 s = s + " where " + condition;
 
             //Group within clause
@@ -2981,12 +2997,12 @@ namespace System.Management
                     int count = groupByPropertyList.Count;
                     s = s + " by ";
 
-                    for (int i=0; i<count; i++)
+                    for (int i = 0; i < count; i++)
                         s = s + groupByPropertyList[i] + (i == (count - 1) ? "" : ",");
                 }
 
                 //Having clause
-                if (!(HavingCondition.Length==0))
+                if (!(HavingCondition.Length == 0))
                 {
                     s = s + " having " + havingCondition;
                 }
@@ -2995,7 +3011,7 @@ namespace System.Management
             //Set the queryString member to the built query (NB: note we set
             //by accessing the internal helper function rather than the property,
             //since we do not want to force a parse of a query we just built).
-            SetQueryString (s);
+            SetQueryString(s);
 
         }//BuildQuery
 
@@ -3022,23 +3038,23 @@ namespace System.Management
 
             //Find "select" clause and make sure it's a select *
             string keyword = TokenSelect;
-            if ((q.Length < keyword.Length) || (0 != string.Compare (q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
+            if ((q.Length < keyword.Length) || (0 != string.Compare(q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
                 throw new ArgumentException(SR.InvalidQuery);
-            q =    q.Remove(0, keyword.Length).TrimStart(null);
+            q = q.Remove(0, keyword.Length).TrimStart(null);
 
             if (!q.StartsWith("*", StringComparison.Ordinal))
-                    throw new ArgumentException(SR.InvalidQuery, "*");
+                throw new ArgumentException(SR.InvalidQuery, "*");
             q = q.Remove(0, 1).TrimStart(null);
 
             //Find "from" clause
             keyword = "from ";
-            if ((q.Length < keyword.Length) || (0 != string.Compare (q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
+            if ((q.Length < keyword.Length) || (0 != string.Compare(q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
                 throw new ArgumentException(SR.InvalidQuery, "from");
             ParseToken(ref q, keyword, null, ref bFound, ref eventClassName);
 
             //Find "within" clause
             keyword = "within ";
-            if ((q.Length >= keyword.Length) && (0 == string.Compare (q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
+            if ((q.Length >= keyword.Length) && (0 == string.Compare(q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
             {
                 string intervalString = null; bFound = false;
                 ParseToken(ref q, keyword, null, ref bFound, ref intervalString);
@@ -3053,19 +3069,19 @@ namespace System.Management
                 w = q.Substring(0, i).Trim();
                 q = q.Remove(0, i);
 
-                string intervalString = null; bFound=false;
+                string intervalString = null; bFound = false;
                 ParseToken(ref q, keyword, null, ref bFound, ref intervalString);
                 groupWithinInterval = TimeSpan.FromSeconds(((IConvertible)intervalString).ToDouble(null));
 
                 //Find "By" subclause
                 keyword = "by ";
-                if ((q.Length >= keyword.Length) && (0 == string.Compare (q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
+                if ((q.Length >= keyword.Length) && (0 == string.Compare(q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
                 {
                     q = q.Remove(0, keyword.Length);
                     if (null != groupByPropertyList)
-                        groupByPropertyList.Clear ();
+                        groupByPropertyList.Clear();
                     else
-                        groupByPropertyList = new StringCollection ();
+                        groupByPropertyList = new StringCollection();
 
                     //get the property list
                     while (true)
@@ -3073,9 +3089,9 @@ namespace System.Management
                         if ((i = q.IndexOf(',')) > 0)
                         {
                             tempProp = q.Substring(0, i);
-                            q = q.Remove(0, i+1).TrimStart(null);
+                            q = q.Remove(0, i + 1).TrimStart(null);
                             tempProp = tempProp.Trim();
-                            if (tempProp.Length>0)
+                            if (tempProp.Length > 0)
                                 groupByPropertyList.Add(tempProp);
                         }
                         else
@@ -3098,7 +3114,7 @@ namespace System.Management
 
                 //Find "Having" subclause
                 keyword = "having "; bFound = false;
-                if ((q.Length >= keyword.Length) && (0 == string.Compare (q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
+                if ((q.Length >= keyword.Length) && (0 == string.Compare(q, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase)))
                 {   //the rest until the end is assumed to be the having condition
                     q = q.Remove(0, keyword.Length);
 
@@ -3114,7 +3130,7 @@ namespace System.Management
 
             //Find "where" clause
             keyword = "where ";
-            if ((w.Length >= keyword.Length) && (0 == string.Compare (w, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase))) //where clause exists
+            if ((w.Length >= keyword.Length) && (0 == string.Compare(w, 0, keyword, 0, keyword.Length, StringComparison.OrdinalIgnoreCase))) //where clause exists
             {
                 condition = w.Substring(keyword.Length);
             }
@@ -3139,8 +3155,8 @@ namespace System.Management
 
                 if (0 < count)
                 {
-                    strArray = new string [count];
-                    groupByPropertyList.CopyTo (strArray, 0);
+                    strArray = new string[count];
+                    groupByPropertyList.CopyTo(strArray, 0);
                 }
             }
 
@@ -3214,20 +3230,20 @@ namespace System.Management
             if (value is EventQuery && destinationType == typeof(InstanceDescriptor))
             {
                 EventQuery obj = ((EventQuery)(value));
-                ConstructorInfo ctor = typeof(EventQuery).GetConstructor(new Type[] {typeof(string)});
+                ConstructorInfo ctor = typeof(EventQuery).GetConstructor(new Type[] { typeof(string) });
                 if (ctor != null)
                 {
-                    return new InstanceDescriptor(ctor, new object[] {obj.QueryString});
+                    return new InstanceDescriptor(ctor, new object[] { obj.QueryString });
                 }
             }
 
             if (value is ObjectQuery && destinationType == typeof(InstanceDescriptor))
             {
                 ObjectQuery obj = ((ObjectQuery)(value));
-                ConstructorInfo ctor = typeof(ObjectQuery).GetConstructor(new Type[] {typeof(string)});
+                ConstructorInfo ctor = typeof(ObjectQuery).GetConstructor(new Type[] { typeof(string) });
                 if (ctor != null)
                 {
-                    return new InstanceDescriptor(ctor, new object[] {obj.QueryString});
+                    return new InstanceDescriptor(ctor, new object[] { obj.QueryString });
                 }
             }
             return base.ConvertTo(context, culture, value, destinationType);
index bc7bcd2..a071035 100644 (file)
@@ -16,7 +16,7 @@ namespace System.Management
     internal static class CompatSwitches
     {
         internal const string DotNetVersion = "v4.0.30319";
-        private const string RegKeyLocation =@"SOFTWARE\Microsoft\.NETFramework\" + DotNetVersion;
+        private const string RegKeyLocation = @"SOFTWARE\Microsoft\.NETFramework\" + DotNetVersion;
 
         private static readonly object s_syncLock = new object();
         private static int s_allowManagementObjectQI;
@@ -44,40 +44,40 @@ namespace System.Management
 
         private static bool GetSwitchValueFromRegistry()
         {
-           RegistryKey s_switchesRegKey = null;
-           try
-           {
-              s_switchesRegKey = Registry.LocalMachine.OpenSubKey(RegKeyLocation);
-
-              if (s_switchesRegKey == null)
-              {
-                  return false;
-              }
-
-              return ((int)s_switchesRegKey.GetValue(c_WMIDisableCOMSecurity, -1 /* default */) == 1);
-           }
-
-           // ignore exceptions so that we don't crash the process if we can't read the switch value
-           catch (Exception e)
-           {
-               if (e is StackOverflowException ||
-                   e is OutOfMemoryException ||
-                   e is System.Threading.ThreadAbortException ||
-                   e is AccessViolationException)
-                   throw;
-           }
-           finally
-           {
-               // dispose of the key
-               if (s_switchesRegKey != null)
-               {
-                   s_switchesRegKey.Dispose();
-               }
-           }
-
-           // if for any reason we cannot retrieve the value of the switch from the Registry,
-           // fallback to 'false' which is the secure behavior
-           return false;
+            RegistryKey s_switchesRegKey = null;
+            try
+            {
+                s_switchesRegKey = Registry.LocalMachine.OpenSubKey(RegKeyLocation);
+
+                if (s_switchesRegKey == null)
+                {
+                    return false;
+                }
+
+                return ((int)s_switchesRegKey.GetValue(c_WMIDisableCOMSecurity, -1 /* default */) == 1);
+            }
+
+            // ignore exceptions so that we don't crash the process if we can't read the switch value
+            catch (Exception e)
+            {
+                if (e is StackOverflowException ||
+                    e is OutOfMemoryException ||
+                    e is System.Threading.ThreadAbortException ||
+                    e is AccessViolationException)
+                    throw;
+            }
+            finally
+            {
+                // dispose of the key
+                if (s_switchesRegKey != null)
+                {
+                    s_switchesRegKey.Dispose();
+                }
+            }
+
+            // if for any reason we cannot retrieve the value of the switch from the Registry,
+            // fallback to 'false' which is the secure behavior
+            return false;
         }
     }
 
@@ -86,140 +86,140 @@ namespace System.Management
         internal delegate int ResetSecurity(IntPtr hToken);
         internal delegate int SetSecurity([In][Out] ref bool pNeedtoReset, [In][Out] ref IntPtr pHandle);
         internal delegate int BlessIWbemServices([MarshalAs(UnmanagedType.Interface)] IWbemServices pIUnknown,
-                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strUser,
+                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string strUser,
                                                                         IntPtr password,
-                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority,
+                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string strAuthority,
                                                                         int impersonationLevel,
                                                                         int authenticationLevel);
         internal delegate int BlessIWbemServicesObject([MarshalAs(UnmanagedType.IUnknown)] object pIUnknown,
-                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strUser,
+                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string strUser,
                                                                         IntPtr password,
-                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority,
+                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string strAuthority,
                                                                         int impersonationLevel,
                                                                         int authenticationLevel);
 
-         internal delegate int GetPropertyHandle(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszPropertyName, [Out] out int pType, [Out] out int plHandle);
-         internal delegate int WritePropertyValue(int vFunc, IntPtr pWbemClassObject, [In] int lHandle, [In] int lNumBytes, [In][MarshalAs(UnmanagedType.LPWStr)] string str);
-         internal delegate int GetQualifierSet(int vFunc, IntPtr pWbemClassObject, [Out] out IntPtr ppQualSet);
-         internal delegate int Get(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
-         internal delegate int Put(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In] ref object pVal, [In] int Type);
-         internal delegate int Delete(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName);
-         internal delegate int GetNames(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszQualifierName, [In] int lFlags, [In] ref object pQualifierVal, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_BSTR)]  out string[]   pNames);
-         internal delegate int BeginEnumeration(int vFunc, IntPtr pWbemClassObject, [In] int lEnumFlags);
-         internal delegate int Next(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string   strName, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
-         internal delegate int EndEnumeration(int vFunc, IntPtr pWbemClassObject);
-         internal delegate int GetPropertyQualifierSet(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszProperty, [Out] out IntPtr ppQualSet);
-         internal delegate int Clone(int vFunc, IntPtr pWbemClassObject, [Out] out IntPtr ppCopy);
-         internal delegate int GetObjectText(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrObjectText);
-         internal delegate int SpawnDerivedClass(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out] out IntPtr ppNewClass);
-         internal delegate int SpawnInstance(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out] out IntPtr ppNewInstance);
-         internal delegate int CompareTo(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [In] IntPtr pCompareTo);
-         internal delegate int GetPropertyOrigin(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrClassName);
-         internal delegate int InheritsFrom(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   strAncestor);
-         internal delegate int GetMethod(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [Out]out IntPtr ppInSignature, [Out] out IntPtr ppOutSignature);
-         internal delegate int PutMethod(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In] IntPtr pInSignature, [In] IntPtr pOutSignature);
-         internal delegate int DeleteMethod(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName);
-         internal delegate int BeginMethodEnumeration(int vFunc, IntPtr pWbemClassObject, [In] int lEnumFlags);
-         internal delegate int NextMethod(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)] out string pstrName, [Out] out IntPtr ppInSignature, [Out] out IntPtr ppOutSignature);
-         internal delegate int EndMethodEnumeration(int vFunc, IntPtr pWbemClassObject);
-         internal delegate int GetMethodQualifierSet(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszMethod, [Out] out IntPtr ppQualSet);
-         internal delegate int GetMethodOrigin(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszMethodName, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrClassName);
-         internal delegate int QualifierSet_Get(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] int lFlags, [In][Out] ref object pVal, [In][Out] ref int plFlavor);
-         internal delegate int QualifierSet_Put(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName, [In] ref object pVal, [In] int lFlavor);
-         internal delegate int QualifierSet_Delete(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string   wszName);
-         internal delegate int QualifierSet_GetNames(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_BSTR)]  out string[]   pNames);
-         internal delegate int QualifierSet_BeginEnumeration(int vFunc, IntPtr pWbemClassObject, [In] int lFlags);
-         internal delegate int QualifierSet_Next(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string   pstrName, [Out] out object pVal, [Out] out int plFlavor);
-         internal delegate int QualifierSet_EndEnumeration(int vFunc, IntPtr pWbemClassObject);
-         internal delegate int GetCurrentApartmentType(int vFunc, IntPtr pComThreadingInfo, [Out] out APTTYPE aptType);
-         internal delegate void VerifyClientKey();
-         internal delegate int  GetDemultiplexedStub([In, MarshalAs(UnmanagedType.IUnknown)]object pIUnknown, [In]bool isLocal, [Out, MarshalAs(UnmanagedType.IUnknown)]out object ppIUnknown);
-         internal delegate int CreateInstanceEnumWmi([In][MarshalAs(UnmanagedType.BStr)]  string   strFilter,
-                                                                                            [In] int lFlags,
-                                                                                            [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx,
-                                                                                            [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum,
-                                                                                            [In] int impLevel,
-                                                                                            [In] int authnLevel,
-                                                                                            [In] [MarshalAs(UnmanagedType.Interface)] IWbemServices pCurrentNamespace,
-                                                                                            [In][MarshalAs(UnmanagedType.BStr)]  string   strUser,
-                                                                                            [In]IntPtr   strPassword,
-                                                                                            [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority
-                                                                                            );
-         internal delegate int CreateClassEnumWmi([In][MarshalAs(UnmanagedType.BStr)]  string   strSuperclass,
-                                                                                        [In] int lFlags,
-                                                                                        [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx,
-                                                                                        [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum,
-                                                                                        [In] int impLevel,
-                                                                                        [In] int authnLevel,
-                                                                                        [In] [MarshalAs(UnmanagedType.Interface)] IWbemServices pCurrentNamespace,
-                                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strUser,
-                                                                                        [In]IntPtr   strPassword,
-                                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority
-                                                                                        );
-         internal delegate int ExecQueryWmi([In][MarshalAs(UnmanagedType.BStr)]  string   strQueryLanguage,
-                                                                            [In][MarshalAs(UnmanagedType.BStr)]  string   strQuery,
-                                                                            [In] int lFlags,
-                                                                            [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx,
-                                                                            [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum,
-                                                                            [In] int impLevel,
-                                                                            [In] int authnLevel,
-                                                                            [In] [MarshalAs(UnmanagedType.Interface)] IWbemServices pCurrentNamespace,
-                                                                            [In][MarshalAs(UnmanagedType.BStr)]  string   strUser,
-                                                                            [In]IntPtr   strPassword,
-                                                                            [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority
-                                                                            );
-        internal delegate int ExecNotificationQueryWmi( [In][MarshalAs(UnmanagedType.BStr)]  string   strQueryLanguage,
-                                                                                                [In][MarshalAs(UnmanagedType.BStr)]  string   strQuery,
+        internal delegate int GetPropertyHandle(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszPropertyName, [Out] out int pType, [Out] out int plHandle);
+        internal delegate int WritePropertyValue(int vFunc, IntPtr pWbemClassObject, [In] int lHandle, [In] int lNumBytes, [In][MarshalAs(UnmanagedType.LPWStr)] string str);
+        internal delegate int GetQualifierSet(int vFunc, IntPtr pWbemClassObject, [Out] out IntPtr ppQualSet);
+        internal delegate int Get(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszName, [In] int lFlags, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
+        internal delegate int Put(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszName, [In] int lFlags, [In] ref object pVal, [In] int Type);
+        internal delegate int Delete(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszName);
+        internal delegate int GetNames(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszQualifierName, [In] int lFlags, [In] ref object pQualifierVal, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]  out string[] pNames);
+        internal delegate int BeginEnumeration(int vFunc, IntPtr pWbemClassObject, [In] int lEnumFlags);
+        internal delegate int Next(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [In][Out][MarshalAs(UnmanagedType.BStr)]  ref string strName, [In][Out] ref object pVal, [In][Out] ref int pType, [In][Out] ref int plFlavor);
+        internal delegate int EndEnumeration(int vFunc, IntPtr pWbemClassObject);
+        internal delegate int GetPropertyQualifierSet(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszProperty, [Out] out IntPtr ppQualSet);
+        internal delegate int Clone(int vFunc, IntPtr pWbemClassObject, [Out] out IntPtr ppCopy);
+        internal delegate int GetObjectText(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrObjectText);
+        internal delegate int SpawnDerivedClass(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out] out IntPtr ppNewClass);
+        internal delegate int SpawnInstance(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out] out IntPtr ppNewInstance);
+        internal delegate int CompareTo(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [In] IntPtr pCompareTo);
+        internal delegate int GetPropertyOrigin(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszName, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrClassName);
+        internal delegate int InheritsFrom(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string strAncestor);
+        internal delegate int GetMethod(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszName, [In] int lFlags, [Out]out IntPtr ppInSignature, [Out] out IntPtr ppOutSignature);
+        internal delegate int PutMethod(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszName, [In] int lFlags, [In] IntPtr pInSignature, [In] IntPtr pOutSignature);
+        internal delegate int DeleteMethod(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszName);
+        internal delegate int BeginMethodEnumeration(int vFunc, IntPtr pWbemClassObject, [In] int lEnumFlags);
+        internal delegate int NextMethod(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)] out string pstrName, [Out] out IntPtr ppInSignature, [Out] out IntPtr ppOutSignature);
+        internal delegate int EndMethodEnumeration(int vFunc, IntPtr pWbemClassObject);
+        internal delegate int GetMethodQualifierSet(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszMethod, [Out] out IntPtr ppQualSet);
+        internal delegate int GetMethodOrigin(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszMethodName, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrClassName);
+        internal delegate int QualifierSet_Get(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszName, [In] int lFlags, [In][Out] ref object pVal, [In][Out] ref int plFlavor);
+        internal delegate int QualifierSet_Put(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszName, [In] ref object pVal, [In] int lFlavor);
+        internal delegate int QualifierSet_Delete(int vFunc, IntPtr pWbemClassObject, [In][MarshalAs(UnmanagedType.LPWStr)]  string wszName);
+        internal delegate int QualifierSet_GetNames(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out][MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]  out string[] pNames);
+        internal delegate int QualifierSet_BeginEnumeration(int vFunc, IntPtr pWbemClassObject, [In] int lFlags);
+        internal delegate int QualifierSet_Next(int vFunc, IntPtr pWbemClassObject, [In] int lFlags, [Out][MarshalAs(UnmanagedType.BStr)]  out string pstrName, [Out] out object pVal, [Out] out int plFlavor);
+        internal delegate int QualifierSet_EndEnumeration(int vFunc, IntPtr pWbemClassObject);
+        internal delegate int GetCurrentApartmentType(int vFunc, IntPtr pComThreadingInfo, [Out] out APTTYPE aptType);
+        internal delegate void VerifyClientKey();
+        internal delegate int GetDemultiplexedStub([In, MarshalAs(UnmanagedType.IUnknown)]object pIUnknown, [In]bool isLocal, [Out, MarshalAs(UnmanagedType.IUnknown)]out object ppIUnknown);
+        internal delegate int CreateInstanceEnumWmi([In][MarshalAs(UnmanagedType.BStr)]  string strFilter,
+                                                                                           [In] int lFlags,
+                                                                                           [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx,
+                                                                                           [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum,
+                                                                                           [In] int impLevel,
+                                                                                           [In] int authnLevel,
+                                                                                           [In] [MarshalAs(UnmanagedType.Interface)] IWbemServices pCurrentNamespace,
+                                                                                           [In][MarshalAs(UnmanagedType.BStr)]  string strUser,
+                                                                                           [In]IntPtr strPassword,
+                                                                                           [In][MarshalAs(UnmanagedType.BStr)]  string strAuthority
+                                                                                           );
+        internal delegate int CreateClassEnumWmi([In][MarshalAs(UnmanagedType.BStr)]  string strSuperclass,
+                                                                                       [In] int lFlags,
+                                                                                       [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx,
+                                                                                       [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum,
+                                                                                       [In] int impLevel,
+                                                                                       [In] int authnLevel,
+                                                                                       [In] [MarshalAs(UnmanagedType.Interface)] IWbemServices pCurrentNamespace,
+                                                                                       [In][MarshalAs(UnmanagedType.BStr)]  string strUser,
+                                                                                       [In]IntPtr strPassword,
+                                                                                       [In][MarshalAs(UnmanagedType.BStr)]  string strAuthority
+                                                                                       );
+        internal delegate int ExecQueryWmi([In][MarshalAs(UnmanagedType.BStr)]  string strQueryLanguage,
+                                                                           [In][MarshalAs(UnmanagedType.BStr)]  string strQuery,
+                                                                           [In] int lFlags,
+                                                                           [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx,
+                                                                           [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum,
+                                                                           [In] int impLevel,
+                                                                           [In] int authnLevel,
+                                                                           [In] [MarshalAs(UnmanagedType.Interface)] IWbemServices pCurrentNamespace,
+                                                                           [In][MarshalAs(UnmanagedType.BStr)]  string strUser,
+                                                                           [In]IntPtr strPassword,
+                                                                           [In][MarshalAs(UnmanagedType.BStr)]  string strAuthority
+                                                                           );
+        internal delegate int ExecNotificationQueryWmi([In][MarshalAs(UnmanagedType.BStr)]  string strQueryLanguage,
+                                                                                                [In][MarshalAs(UnmanagedType.BStr)]  string strQuery,
                                                                                                 [In] int lFlags,
-                                                                                                [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx,
-                                                                                                [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum,
+                                                                                                [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx,
+                                                                                                [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum,
                                                                                                 [In] int impLevel,
                                                                                                 [In] int authnLevel,
                                                                                                 [In] [MarshalAs(UnmanagedType.Interface)] IWbemServices pCurrentNamespace,
-                                                                                                [In][MarshalAs(UnmanagedType.BStr)]  string   strUser,
-                                                                                                [In]IntPtr   strPassword,
-                                                                                                [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority
+                                                                                                [In][MarshalAs(UnmanagedType.BStr)]  string strUser,
+                                                                                                [In]IntPtr strPassword,
+                                                                                                [In][MarshalAs(UnmanagedType.BStr)]  string strAuthority
                                                                                                 );
         internal delegate int PutInstanceWmi([In] IntPtr pInst,
                                                                             [In] int lFlags,
-                                                                            [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx,
+                                                                            [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx,
                                                                             [In] IntPtr ppCallResult,
                                                                             [In] int impLevel,
                                                                             [In] int authnLevel,
                                                                             [In] [MarshalAs(UnmanagedType.Interface)] IWbemServices pCurrentNamespace,
-                                                                            [In][MarshalAs(UnmanagedType.BStr)]  string   strUser,
-                                                                            [In]IntPtr   strPassword,
-                                                                            [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority
+                                                                            [In][MarshalAs(UnmanagedType.BStr)]  string strUser,
+                                                                            [In]IntPtr strPassword,
+                                                                            [In][MarshalAs(UnmanagedType.BStr)]  string strAuthority
                                                                             );
         internal delegate int PutClassWmi([In] IntPtr pObject,
                                                                         [In] int lFlags,
-                                                                        [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx,
+                                                                        [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx,
                                                                         [In] IntPtr ppCallResult,
                                                                         [In] int impLevel,
                                                                         [In] int authnLevel,
                                                                         [In] [MarshalAs(UnmanagedType.Interface)] IWbemServices pCurrentNamespace,
-                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strUser,
-                                                                        [In]IntPtr   strPassword,
-                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority
+                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string strUser,
+                                                                        [In]IntPtr strPassword,
+                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string strAuthority
                                                                         );
         internal delegate int CloneEnumWbemClassObject(
-                                                                [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject   ppEnum,
+                                                                [Out][MarshalAs(UnmanagedType.Interface)]  out IEnumWbemClassObject ppEnum,
                                                                 [In] int impLevel,
                                                                 [In] int authnLevel,
                                                                 [In] [MarshalAs(UnmanagedType.Interface)] IEnumWbemClassObject pCurrentEnumWbemClassObject,
-                                                                [In][MarshalAs(UnmanagedType.BStr)]  string   strUser,
-                                                                [In]IntPtr   strPassword,
-                                                                [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority
+                                                                [In][MarshalAs(UnmanagedType.BStr)]  string strUser,
+                                                                [In]IntPtr strPassword,
+                                                                [In][MarshalAs(UnmanagedType.BStr)]  string strAuthority
                                                                 );
         internal delegate int ConnectServerWmi(
-                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strNetworkResource,
-                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strUser,
+                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string strNetworkResource,
+                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string strUser,
                                                                         [In]  IntPtr strPassword,
-                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strLocale,
+                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string strLocale,
                                                                         [In] int lSecurityFlags,
-                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string   strAuthority,
-                                                                        [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext   pCtx,
-                                                                        [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemServices   ppNamespace,
+                                                                        [In][MarshalAs(UnmanagedType.BStr)]  string strAuthority,
+                                                                        [In][MarshalAs(UnmanagedType.Interface)]  IWbemContext pCtx,
+                                                                        [Out][MarshalAs(UnmanagedType.Interface)]  out IWbemServices ppNamespace,
                                                                         int impersonationLevel,
                                                                         int authenticationLevel);
 
@@ -231,12 +231,12 @@ namespace System.Management
 
 
         // 'Apartment Type' returned by IComThreadingInfo::GetCurrentApartmentType()
-         internal enum APTTYPE
+        internal enum APTTYPE
         {
             APTTYPE_CURRENT = -1,
             APTTYPE_STA = 0,
             APTTYPE_MTA = 1,
-            APTTYPE_NA  = 2,
+            APTTYPE_NA = 2,
             APTTYPE_MAINSTA = 3
         }
         internal static ResetSecurity ResetSecurity_f;
@@ -244,7 +244,7 @@ namespace System.Management
         internal static BlessIWbemServices BlessIWbemServices_f;
         internal static BlessIWbemServicesObject BlessIWbemServicesObject_f;
         internal static GetPropertyHandle GetPropertyHandle_f27;
-        internal static WritePropertyValue  WritePropertyValue_f28;
+        internal static WritePropertyValue WritePropertyValue_f28;
         internal static GetQualifierSet GetQualifierSet_f;
         internal static Get Get_f;
         internal static Put Put_f;
@@ -282,7 +282,7 @@ namespace System.Management
         internal static GetDemultiplexedStub GetDemultiplexedStub_f;
         internal static CreateInstanceEnumWmi CreateInstanceEnumWmi_f;
         internal static CreateClassEnumWmi CreateClassEnumWmi_f;
-        internal static  ExecQueryWmi ExecQueryWmi_f;
+        internal static ExecQueryWmi ExecQueryWmi_f;
         internal static ExecNotificationQueryWmi ExecNotificationQueryWmi_f;
         internal static PutInstanceWmi PutInstanceWmi_f;
         internal static PutClassWmi PutClassWmi_f;
@@ -311,7 +311,7 @@ namespace System.Management
                 CompatSwitches.DotNetVersion, // The same value is hard coded on Environment.Version and quirks for WMI
                 "wminet_utils.dll");
 
-            IntPtr hModule =  Interop.Kernel32.LoadLibrary(wminet_utilsPath);
+            IntPtr hModule = Interop.Kernel32.LoadLibrary(wminet_utilsPath);
             if (hModule == IntPtr.Zero)
             {
                 // This is unlikely, so having the TypeInitializationException wrapping it is fine.
@@ -484,9 +484,9 @@ namespace System.Management
     [TypeConverter(typeof(ManagementScopeConverter))]
     public class ManagementScope : ICloneable
     {
-        private ManagementPath      validatedPath;
-        private IWbemServices        wbemServices;
-        private ConnectionOptions    options;
+        private ManagementPath validatedPath;
+        private IWbemServices wbemServices;
+        private ConnectionOptions options;
         internal event IdentifierChangedEventHandler IdentifierChanged;
         internal bool IsDefaulted; //used to tell whether the current scope has been created from the default
         //scope or not - this information is used to tell whether it can be overridden
@@ -536,7 +536,7 @@ namespace System.Management
             }
         }
 
-        internal IWbemServices GetIWbemServices ()
+        internal IWbemServices GetIWbemServices()
         {
             IWbemServices localCopy = wbemServices;
             //IWbemServices is always created in MTA context. Only if call is made through non MTA context we need to use IWbemServices in right context.
@@ -564,7 +564,7 @@ namespace System.Management
                     // fail if we are running under a local user account.  The QI has to be done by
                     // someone who is a member of the 'Everyone' group on the target machine, or DCOM
                     // won't let the call through.
-                    SecurityHandler securityHandler = GetSecurityHandler ();
+                    SecurityHandler securityHandler = GetSecurityHandler();
                     securityHandler.SecureIUnknown(unknown);
 
                     // Now, we can QI and secure the IWbemServices
@@ -602,13 +602,14 @@ namespace System.Management
         }
 
         //Internal constructor
-        internal ManagementScope (ManagementPath path, IWbemServices wbemServices,
+        internal ManagementScope(ManagementPath path, IWbemServices wbemServices,
             ConnectionOptions options)
         {
             if (null != path)
                 this.Path = path;
 
-            if (null != options) {
+            if (null != options)
+            {
                 this.Options = options;
             }
 
@@ -617,8 +618,8 @@ namespace System.Management
             this.wbemServices = wbemServices;
         }
 
-        internal ManagementScope (ManagementPath path, ManagementScope scope)
-            : this (path, (null != scope) ? scope.options : null) {}
+        internal ManagementScope(ManagementPath path, ManagementScope scope)
+            : this(path, (null != scope) ? scope.options : null) { }
 
         internal static ManagementScope _Clone(ManagementScope scope)
         {
@@ -689,8 +690,8 @@ namespace System.Management
         ///    <code lang='VB'>Dim s As New ManagementScope()
         ///    </code>
         /// </example>
-        public ManagementScope () :
-            this (new ManagementPath (ManagementPath.DefaultPath.Path))
+        public ManagementScope() :
+            this(new ManagementPath(ManagementPath.DefaultPath.Path))
         {
             //Flag that this scope uses the default path
             IsDefaulted = true;
@@ -709,7 +710,7 @@ namespace System.Management
         /// Dim s As New ManagementScope(p)
         ///    </code>
         /// </example>
-        public ManagementScope (ManagementPath path) : this(path, (ConnectionOptions)null) {}
+        public ManagementScope(ManagementPath path) : this(path, (ConnectionOptions)null) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementScope'/> class representing the specified scope
@@ -722,7 +723,7 @@ namespace System.Management
         ///    <code lang='VB'>Dim s As New ManagementScope("\\MyServer\root\default")
         ///    </code>
         /// </example>
-        public ManagementScope (string path) : this(new ManagementPath(path), (ConnectionOptions)null) {}
+        public ManagementScope(string path) : this(new ManagementPath(path), (ConnectionOptions)null) { }
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementScope'/> class representing the specified scope path,
         ///    with the specified options.</para>
@@ -741,7 +742,7 @@ namespace System.Management
         /// Dim s As New ManagementScope("\\MyServer\root\default", opt);
         ///    </code>
         /// </example>
-        public ManagementScope (string path, ConnectionOptions options) : this (new ManagementPath(path), options) {}
+        public ManagementScope(string path, ConnectionOptions options) : this(new ManagementPath(path), options) { }
 
         /// <summary>
         /// <para>Initializes a new instance of the <see cref='System.Management.ManagementScope'/> class representing the specified scope path,
@@ -765,7 +766,7 @@ namespace System.Management
         /// Dim s As New ManagementScope(p, opt)
         ///    </code>
         /// </example>
-        public ManagementScope (ManagementPath path, ConnectionOptions options)
+        public ManagementScope(ManagementPath path, ConnectionOptions options)
         {
             if (null != path)
                 this.prvpath = ManagementPath._Clone(path, new IdentifierChangedEventHandler(HandleIdentifierChange));
@@ -827,7 +828,7 @@ namespace System.Management
                     HandleIdentifierChange(this, null);
                 }
                 else
-                    throw new ArgumentNullException (nameof(value));
+                    throw new ArgumentNullException(nameof(value));
             }
         }
 
@@ -870,7 +871,7 @@ namespace System.Management
                     HandleIdentifierChange(this, null);
                 }
                 else
-                    throw new ArgumentNullException (nameof(value));
+                    throw new ArgumentNullException(nameof(value));
             }
         }
 
@@ -924,12 +925,12 @@ namespace System.Management
         /// Dim o As New ManagementObject(s, "Win32_LogicalDisk=""C:""", null)
         ///    </code>
         /// </example>
-        public void Connect ()
+        public void Connect()
         {
-            Initialize ();
+            Initialize();
         }
 
-        internal void Initialize ()
+        internal void Initialize()
         {
             //If the path is not set yet we can't do it
             if (null == prvpath)
@@ -957,9 +958,9 @@ namespace System.Management
                             //
                             // Ensure we are able to trap exceptions from worker thread.
                             //
-                            ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethodWithParam ( InitializeGuts ) );
+                            ThreadDispatch disp = new ThreadDispatch(new ThreadDispatch.ThreadWorkerMethodWithParam(InitializeGuts));
                             disp.Parameter = this;
-                            disp.Start ( );
+                            disp.Start();
                         }
                         else
                             InitializeGuts(this);
@@ -970,8 +971,8 @@ namespace System.Management
 
         private void InitializeGuts(object o)
         {
-            ManagementScope threadParam = (ManagementScope) o;
-            IWbemLocator loc = (IWbemLocator) new WbemLocator();
+            ManagementScope threadParam = (ManagementScope)o;
+            IWbemLocator loc = (IWbemLocator)new WbemLocator();
             IntPtr punk = IntPtr.Zero;
 
             if (null == threadParam.options)
@@ -999,7 +1000,7 @@ namespace System.Management
             if (Environment.OSVersion.Platform == PlatformID.Win32NT)
             {
 
-                if ( ((Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor >= 1)) || (Environment.OSVersion.Version.Major >= 6) )
+                if (((Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor >= 1)) || (Environment.OSVersion.Version.Major >= 6))
                 {
                     threadParam.options.Flags |= (int)tag_WBEM_CONNECT_OPTIONS.WBEM_FLAG_CONNECT_USE_MAX_WAIT;
                 }
@@ -1007,11 +1008,11 @@ namespace System.Management
 
             try
             {
-                status = GetSecuredConnectHandler().ConnectNSecureIWbemServices(nsPath, ref  threadParam.wbemServices);
+                status = GetSecuredConnectHandler().ConnectNSecureIWbemServices(nsPath, ref threadParam.wbemServices);
             }
             catch (COMException e)
             {
-                ManagementException.ThrowWithExtendedInfo (e);
+                ManagementException.ThrowWithExtendedInfo(e);
             }
 
             if ((status & 0xfffff000) == 0x80041000)
@@ -1024,19 +1025,19 @@ namespace System.Management
             }
         }
 
-        internal SecurityHandler GetSecurityHandler ()
+        internal SecurityHandler GetSecurityHandler()
         {
             return new SecurityHandler(this);
         }
-         internal SecuredConnectHandler GetSecuredConnectHandler ()
+        internal SecuredConnectHandler GetSecuredConnectHandler()
         {
             return new SecuredConnectHandler(this);
         }
-         internal SecuredIEnumWbemClassObjectHandler GetSecuredIEnumWbemClassObjectHandler (IEnumWbemClassObject pEnumWbemClassObject)
+        internal SecuredIEnumWbemClassObjectHandler GetSecuredIEnumWbemClassObjectHandler(IEnumWbemClassObject pEnumWbemClassObject)
         {
-            return new SecuredIEnumWbemClassObjectHandler (this, pEnumWbemClassObject);
+            return new SecuredIEnumWbemClassObjectHandler(this, pEnumWbemClassObject);
         }
-        internal SecuredIWbemServicesHandler GetSecuredIWbemServicesHandler( IWbemServices pWbemServiecs)
+        internal SecuredIWbemServicesHandler GetSecuredIWbemServicesHandler(IWbemServices pWbemServiecs)
         {
             return new SecuredIWbemServicesHandler(this, pWbemServiecs);
         }
@@ -1047,7 +1048,7 @@ namespace System.Management
     {
         private readonly IEnumWbemClassObject pEnumWbemClassObjectsecurityHelper;
         private readonly ManagementScope scope;
-        internal SecuredIEnumWbemClassObjectHandler  (ManagementScope theScope, IEnumWbemClassObject pEnumWbemClassObject)
+        internal SecuredIEnumWbemClassObjectHandler(ManagementScope theScope, IEnumWbemClassObject pEnumWbemClassObject)
         {
             this.scope = theScope;
             pEnumWbemClassObjectsecurityHelper = pEnumWbemClassObject;
@@ -1058,22 +1059,22 @@ namespace System.Management
             status = pEnumWbemClassObjectsecurityHelper.Reset_();
             return status;
         }
-        internal int Next_( int lTimeout, uint uCount, IWbemClassObject_DoNotMarshal[] ppOutParams, ref uint puReturned)
+        internal int Next_(int lTimeout, uint uCount, IWbemClassObject_DoNotMarshal[] ppOutParams, ref uint puReturned)
         {
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            status = pEnumWbemClassObjectsecurityHelper.Next_( lTimeout, uCount,  ppOutParams, out puReturned);
+            status = pEnumWbemClassObjectsecurityHelper.Next_(lTimeout, uCount, ppOutParams, out puReturned);
             return status;
         }
-        internal int NextAsync_( uint uCount, IWbemObjectSink pSink)
+        internal int NextAsync_(uint uCount, IWbemObjectSink pSink)
         {
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            status = pEnumWbemClassObjectsecurityHelper.NextAsync_(uCount,  pSink);
+            status = pEnumWbemClassObjectsecurityHelper.NextAsync_(uCount, pSink);
             return status;
         }
-        internal int Clone_(ref IEnumWbemClassObject   ppEnum)
+        internal int Clone_(ref IEnumWbemClassObject ppEnum)
         {
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( null != scope)
+            if (null != scope)
             {
                 IntPtr password = scope.Options.GetPassword();
                 status = WmiNetUtilsHelper.CloneEnumWbemClassObject_f(
@@ -1088,10 +1089,10 @@ namespace System.Management
             }
             return status;
         }
-        internal int Skip_( int lTimeout, uint nCount)
+        internal int Skip_(int lTimeout, uint nCount)
         {
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            status = pEnumWbemClassObjectsecurityHelper.Skip_(lTimeout,  nCount);
+            status = pEnumWbemClassObjectsecurityHelper.Skip_(lTimeout, nCount);
             return status;
         }
     }
@@ -1101,14 +1102,14 @@ namespace System.Management
     {
         private readonly ManagementScope scope;
 
-        internal SecuredConnectHandler (ManagementScope theScope)
+        internal SecuredConnectHandler(ManagementScope theScope)
         {
             this.scope = theScope;
         }
-        internal int ConnectNSecureIWbemServices(string path,  ref IWbemServices pServices)
+        internal int ConnectNSecureIWbemServices(string path, ref IWbemServices pServices)
         {
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( null != scope )
+            if (null != scope)
             {
                 bool needToReset = false;
                 IntPtr handle = IntPtr.Zero;
@@ -1151,7 +1152,7 @@ namespace System.Management
     {
         private readonly IWbemServices pWbemServiecsSecurityHelper;
         private readonly ManagementScope scope;
-        internal SecuredIWbemServicesHandler (ManagementScope theScope, IWbemServices pWbemServiecs)
+        internal SecuredIWbemServicesHandler(ManagementScope theScope, IWbemServices pWbemServiecs)
         {
             this.scope = theScope;
             pWbemServiecsSecurityHelper = pWbemServiecs;
@@ -1163,38 +1164,38 @@ namespace System.Management
             return status;
         }
 
-        internal int CancelAsyncCall_( IWbemObjectSink pSink)
+        internal int CancelAsyncCall_(IWbemObjectSink pSink)
         {
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
             status = pWbemServiecsSecurityHelper.CancelAsyncCall_(pSink);
             return status;
         }
-        internal int QueryObjectSink_( int lFlags, ref IWbemObjectSink ppResponseHandler)
+        internal int QueryObjectSink_(int lFlags, ref IWbemObjectSink ppResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.QueryObjectSink_(lFlags, out ppResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.QueryObjectSink_(lFlags, out ppResponseHandler);
             return status;
         }
-        internal int GetObject_(string strObjectPath, int lFlags, IWbemContext pCtx, ref IWbemClassObjectFreeThreaded ppObject,  IntPtr ppCallResult)
+        internal int GetObject_(string strObjectPath, int lFlags, IWbemContext pCtx, ref IWbemClassObjectFreeThreaded ppObject, IntPtr ppCallResult)
         {
-             //It is assumed that caller always passes ppCallResult as IntPtr.Zero.
+            //It is assumed that caller always passes ppCallResult as IntPtr.Zero.
             //If it changes let this call go through wminet_utils.dll. Check implementation of CreateInstanceEnum_ for more information.
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( !object.ReferenceEquals(ppCallResult, IntPtr.Zero) )
+            if (!object.ReferenceEquals(ppCallResult, IntPtr.Zero))
                 status = pWbemServiecsSecurityHelper.GetObject_(strObjectPath, lFlags, pCtx, out ppObject, ppCallResult);
             return status;
         }
 
         internal int GetObjectAsync_(string strObjectPath, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.GetObjectAsync_(strObjectPath, lFlags, pCtx, pResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.GetObjectAsync_(strObjectPath, lFlags, pCtx, pResponseHandler);
             return status;
         }
-        internal int PutClass_(IWbemClassObjectFreeThreaded pObject, int lFlags, IWbemContext pCtx,  IntPtr ppCallResult)
+        internal int PutClass_(IWbemClassObjectFreeThreaded pObject, int lFlags, IWbemContext pCtx, IntPtr ppCallResult)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( null != scope)
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            if (null != scope)
             {
                 IntPtr password = scope.Options.GetPassword();
                 status = WmiNetUtilsHelper.PutClassWmi_f(pObject,
@@ -1211,31 +1212,31 @@ namespace System.Management
             }
             return status;
         }
-         internal int PutClassAsync_(IWbemClassObjectFreeThreaded pObject, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
+        internal int PutClassAsync_(IWbemClassObjectFreeThreaded pObject, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.PutClassAsync_(pObject, lFlags, pCtx, pResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.PutClassAsync_(pObject, lFlags, pCtx, pResponseHandler);
             return status;
         }
-         internal int DeleteClass_( string strClass, int lFlags, IWbemContext pCtx, IntPtr ppCallResult)
-         {
-             //It is assumed that caller always passes ppCallResult as IntPtr.Zero.
+        internal int DeleteClass_(string strClass, int lFlags, IWbemContext pCtx, IntPtr ppCallResult)
+        {
+            //It is assumed that caller always passes ppCallResult as IntPtr.Zero.
             //If it changes let this call go through wminet_utils.dll. Check implementation of CreateInstanceEnum_ for more information.
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( !object.ReferenceEquals(ppCallResult, IntPtr.Zero) )
+            if (!object.ReferenceEquals(ppCallResult, IntPtr.Zero))
                 status = pWbemServiecsSecurityHelper.DeleteClass_(strClass, lFlags, pCtx, ppCallResult);
             return status;
-         }
-         internal int DeleteClassAsync_(string strClass, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
+        }
+        internal int DeleteClassAsync_(string strClass, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.DeleteClassAsync_(strClass, lFlags, pCtx, pResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.DeleteClassAsync_(strClass, lFlags, pCtx, pResponseHandler);
             return status;
         }
-         internal int CreateClassEnum_(string strSuperClass, int lFlags, IWbemContext pCtx, ref IEnumWbemClassObject ppEnum)
-         {
+        internal int CreateClassEnum_(string strSuperClass, int lFlags, IWbemContext pCtx, ref IEnumWbemClassObject ppEnum)
+        {
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( null != scope )
+            if (null != scope)
             {
                 IntPtr password = scope.Options.GetPassword();
                 status = WmiNetUtilsHelper.CreateClassEnumWmi_f(strSuperClass,
@@ -1251,17 +1252,17 @@ namespace System.Management
                 System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password);
             }
             return status;
-         }
-          internal int CreateClassEnumAsync_(string strSuperClass, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
+        }
+        internal int CreateClassEnumAsync_(string strSuperClass, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.CreateClassEnumAsync_(strSuperClass, lFlags, pCtx, pResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.CreateClassEnumAsync_(strSuperClass, lFlags, pCtx, pResponseHandler);
             return status;
         }
-         internal int PutInstance_( IWbemClassObjectFreeThreaded pInst, int lFlags, IWbemContext pCtx, IntPtr ppCallResult)
-         {
+        internal int PutInstance_(IWbemClassObjectFreeThreaded pInst, int lFlags, IWbemContext pCtx, IntPtr ppCallResult)
+        {
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( null != scope)
+            if (null != scope)
             {
                 IntPtr password = scope.Options.GetPassword();
                 status = WmiNetUtilsHelper.PutInstanceWmi_f(pInst,
@@ -1277,33 +1278,33 @@ namespace System.Management
                 System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password);
             }
             return status;
-         }
-         internal int PutInstanceAsync_(IWbemClassObjectFreeThreaded pInst, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
+        }
+        internal int PutInstanceAsync_(IWbemClassObjectFreeThreaded pInst, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.PutInstanceAsync_(pInst, lFlags, pCtx, pResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.PutInstanceAsync_(pInst, lFlags, pCtx, pResponseHandler);
             return status;
         }
-         internal int DeleteInstance_(string strObjectPath, int lFlags, IWbemContext pCtx, IntPtr ppCallResult)
-         {
-             //It is assumed that caller always passes ppCallResult as IntPtr.Zero.
+        internal int DeleteInstance_(string strObjectPath, int lFlags, IWbemContext pCtx, IntPtr ppCallResult)
+        {
+            //It is assumed that caller always passes ppCallResult as IntPtr.Zero.
             //If it changes let this call go through wminet_utils.dll. Check implementation of CreateInstanceEnum_ for more information.
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( !object.ReferenceEquals(ppCallResult, IntPtr.Zero) )
+            if (!object.ReferenceEquals(ppCallResult, IntPtr.Zero))
                 status = pWbemServiecsSecurityHelper.DeleteInstance_(strObjectPath, lFlags, pCtx, ppCallResult);
             return status;
-         }
-         internal int DeleteInstanceAsync_(string strObjectPath, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
+        }
+        internal int DeleteInstanceAsync_(string strObjectPath, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.DeleteInstanceAsync_(strObjectPath, lFlags, pCtx, pResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.DeleteInstanceAsync_(strObjectPath, lFlags, pCtx, pResponseHandler);
             return status;
         }
 
-         internal int CreateInstanceEnum_(string strFilter, int lFlags, IWbemContext pCtx, ref IEnumWbemClassObject ppEnum)
-         {
+        internal int CreateInstanceEnum_(string strFilter, int lFlags, IWbemContext pCtx, ref IEnumWbemClassObject ppEnum)
+        {
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( null != scope)
+            if (null != scope)
             {
                 IntPtr password = scope.Options.GetPassword();
                 status = WmiNetUtilsHelper.CreateInstanceEnumWmi_f(strFilter,
@@ -1319,17 +1320,17 @@ namespace System.Management
                 System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password);
             }
             return status;
-         }
-         internal int CreateInstanceEnumAsync_(string strFilter, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
+        }
+        internal int CreateInstanceEnumAsync_(string strFilter, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.CreateInstanceEnumAsync_(strFilter, lFlags, pCtx, pResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.CreateInstanceEnumAsync_(strFilter, lFlags, pCtx, pResponseHandler);
             return status;
         }
-         internal int ExecQuery_(string strQueryLanguage, string strQuery, int lFlags, IWbemContext pCtx, ref IEnumWbemClassObject ppEnum)
-         {
+        internal int ExecQuery_(string strQueryLanguage, string strQuery, int lFlags, IWbemContext pCtx, ref IEnumWbemClassObject ppEnum)
+        {
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( null != scope)
+            if (null != scope)
             {
                 IntPtr password = scope.Options.GetPassword();
                 status = WmiNetUtilsHelper.ExecQueryWmi_f(strQueryLanguage,
@@ -1346,17 +1347,17 @@ namespace System.Management
                 System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password);
             }
             return status;
-         }
-         internal int ExecQueryAsync_(string strQueryLanguage, string strQuery, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
+        }
+        internal int ExecQueryAsync_(string strQueryLanguage, string strQuery, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.ExecQueryAsync_(strQueryLanguage, strQuery, lFlags, pCtx, pResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.ExecQueryAsync_(strQueryLanguage, strQuery, lFlags, pCtx, pResponseHandler);
             return status;
         }
-         internal int ExecNotificationQuery_(string strQueryLanguage, string strQuery, int lFlags, IWbemContext pCtx, ref IEnumWbemClassObject ppEnum)
+        internal int ExecNotificationQuery_(string strQueryLanguage, string strQuery, int lFlags, IWbemContext pCtx, ref IEnumWbemClassObject ppEnum)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( null != scope)
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            if (null != scope)
             {
                 IntPtr password = scope.Options.GetPassword();
                 status = WmiNetUtilsHelper.ExecNotificationQueryWmi_f(strQueryLanguage,
@@ -1374,25 +1375,25 @@ namespace System.Management
             }
             return status;
         }
-         internal int ExecNotificationQueryAsync_(string strQueryLanguage, string strQuery, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
+        internal int ExecNotificationQueryAsync_(string strQueryLanguage, string strQuery, int lFlags, IWbemContext pCtx, IWbemObjectSink pResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.ExecNotificationQueryAsync_(strQueryLanguage, strQuery, lFlags, pCtx, pResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.ExecNotificationQueryAsync_(strQueryLanguage, strQuery, lFlags, pCtx, pResponseHandler);
             return status;
         }
-         internal int ExecMethod_( string strObjectPath, string strMethodName, int lFlags, IWbemContext pCtx, IWbemClassObjectFreeThreaded pInParams, ref IWbemClassObjectFreeThreaded ppOutParams, IntPtr ppCallResult)
-         {
+        internal int ExecMethod_(string strObjectPath, string strMethodName, int lFlags, IWbemContext pCtx, IWbemClassObjectFreeThreaded pInParams, ref IWbemClassObjectFreeThreaded ppOutParams, IntPtr ppCallResult)
+        {
             //It is assumed that caller always passes ppCallResult as IntPtr.Zero.
             //If it changes let this call go through wminet_utils.dll. Check implementation of CreateInstanceEnum_ for more information.
             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-            if ( !object.ReferenceEquals(ppCallResult, IntPtr.Zero) )
+            if (!object.ReferenceEquals(ppCallResult, IntPtr.Zero))
                 status = pWbemServiecsSecurityHelper.ExecMethod_(strObjectPath, strMethodName, lFlags, pCtx, pInParams, out ppOutParams, ppCallResult);
             return status;
-         }
-          internal int ExecMethodAsync_(string strObjectPath, string strMethodName, int lFlags, IWbemContext pCtx, IWbemClassObjectFreeThreaded pInParams, IWbemObjectSink pResponseHandler)
+        }
+        internal int ExecMethodAsync_(string strObjectPath, string strMethodName, int lFlags, IWbemContext pCtx, IWbemClassObjectFreeThreaded pInParams, IWbemObjectSink pResponseHandler)
         {
-             int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
-             status = pWbemServiecsSecurityHelper.ExecMethodAsync_(strObjectPath, strMethodName, lFlags, pCtx, pInParams, pResponseHandler);
+            int status = (int)tag_WBEMSTATUS.WBEM_E_FAILED;
+            status = pWbemServiecsSecurityHelper.ExecMethodAsync_(strObjectPath, strMethodName, lFlags, pCtx, pInParams, pResponseHandler);
             return status;
         }
     }
@@ -1404,7 +1405,7 @@ namespace System.Management
         private readonly IntPtr handle;
         private readonly ManagementScope scope;
 
-        internal SecurityHandler (ManagementScope theScope)
+        internal SecurityHandler(ManagementScope theScope)
         {
             this.scope = theScope;
             if (null != scope)
@@ -1416,7 +1417,7 @@ namespace System.Management
             }
         }
 
-        internal void Reset ()
+        internal void Reset()
         {
             if (needToReset)
             {
@@ -1424,14 +1425,14 @@ namespace System.Management
 
                 if (null != scope)
                 {
-                    WmiNetUtilsHelper.ResetSecurity_f ( handle);
+                    WmiNetUtilsHelper.ResetSecurity_f(handle);
                 }
             }
 
         }
 
 
-       internal void Secure (IWbemServices services)
+        internal void Secure(IWbemServices services)
         {
             if (null != scope)
             {
@@ -1546,10 +1547,10 @@ namespace System.Management
             if (value is ManagementScope && destinationType == typeof(InstanceDescriptor))
             {
                 ManagementScope obj = ((ManagementScope)(value));
-                ConstructorInfo ctor = typeof(ManagementScope).GetConstructor(new Type[] {typeof(string)});
+                ConstructorInfo ctor = typeof(ManagementScope).GetConstructor(new Type[] { typeof(string) });
                 if (ctor != null)
                 {
-                    return new InstanceDescriptor(ctor, new object[] {obj.Path.Path});
+                    return new InstanceDescriptor(ctor, new object[] { obj.Path.Path });
                 }
             }
             return base.ConvertTo(context, culture, value, destinationType);
index 4b4930a..a5e6364 100644 (file)
@@ -170,7 +170,8 @@ namespace System.Management
             get
             {
                 RefreshMethodInfo();
-                return (null == wmiInParams) ? null : new ManagementBaseObject(wmiInParams); }
+                return (null == wmiInParams) ? null : new ManagementBaseObject(wmiInParams);
+            }
         }
 
         /// <summary>
@@ -196,7 +197,8 @@ namespace System.Management
             get
             {
                 RefreshMethodInfo();
-                return (null == wmiOutParams) ? null : new ManagementBaseObject(wmiOutParams); }
+                return (null == wmiOutParams) ? null : new ManagementBaseObject(wmiOutParams);
+            }
         }
 
         /// <summary>
index 15a720a..34cbc15 100644 (file)
@@ -125,7 +125,9 @@ namespace System.Management
         /// <para><see langword='true'/> if the object is synchronized;
         ///    otherwise, <see langword='false'/>.</para>
         /// </value>
-        public bool IsSynchronized { get { return false; }
+        public bool IsSynchronized
+        {
+            get { return false; }
         }
 
         /// <summary>
@@ -134,7 +136,9 @@ namespace System.Management
         /// <value>
         ///    <para>The object to be used for synchronization.</para>
         /// </value>
-        public object SyncRoot { get { return this; }
+        public object SyncRoot
+        {
+            get { return this; }
         }
 
         /// <overload>
@@ -304,7 +308,7 @@ namespace System.Management
             {
                 get
                 {
-                        return new MethodData(parent, (string)en.Current);
+                    return new MethodData(parent, (string)en.Current);
                 }
             }
 
@@ -312,7 +316,7 @@ namespace System.Management
             /// <para>Moves to the next element in the <see cref='System.Management.MethodDataCollection'/> enumeration.</para>
             /// </summary>
             /// <returns><see langword='true'/> if the enumerator was successfully advanced to the next method; <see langword='false'/> if the enumerator has passed the end of the collection.</returns>
-            public bool MoveNext ()
+            public bool MoveNext()
             {
                 return en.MoveNext();
             }
@@ -342,7 +346,7 @@ namespace System.Management
             get
             {
                 if (null == methodName)
-                    throw new ArgumentNullException (nameof(methodName));
+                    throw new ArgumentNullException(nameof(methodName));
 
                 return new MethodData(parent, methodName);
             }
index cf34ccb..eb8a14a 100644 (file)
@@ -80,7 +80,7 @@ namespace System.Management
     public class PropertyData
     {
         private readonly ManagementBaseObject parent;  //need access to IWbemClassObject pointer to be able to refresh property info
-                                    //and get property qualifiers
+                                                       //and get property qualifiers
         private readonly string propertyName;
 
         private object propertyValue;
@@ -134,13 +134,15 @@ namespace System.Management
         /// </value>
         public object Value
         {
-            get {
+            get
+            {
                 RefreshPropertyInfo();
                 return ValueTypeSafety.GetSafeObject(MapWmiValueToValue(propertyValue,
                         (CimType)(propertyType & ~(int)tag_CIMTYPE_ENUMERATION.CIM_FLAG_ARRAY),
                         (0 != (propertyType & (int)tag_CIMTYPE_ENUMERATION.CIM_FLAG_ARRAY))));
             }
-            set {
+            set
+            {
                 RefreshPropertyInfo();
 
                 object newValue = MapValueToWmiValue(value,
@@ -161,7 +163,7 @@ namespace System.Management
                 //       whether this property is a key or not, we just do it for any property
                 else
                     if (parent.GetType() == typeof(ManagementObject))
-                        ((ManagementObject)parent).Path.UpdateRelativePath((string)parent["__RELPATH"]);
+                    ((ManagementObject)parent).Path.UpdateRelativePath((string)parent["__RELPATH"]);
 
             }
         }
@@ -173,8 +175,10 @@ namespace System.Management
         /// <para>A <see cref='System.Management.CimType'/> value
         ///    representing the CIM type of the property.</para>
         /// </value>
-        public CimType Type {
-            get {
+        public CimType Type
+        {
+            get
+            {
                 RefreshPropertyInfo();
                 return (CimType)(propertyType & ~(int)tag_CIMTYPE_ENUMERATION.CIM_FLAG_ARRAY);
             }
@@ -189,9 +193,11 @@ namespace System.Management
         /// </value>
         public bool IsLocal
         {
-            get {
+            get
+            {
                 RefreshPropertyInfo();
-                return ((propertyFlavor & (int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_ORIGIN_PROPAGATED) != 0) ? false : true; }
+                return ((propertyFlavor & (int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_ORIGIN_PROPAGATED) != 0) ? false : true;
+            }
         }
 
         /// <summary>
@@ -202,9 +208,11 @@ namespace System.Management
         /// </value>
         public bool IsArray
         {
-            get {
+            get
+            {
                 RefreshPropertyInfo();
-                return ((propertyType & (int)tag_CIMTYPE_ENUMERATION.CIM_FLAG_ARRAY) != 0); }
+                return ((propertyType & (int)tag_CIMTYPE_ENUMERATION.CIM_FLAG_ARRAY) != 0);
+            }
         }
 
         /// <summary>
@@ -216,7 +224,8 @@ namespace System.Management
         /// </value>
         public string Origin
         {
-            get {
+            get
+            {
                 string className = null;
                 int status = parent.wbemObject.GetPropertyOrigin_(propertyName, out className);
 
@@ -244,23 +253,26 @@ namespace System.Management
         /// </value>
         public QualifierDataCollection Qualifiers
         {
-            get {
+            get
+            {
                 if (qualifiers == null)
                     qualifiers = new QualifierDataCollection(parent, propertyName, QualifierType.PropertyQualifier);
 
                 return qualifiers;
             }
         }
-              internal long NullEnumValue
-             {
-                 get {
-                     return propertyNullEnumValue;
-                 }
+        internal long NullEnumValue
+        {
+            get
+            {
+                return propertyNullEnumValue;
+            }
 
-                 set {
-                       propertyNullEnumValue = value;
-                 }
-             }
+            set
+            {
+                propertyNullEnumValue = value;
+            }
+        }
 
         /// <summary>
         /// Takes a property value returned from WMI and maps it to an
@@ -283,52 +295,52 @@ namespace System.Management
                     switch (type)
                     {
                         case CimType.UInt16:
-                            val = new ushort [length];
+                            val = new ushort[length];
 
                             for (int i = 0; i < length; i++)
-                                ((ushort[])val) [i] = (ushort)((int)(wmiValueArray.GetValue(i)));
+                                ((ushort[])val)[i] = (ushort)((int)(wmiValueArray.GetValue(i)));
                             break;
 
                         case CimType.UInt32:
-                            val = new uint [length];
+                            val = new uint[length];
 
                             for (int i = 0; i < length; i++)
                                 ((uint[])val)[i] = (uint)((int)(wmiValueArray.GetValue(i)));
                             break;
 
                         case CimType.UInt64:
-                            val = new ulong [length];
+                            val = new ulong[length];
 
                             for (int i = 0; i < length; i++)
-                                ((ulong[])val) [i] = Convert.ToUInt64((string)(wmiValueArray.GetValue(i)), (IFormatProvider)CultureInfo.CurrentCulture.GetFormat(typeof(ulong)));
+                                ((ulong[])val)[i] = Convert.ToUInt64((string)(wmiValueArray.GetValue(i)), (IFormatProvider)CultureInfo.CurrentCulture.GetFormat(typeof(ulong)));
                             break;
 
                         case CimType.SInt8:
-                            val = new sbyte [length];
+                            val = new sbyte[length];
 
                             for (int i = 0; i < length; i++)
-                                ((sbyte[])val) [i] = (sbyte)((short)(wmiValueArray.GetValue(i)));
+                                ((sbyte[])val)[i] = (sbyte)((short)(wmiValueArray.GetValue(i)));
                             break;
 
                         case CimType.SInt64:
-                            val = new long [length];
+                            val = new long[length];
 
                             for (int i = 0; i < length; i++)
-                                ((long[])val) [i] = Convert.ToInt64((string)(wmiValueArray.GetValue(i)), (IFormatProvider)CultureInfo.CurrentCulture.GetFormat(typeof(long)));
+                                ((long[])val)[i] = Convert.ToInt64((string)(wmiValueArray.GetValue(i)), (IFormatProvider)CultureInfo.CurrentCulture.GetFormat(typeof(long)));
                             break;
 
                         case CimType.Char16:
-                            val = new char [length];
+                            val = new char[length];
 
                             for (int i = 0; i < length; i++)
-                                ((char[])val) [i] = (char)((short)(wmiValueArray.GetValue(i)));
+                                ((char[])val)[i] = (char)((short)(wmiValueArray.GetValue(i)));
                             break;
 
                         case CimType.Object:
-                            val = new ManagementBaseObject [length];
+                            val = new ManagementBaseObject[length];
 
                             for (int i = 0; i < length; i++)
-                                ((ManagementBaseObject[])val) [i] = new ManagementBaseObject(new IWbemClassObjectFreeThreaded(Marshal.GetIUnknownForObject(wmiValueArray.GetValue(i))));
+                                ((ManagementBaseObject[])val)[i] = new ManagementBaseObject(new IWbemClassObjectFreeThreaded(Marshal.GetIUnknownForObject(wmiValueArray.GetValue(i))));
                             break;
 
                         default:
@@ -375,7 +387,7 @@ namespace System.Management
                     switch (type)
                     {
                         case CimType.SInt8:
-                            wmiValue = new short [length];
+                            wmiValue = new short[length];
                             for (int i = 0; i < length; i++)
                                 ((short[])(wmiValue))[i] = (short)Convert.ToSByte(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(sbyte)));
                             break;
@@ -385,7 +397,7 @@ namespace System.Management
                                 wmiValue = val;
                             else
                             {
-                                wmiValue = new byte [length];
+                                wmiValue = new byte[length];
                                 for (int i = 0; i < length; i++)
                                     ((byte[])wmiValue)[i] = Convert.ToByte(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(byte)));
                             }
@@ -396,14 +408,14 @@ namespace System.Management
                                 wmiValue = val;
                             else
                             {
-                                wmiValue = new short [length];
+                                wmiValue = new short[length];
                                 for (int i = 0; i < length; i++)
                                     ((short[])(wmiValue))[i] = Convert.ToInt16(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(short)));
                             }
                             break;
 
                         case CimType.UInt16:
-                            wmiValue = new int [length];
+                            wmiValue = new int[length];
                             for (int i = 0; i < length; i++)
                                 ((int[])(wmiValue))[i] = (int)(Convert.ToUInt16(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(ushort))));
                             break;
@@ -413,26 +425,26 @@ namespace System.Management
                                 wmiValue = val;
                             else
                             {
-                                wmiValue = new int [length];
+                                wmiValue = new int[length];
                                 for (int i = 0; i < length; i++)
                                     ((int[])(wmiValue))[i] = Convert.ToInt32(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(int)));
                             }
                             break;
 
                         case CimType.UInt32:
-                            wmiValue = new int [length];
+                            wmiValue = new int[length];
                             for (int i = 0; i < length; i++)
                                 ((int[])(wmiValue))[i] = (int)(Convert.ToUInt32(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(uint))));
                             break;
 
                         case CimType.SInt64:
-                            wmiValue = new string [length];
+                            wmiValue = new string[length];
                             for (int i = 0; i < length; i++)
                                 ((string[])(wmiValue))[i] = (Convert.ToInt64(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(long)))).ToString((IFormatProvider)culInfo.GetFormat(typeof(long)));
                             break;
 
                         case CimType.UInt64:
-                            wmiValue = new string [length];
+                            wmiValue = new string[length];
                             for (int i = 0; i < length; i++)
                                 ((string[])(wmiValue))[i] = (Convert.ToUInt64(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(ulong)))).ToString((IFormatProvider)culInfo.GetFormat(typeof(ulong)));
                             break;
@@ -442,7 +454,7 @@ namespace System.Management
                                 wmiValue = val;
                             else
                             {
-                                wmiValue = new float [length];
+                                wmiValue = new float[length];
                                 for (int i = 0; i < length; i++)
                                     ((float[])(wmiValue))[i] = Convert.ToSingle(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(float)));
                             }
@@ -453,14 +465,14 @@ namespace System.Management
                                 wmiValue = val;
                             else
                             {
-                                wmiValue = new double [length];
+                                wmiValue = new double[length];
                                 for (int i = 0; i < length; i++)
                                     ((double[])(wmiValue))[i] = Convert.ToDouble(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(double)));
                             }
                             break;
 
                         case CimType.Char16:
-                            wmiValue = new short [length];
+                            wmiValue = new short[length];
                             for (int i = 0; i < length; i++)
                                 ((short[])(wmiValue))[i] = (short)Convert.ToChar(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(char)));
                             break;
@@ -472,7 +484,7 @@ namespace System.Management
                                 wmiValue = val;
                             else
                             {
-                                wmiValue = new string [length];
+                                wmiValue = new string[length];
                                 for (int i = 0; i < length; i++)
                                     ((string[])(wmiValue))[i] = (valArray.GetValue(i)).ToString();
                             }
@@ -483,7 +495,7 @@ namespace System.Management
                                 wmiValue = val;
                             else
                             {
-                                wmiValue = new bool [length];
+                                wmiValue = new bool[length];
                                 for (int i = 0; i < length; i++)
                                     ((bool[])(wmiValue))[i] = Convert.ToBoolean(valArray.GetValue(i), (IFormatProvider)culInfo.GetFormat(typeof(bool)));
                             }
@@ -564,7 +576,7 @@ namespace System.Management
                         case CimType.Object:
                             if (val is ManagementBaseObject)
                             {
-                                wmiValue = Marshal.GetObjectForIUnknown(((ManagementBaseObject) val).wbemObject);
+                                wmiValue = Marshal.GetObjectForIUnknown(((ManagementBaseObject)val).wbemObject);
                             }
                             else
                             {
@@ -609,7 +621,7 @@ namespace System.Management
                             wmiValue = new short[length];
 
                             for (int i = 0; i < length; i++)
-                                ((short[])wmiValue) [i] = ((IConvertible)((byte)(arrayValue[i]))).ToInt16(null);
+                                ((short[])wmiValue)[i] = ((IConvertible)((byte)(arrayValue[i]))).ToInt16(null);
                         }
                         else if (elementType == typeof(sbyte))
                         {
@@ -619,7 +631,7 @@ namespace System.Management
                             wmiValue = new short[length];
 
                             for (int i = 0; i < length; i++)
-                                ((short[])wmiValue) [i] = ((IConvertible)((sbyte)(arrayValue[i]))).ToInt16(null);
+                                ((short[])wmiValue)[i] = ((IConvertible)((sbyte)(arrayValue[i]))).ToInt16(null);
                         }
                         else if (elementType == typeof(bool))
                         {
@@ -634,7 +646,7 @@ namespace System.Management
                             wmiValue = new int[length];
 
                             for (int i = 0; i < length; i++)
-                                ((int[])wmiValue) [i] = ((IConvertible)((ushort)(arrayValue[i]))).ToInt32(null);
+                                ((int[])wmiValue)[i] = ((IConvertible)((ushort)(arrayValue[i]))).ToInt32(null);
                         }
                         else if (elementType == typeof(short))
                         {
@@ -654,7 +666,7 @@ namespace System.Management
                             wmiValue = new string[length];
 
                             for (int i = 0; i < length; i++)
-                                ((string[])wmiValue) [i] = ((uint)(arrayValue[i])).ToString((IFormatProvider)culInfo.GetFormat(typeof(uint)));
+                                ((string[])wmiValue)[i] = ((uint)(arrayValue[i])).ToString((IFormatProvider)culInfo.GetFormat(typeof(uint)));
                         }
                         else if (elementType == typeof(ulong))
                         {
@@ -664,7 +676,7 @@ namespace System.Management
                             wmiValue = new string[length];
 
                             for (int i = 0; i < length; i++)
-                                ((string[])wmiValue) [i] = ((ulong)(arrayValue[i])).ToString((IFormatProvider)culInfo.GetFormat(typeof(ulong)));
+                                ((string[])wmiValue)[i] = ((ulong)(arrayValue[i])).ToString((IFormatProvider)culInfo.GetFormat(typeof(ulong)));
                         }
                         else if (elementType == typeof(long))
                         {
@@ -674,7 +686,7 @@ namespace System.Management
                             wmiValue = new string[length];
 
                             for (int i = 0; i < length; i++)
-                                ((string[])wmiValue) [i] = ((long)(arrayValue[i])).ToString((IFormatProvider)culInfo.GetFormat(typeof(long)));
+                                ((string[])wmiValue)[i] = ((long)(arrayValue[i])).ToString((IFormatProvider)culInfo.GetFormat(typeof(long)));
                         }
                         else if (elementType == typeof(float))
                         {
@@ -694,7 +706,7 @@ namespace System.Management
                             wmiValue = new short[length];
 
                             for (int i = 0; i < length; i++)
-                                ((short[])wmiValue) [i] = ((IConvertible)((char)(arrayValue[i]))).ToInt16(null);
+                                ((short[])wmiValue)[i] = ((IConvertible)((char)(arrayValue[i]))).ToInt16(null);
                         }
                     }
                     else
@@ -799,7 +811,7 @@ namespace System.Management
                         if (val is ManagementBaseObject)
                         {
                             type = CimType.Object;
-                            wmiValue = Marshal.GetObjectForIUnknown(((ManagementBaseObject) val).wbemObject);
+                            wmiValue = Marshal.GetObjectForIUnknown(((ManagementBaseObject)val).wbemObject);
                         }
                     }
                 }
index 5c14691..d9564f0 100644 (file)
@@ -71,7 +71,8 @@ namespace System.Management
         /// </value>
         public int Count
         {
-            get {
+            get
+            {
                 string[] propertyNames = null; object qualVal = null;
                 int flag;
                 if (isSystem)
@@ -102,7 +103,9 @@ namespace System.Management
         /// <para><see langword='true'/> if the object is synchronized;
         ///    otherwise, <see langword='false'/>.</para>
         /// </value>
-        public bool IsSynchronized { get { return false; }
+        public bool IsSynchronized
+        {
+            get { return false; }
         }
 
         /// <summary>
@@ -111,7 +114,9 @@ namespace System.Management
         /// <value>
         ///    <para>The object to be used for synchronization.</para>
         /// </value>
-        public object SyncRoot { get { return this; }
+        public object SyncRoot
+        {
+            get { return this; }
         }
 
         /// <overload>
@@ -280,7 +285,8 @@ namespace System.Management
             /// </value>
             public PropertyData Current
             {
-                get {
+                get
+                {
                     if ((index == -1) || (index == propertyNames.Length))
                         throw new InvalidOperationException();
                     else
@@ -340,7 +346,8 @@ namespace System.Management
         /// </example>
         public virtual PropertyData this[string propertyName]
         {
-            get {
+            get
+            {
                 if (null == propertyName)
                     throw new ArgumentNullException(nameof(propertyName));
 
index 1e6080b..535c37d 100644 (file)
@@ -107,25 +107,25 @@ namespace System.Management
 
                         if (elementType == typeof(int))
                         {
-                            wmiValue = new int [length];
+                            wmiValue = new int[length];
                             for (int i = 0; i < length; i++)
                                 ((int[])(wmiValue))[i] = Convert.ToInt32(valArray.GetValue(i), (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int)));
                         }
                         else if (elementType == typeof(double))
                         {
-                            wmiValue = new double [length];
+                            wmiValue = new double[length];
                             for (int i = 0; i < length; i++)
                                 ((double[])(wmiValue))[i] = Convert.ToDouble(valArray.GetValue(i), (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(double)));
                         }
                         else if (elementType == typeof(string))
                         {
-                            wmiValue = new string [length];
+                            wmiValue = new string[length];
                             for (int i = 0; i < length; i++)
                                 ((string[])(wmiValue))[i] = (valArray.GetValue(i)).ToString();
                         }
                         else if (elementType == typeof(bool))
                         {
-                            wmiValue = new bool [length];
+                            wmiValue = new bool[length];
                             for (int i = 0; i < length; i++)
                                 ((bool[])(wmiValue))[i] = Convert.ToBoolean(valArray.GetValue(i), (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(bool)));
                         }
@@ -168,11 +168,13 @@ namespace System.Management
         /// </remarks>
         public object Value
         {
-            get {
+            get
+            {
                 RefreshQualifierInfo();
                 return ValueTypeSafety.GetSafeObject(qualifierValue);
             }
-            set {
+            set
+            {
                 int status = (int)ManagementStatus.NoError;
 
                 RefreshQualifierInfo();
@@ -203,7 +205,8 @@ namespace System.Management
         /// </remarks>
         public bool IsAmended
         {
-            get {
+            get
+            {
                 RefreshQualifierInfo();
                 return ((int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_MASK_AMENDED ==
                     (qualifierFlavor & (int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_AMENDED));
@@ -212,7 +215,7 @@ namespace System.Management
             {
                 int status = (int)ManagementStatus.NoError;
 
-                RefreshQualifierInfo ();
+                RefreshQualifierInfo();
                 // Mask out origin bits
                 int flavor = qualifierFlavor & ~(int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_MASK_ORIGIN;
 
@@ -240,7 +243,8 @@ namespace System.Management
         /// </value>
         public bool IsLocal
         {
-            get {
+            get
+            {
                 RefreshQualifierInfo();
                 return ((int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_ORIGIN_LOCAL ==
                     (qualifierFlavor & (int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_MASK_ORIGIN));
@@ -257,15 +261,17 @@ namespace System.Management
         /// </value>
         public bool PropagatesToInstance
         {
-            get {
+            get
+            {
                 RefreshQualifierInfo();
                 return ((int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE ==
                     (qualifierFlavor & (int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE));
             }
-            set {
+            set
+            {
                 int status = (int)ManagementStatus.NoError;
 
-                RefreshQualifierInfo ();
+                RefreshQualifierInfo();
                 // Mask out origin bits
                 int flavor = qualifierFlavor & ~(int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_MASK_ORIGIN;
 
@@ -293,15 +299,17 @@ namespace System.Management
         /// </value>
         public bool PropagatesToSubclass
         {
-            get {
+            get
+            {
                 RefreshQualifierInfo();
                 return ((int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS ==
                     (qualifierFlavor & (int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS));
             }
-            set {
+            set
+            {
                 int status = (int)ManagementStatus.NoError;
 
-                RefreshQualifierInfo ();
+                RefreshQualifierInfo();
                 // Mask out origin bits
                 int flavor = qualifierFlavor & ~(int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_MASK_ORIGIN;
 
@@ -329,15 +337,17 @@ namespace System.Management
         /// </value>
         public bool IsOverridable
         {
-            get {
+            get
+            {
                 RefreshQualifierInfo();
                 return ((int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_OVERRIDABLE ==
                     (qualifierFlavor & (int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_MASK_PERMISSIONS));
             }
-            set {
+            set
+            {
                 int status = (int)ManagementStatus.NoError;
 
-                RefreshQualifierInfo ();
+                RefreshQualifierInfo();
                 // Mask out origin bits
                 int flavor = qualifierFlavor & ~(int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_MASK_ORIGIN;
 
index 4ebe33f..8519354 100644 (file)
@@ -83,7 +83,7 @@ namespace System.Management
         /// </summary>
         private IWbemQualifierSetFreeThreaded GetTypeQualifierSet(QualifierType qualifierSetType)
         {
-            IWbemQualifierSetFreeThreaded qualifierSet    = null;
+            IWbemQualifierSetFreeThreaded qualifierSet = null;
 
             int status = qualifierSetType switch
             {
@@ -115,7 +115,8 @@ namespace System.Management
         /// </value>
         public int Count
         {
-            get {
+            get
+            {
                 string[] qualifierNames = null;
                 IWbemQualifierSetFreeThreaded quals;
                 try
@@ -151,7 +152,9 @@ namespace System.Management
         /// <para><see langword='true'/> if the object is synchronized;
         ///    otherwise, <see langword='false'/>.</para>
         /// </value>
-        public bool IsSynchronized { get { return false; }
+        public bool IsSynchronized
+        {
+            get { return false; }
         }
 
         /// <summary>
@@ -160,7 +163,9 @@ namespace System.Management
         /// <value>
         ///    <para>The object to be used for synchronization.</para>
         /// </value>
-        public object SyncRoot { get { return this; }
+        public object SyncRoot
+        {
+            get { return this; }
         }
 
         /// <overload>
@@ -306,10 +311,10 @@ namespace System.Management
             internal QualifierDataEnumerator(ManagementBaseObject parent, string propertyOrMethodName,
                                                         QualifierType qualifierType)
             {
-                this.parent               = parent;
+                this.parent = parent;
                 this.propertyOrMethodName = propertyOrMethodName;
-                this.qualifierType        = qualifierType;
-                this.qualifierNames       = null;
+                this.qualifierType = qualifierType;
+                this.qualifierNames = null;
 
                 IWbemQualifierSetFreeThreaded qualifierSet = null;
                 int status = (int)ManagementStatus.NoError;
@@ -353,7 +358,8 @@ namespace System.Management
             /// </value>
             public QualifierData Current
             {
-                get {
+                get
+                {
                     if ((index == -1) || (index == qualifierNames.Length))
                         throw new InvalidOperationException();
                     else
@@ -403,7 +409,8 @@ namespace System.Management
         /// </value>
         public virtual QualifierData this[string qualifierName]
         {
-            get {
+            get
+            {
                 if (null == qualifierName)
                     throw new ArgumentNullException(nameof(qualifierName));
 
index dd0b5ce..4802152 100644 (file)
@@ -72,7 +72,7 @@ namespace System.Management
         private CodeTypeDeclaration ecc;
         private CodeTypeDeclaration EnumObj;
         private CodeNamespace cn;
-        private CodeMemberProperty  cmp;
+        private CodeMemberProperty cmp;
         private CodeConstructor cctor;
         private CodeMemberField cf;
         private CodeObjectCreateExpression coce;
@@ -90,19 +90,19 @@ namespace System.Management
         private CodeAttributeDeclaration cad;
 
 
-        private readonly ArrayList arrKeyType    = new ArrayList(5);
-        private readonly ArrayList arrKeys        = new ArrayList(5);
-        private readonly ArrayList BitMap        = new ArrayList(5);
-        private ArrayList BitValues        = new ArrayList(5);
-        private readonly ArrayList ValueMap        = new ArrayList(5);
-        private ArrayList Values        = new ArrayList(5);
+        private readonly ArrayList arrKeyType = new ArrayList(5);
+        private readonly ArrayList arrKeys = new ArrayList(5);
+        private readonly ArrayList BitMap = new ArrayList(5);
+        private ArrayList BitValues = new ArrayList(5);
+        private readonly ArrayList ValueMap = new ArrayList(5);
+        private ArrayList Values = new ArrayList(5);
 
         private SortedList PublicProperties = new SortedList(StringComparer.OrdinalIgnoreCase);
-        private SortedList PublicMethods    = new SortedList (StringComparer.OrdinalIgnoreCase);
-        private SortedList PublicNamesUsed    = new SortedList(StringComparer.OrdinalIgnoreCase);
+        private SortedList PublicMethods = new SortedList(StringComparer.OrdinalIgnoreCase);
+        private SortedList PublicNamesUsed = new SortedList(StringComparer.OrdinalIgnoreCase);
         private SortedList PrivateNamesUsed = new SortedList(StringComparer.OrdinalIgnoreCase);
 
-        private bool        bHasEmbeddedProperties = false;
+        private bool bHasEmbeddedProperties = false;
 
 
         /// <summary>
@@ -167,14 +167,14 @@ namespace System.Management
         public bool GenerateCode(CodeLanguage lang, string filePath, string netNamespace)
         {
             // check for proper arguments
-            if (filePath == null )
+            if (filePath == null)
             {
-                throw new ArgumentOutOfRangeException (SR.NullFilePathException);
+                throw new ArgumentOutOfRangeException(SR.NullFilePathException);
             }
 
             if (filePath.Length == 0)
             {
-                throw new ArgumentOutOfRangeException (SR.EmptyFilePathException);
+                throw new ArgumentOutOfRangeException(SR.EmptyFilePathException);
             }
 
             NETNamespace = netNamespace;
@@ -183,7 +183,7 @@ namespace System.Management
             InitializeCodeGeneration();
 
             //Now create the filestream (output file)
-            tw = new StreamWriter(new FileStream (filePath, FileMode.Create), System.Text.Encoding.UTF8);
+            tw = new StreamWriter(new FileStream(filePath, FileMode.Create), System.Text.Encoding.UTF8);
 
             return GenerateAndWriteCode(lang);
 
@@ -196,14 +196,14 @@ namespace System.Management
         {
             if (classobj == null)
             {
-                if (OriginalNamespace == null || ( OriginalNamespace != null && OriginalNamespace.Length == 0))
+                if (OriginalNamespace == null || (OriginalNamespace != null && OriginalNamespace.Length == 0))
                 {
-                    throw new ArgumentOutOfRangeException (SR.NamespaceNotInitializedException);
+                    throw new ArgumentOutOfRangeException(SR.NamespaceNotInitializedException);
                 }
 
-                if (OriginalClassName == null || ( OriginalClassName != null && OriginalClassName.Length == 0))
+                if (OriginalClassName == null || (OriginalClassName != null && OriginalClassName.Length == 0))
                 {
-                    throw new ArgumentOutOfRangeException (SR.ClassNameNotInitializedException);
+                    throw new ArgumentOutOfRangeException(SR.ClassNameNotInitializedException);
                 }
             }
         }
@@ -239,7 +239,7 @@ namespace System.Management
         private CodeTypeDeclaration GetCodeTypeDeclarationForClass(bool bIncludeSystemClassinClassDef)
         {
             //Create type defination for the class
-            cc = new CodeTypeDeclaration (PrivateNamesUsed["GeneratedClassName"].ToString());
+            cc = new CodeTypeDeclaration(PrivateNamesUsed["GeneratedClassName"].ToString());
             // Adding Component as base class so as to enable drag and drop
             cc.BaseTypes.Add(new CodeTypeReference(PrivateNamesUsed["ComponentClass"].ToString()));
 
@@ -346,7 +346,7 @@ namespace System.Management
 
             // Generate a property "StaticScope" to set and get the static ManagementScope for the class
             GeneratePublicProperty(PrivateNamesUsed["staticScope"].ToString(), PublicNamesUsed["ScopeClass"].ToString(),
-                new CodeVariableReferenceExpression(PrivateNamesUsed["statMgmtScope"].ToString()), true,    SR.CommentStaticScopeProperty, true);
+                new CodeVariableReferenceExpression(PrivateNamesUsed["statMgmtScope"].ToString()), true, SR.CommentStaticScopeProperty, true);
 
             // Generate a function to check if a given class can be represented
             // by the generated class
@@ -495,11 +495,11 @@ namespace System.Management
             cc.Name = cp.CreateValidIdentifier(cc.Name);
 
             //As we have finished the class definition, generate the class code NOW!!!!!
-            cn.Types.Add (cc);
+            cn.Types.Add(cc);
 
             try
             {
-                cp.GenerateCodeFromNamespace (cn, tw, new CodeGeneratorOptions());
+                cp.GenerateCodeFromNamespace(cn, tw, new CodeGeneratorOptions());
             }
             finally
             {
@@ -542,7 +542,7 @@ namespace System.Management
                             " results in " + thePath.Path);
                             */
                 }
-                classobj = new ManagementClass (thePath);
+                classobj = new ManagementClass(thePath);
             }
             else
             {
@@ -705,7 +705,7 @@ namespace System.Management
             foreach (string s in PublicNamesUsed.Values)
             {
                 nIndex = IsContainedIn(s, ref PublicProperties);
-                if ( nIndex != -1)
+                if (nIndex != -1)
                 {
                     //We had found a collision with a public property
                     //So we will resolve the collision by changing the property name
@@ -765,10 +765,10 @@ namespace System.Management
 
             //Now we will create the CollectionClass and Enumerator Class names as they are dependent on the
             //generated class name and the generated class name might have changed due to collision
-            string strTemp = PrivateNamesUsed["GeneratedClassName"].ToString()+"Collection";
+            string strTemp = PrivateNamesUsed["GeneratedClassName"].ToString() + "Collection";
             PrivateNamesUsed.Add("CollectionClass", ResolveCollision(strTemp, true));
 
-            strTemp = PrivateNamesUsed["GeneratedClassName"].ToString()+"Enumerator";
+            strTemp = PrivateNamesUsed["GeneratedClassName"].ToString() + "Enumerator";
             PrivateNamesUsed.Add("EnumeratorClass", ResolveCollision(strTemp, true));
         }
 
@@ -791,7 +791,7 @@ namespace System.Management
             if (bCheckthisFirst == false)
             {
                 k++;
-                strTemp = strTemp + strToAdd +k.ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int)));
+                strTemp = strTemp + strToAdd + k.ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int)));
             }
 
             while (bCollision == true)
@@ -820,13 +820,13 @@ namespace System.Management
                     strToAdd = strToAdd + "_";
                     k = 0;
                 }
-                strTemp = inString + strToAdd +k.ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int)));
+                strTemp = inString + strToAdd + k.ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int)));
             }
 
             if (strTemp.Length > 0)
             {
                 string strFirstChar = strTemp.Substring(0, 1).ToUpper(CultureInfo.InvariantCulture);
-                strTemp = strFirstChar + strTemp.Substring(1, strTemp.Length -1);
+                strTemp = strFirstChar + strTemp.Substring(1, strTemp.Length - 1);
             }
 
             return strTemp;
@@ -845,7 +845,7 @@ namespace System.Management
             if (NETNamespace.Length == 0)
             {
                 strNs = OriginalNamespace;
-                strNs = strNs.Replace ('\\', '.');
+                strNs = strNs.Replace('\\', '.');
                 strNs = strNs.ToUpper(CultureInfo.InvariantCulture);
             }
             else
@@ -863,7 +863,7 @@ namespace System.Management
                     strNs += strClass;
                 }
                 //Now trim the class name without the first '_'
-                strClass = OriginalClassName.Substring(OriginalClassName.IndexOf('_')+1);
+                strClass = OriginalClassName.Substring(OriginalClassName.IndexOf('_') + 1);
             }
             else
             {
@@ -876,21 +876,21 @@ namespace System.Management
                 strClass = "C" + strClass;
             }
 
-            strClass = ResolveCollision (strClass, true);
+            strClass = ResolveCollision(strClass, true);
 
             // Try to get a type from any of the namespace which are used in the generated code and see if
             // it collides with any of the standard classes.
-            if (Type.GetType("System." + strClass) !=  null ||
-                Type.GetType("System.ComponentModel." + strClass) !=  null ||
-                Type.GetType("System.Management." + strClass) !=  null ||
-                Type.GetType("System.Collections." + strClass) !=  null ||
-                Type.GetType("System.Globalization." + strClass) !=  null )
+            if (Type.GetType("System." + strClass) != null ||
+                Type.GetType("System.ComponentModel." + strClass) != null ||
+                Type.GetType("System.Management." + strClass) != null ||
+                Type.GetType("System.Collections." + strClass) != null ||
+                Type.GetType("System.Globalization." + strClass) != null)
             {
                 PublicNamesUsed.Add(strClass, strClass);
                 strClass = ResolveCollision(strClass, true);
             }
 
-            PrivateNamesUsed.Add ("GeneratedClassName", strClass);
+            PrivateNamesUsed.Add("GeneratedClassName", strClass);
             PrivateNamesUsed.Add("GeneratedNamespace", strNs);
         }
 
@@ -900,9 +900,9 @@ namespace System.Management
         {
             //Now add the import statements
             cn = new CodeNamespace(PrivateNamesUsed["GeneratedNamespace"].ToString());
-            cn.Imports.Add (new CodeNamespaceImport("System"));
-            cn.Imports.Add (new CodeNamespaceImport("System.ComponentModel"));
-            cn.Imports.Add (new CodeNamespaceImport("System.Management"));
+            cn.Imports.Add(new CodeNamespaceImport("System"));
+            cn.Imports.Add(new CodeNamespaceImport("System.ComponentModel"));
+            cn.Imports.Add(new CodeNamespaceImport("System.Management"));
             cn.Imports.Add(new CodeNamespaceImport("System.Collections"));
             cn.Imports.Add(new CodeNamespaceImport("System.Globalization"));
 
@@ -929,7 +929,7 @@ namespace System.Management
         /// <param name="Comment"></param>
         private void GeneratePublicReadOnlyProperty(string propName, string propType, object propValue, bool isLiteral, bool isBrowsable, string Comment)
         {
-            cmp = new CodeMemberProperty ();
+            cmp = new CodeMemberProperty();
             cmp.Name = propName;
             cmp.Attributes = MemberAttributes.Public | MemberAttributes.Final;
             cmp.Type = new CodeTypeReference(propType);
@@ -951,14 +951,14 @@ namespace System.Management
 
             if (isLiteral == true)
             {
-                cmp.GetStatements.Add (new CodeMethodReturnStatement (new CodeSnippetExpression(propValue.ToString())));
+                cmp.GetStatements.Add(new CodeMethodReturnStatement(new CodeSnippetExpression(propValue.ToString())));
             }
             else
             {
-                cmp.GetStatements.Add (new CodeMethodReturnStatement (new CodePrimitiveExpression(propValue)));
+                cmp.GetStatements.Add(new CodeMethodReturnStatement(new CodePrimitiveExpression(propValue)));
             }
-            cc.Members.Add (cmp);
-            if (Comment != null && Comment.Length != 0 )
+            cc.Members.Add(cmp);
+            if (Comment != null && Comment.Length != 0)
             {
                 cmp.Comments.Add(new CodeCommentStatement(Comment));
             }
@@ -1085,7 +1085,7 @@ namespace System.Management
         private CodeTypeDeclaration GenerateSystemPropertiesClass()
         {
             CodeTypeDeclaration SysPropsClass = new CodeTypeDeclaration(PublicNamesUsed["SystemPropertiesClass"].ToString());
-            SysPropsClass.TypeAttributes =TypeAttributes.NestedPublic;
+            SysPropsClass.TypeAttributes = TypeAttributes.NestedPublic;
 
             //First create the constructor
             //    public ManagementSystemProperties(ManagementObject obj)
@@ -1100,19 +1100,19 @@ namespace System.Management
             SysPropsClass.Members.Add(cctor);
 
             caa = new CodeAttributeArgument();
-            caa.Value = new CodeTypeOfExpression (typeof(System.ComponentModel.ExpandableObjectConverter));
+            caa.Value = new CodeTypeOfExpression(typeof(System.ComponentModel.ExpandableObjectConverter));
             cad = new CodeAttributeDeclaration();
             cad.Name = PublicNamesUsed["TypeConverter"].ToString();
             cad.Arguments.Add(caa);
             SysPropsClass.CustomAttributes.Add(cad);
 
-            char [] strPropTemp;
-            char [] strPropName;
+            char[] strPropTemp;
+            char[] strPropName;
             int i = 0;
 
             foreach (PropertyData prop in classobj.SystemProperties)
             {
-                cmp = new CodeMemberProperty ();
+                cmp = new CodeMemberProperty();
                 //All properties are browsable by default.
                 caa = new CodeAttributeArgument();
                 caa.Value = new CodePrimitiveExpression(true);
@@ -1124,7 +1124,7 @@ namespace System.Management
 
                 //Now we will have to find the occurrence of the first character and trim all the characters before that
                 strPropTemp = prop.Name.ToCharArray();
-                for (i=0; i < strPropTemp.Length; i++)
+                for (i = 0; i < strPropTemp.Length; i++)
                 {
                     if (char.IsLetterOrDigit(strPropTemp[i]) == true)
                     {
@@ -1136,7 +1136,7 @@ namespace System.Management
                     i = 0;
                 }
                 strPropName = new char[strPropTemp.Length - i];
-                for (int j=i; j < strPropTemp.Length; j++)
+                for (int j = i; j < strPropTemp.Length; j++)
                 {
                     strPropName[j - i] = strPropTemp[j];
                 }
@@ -1147,9 +1147,9 @@ namespace System.Management
 
                 cie = new CodeIndexerExpression(
                     new CodeVariableReferenceExpression(PrivateNamesUsed["LateBoundObject"].ToString()),
-                    new CodeExpression[] {new CodePrimitiveExpression(prop.Name)});
+                    new CodeExpression[] { new CodePrimitiveExpression(prop.Name) });
 
-                cmp.GetStatements.Add (new CodeMethodReturnStatement (new CodeCastExpression(cmp.Type, cie)));
+                cmp.GetStatements.Add(new CodeMethodReturnStatement(new CodeCastExpression(cmp.Type, cie)));
                 SysPropsClass.Members.Add(cmp);
             }
             //private WmiObject _privObject
@@ -1179,7 +1179,7 @@ namespace System.Management
             string IsValidPropName = string.Empty;
             bool bDateIsTimeInterval = false;
 
-            for (int i=0; i< PublicProperties.Count; i++)
+            for (int i = 0; i < PublicProperties.Count; i++)
             {
                 bDateIsTimeInterval = false;
                 PropertyData prop = classobj.Properties[PublicProperties.GetKey(i).ToString()];
@@ -1187,7 +1187,7 @@ namespace System.Management
                 bWrite = true;        //All properties are writeable by default
                 bStatic = false;    //By default all properties are non static
 
-                cmp = new CodeMemberProperty ();
+                cmp = new CodeMemberProperty();
                 cmp.Name = PublicProperties[prop.Name].ToString();
                 cmp.Attributes = MemberAttributes.Public | MemberAttributes.Final;
                 cmp.Type = ConvertCIMType(prop.Type, prop.IsArray);
@@ -1212,7 +1212,7 @@ namespace System.Management
                 // Method for Is<PropertyName>Null property
                 IsValidPropName = "Is" + PublicProperties[prop.Name].ToString() + "Null";
 
-                cmp2 = new CodeMemberProperty ();
+                cmp2 = new CodeMemberProperty();
                 cmp2.Name = IsValidPropName;
                 cmp2.Attributes = MemberAttributes.Public | MemberAttributes.Final;
                 cmp2.Type = new CodeTypeReference("System.Boolean");
@@ -1245,7 +1245,7 @@ namespace System.Management
 
                 cie = new CodeIndexerExpression(
                     new CodeVariableReferenceExpression(PrivateNamesUsed["CurrentObject"].ToString()),
-                    new CodeExpression[] {new CodePrimitiveExpression(prop.Name)});
+                    new CodeExpression[] { new CodePrimitiveExpression(prop.Name) });
 
 
                 bool bNullable = false;
@@ -1277,7 +1277,7 @@ namespace System.Management
 
                 if (bRead == true)
                 {
-                    if (IsPropertyValueType(prop.Type)  && prop.IsArray == false)
+                    if (IsPropertyValueType(prop.Type) && prop.IsArray == false)
                     {
 
                         /*
@@ -1300,14 +1300,14 @@ namespace System.Management
                             new CodePrimitiveExpression(null));
 
 
-                        cis.TrueStatements.Add(new CodeMethodReturnStatement (new CodePrimitiveExpression(true) ));
-                        cis.FalseStatements.Add(new CodeMethodReturnStatement (new CodePrimitiveExpression(false) ));
-                        cmp2.GetStatements.Add (cis);
-                        cc.Members.Add (cmp2);
+                        cis.TrueStatements.Add(new CodeMethodReturnStatement(new CodePrimitiveExpression(true)));
+                        cis.FalseStatements.Add(new CodeMethodReturnStatement(new CodePrimitiveExpression(false)));
+                        cmp2.GetStatements.Add(cis);
+                        cc.Members.Add(cmp2);
 
                         // Adding TypeConverter Attribute
                         caa = new CodeAttributeArgument();
-                        caa.Value = new CodeTypeOfExpression (PrivateNamesUsed["ConverterClass"].ToString());
+                        caa.Value = new CodeTypeOfExpression(PrivateNamesUsed["ConverterClass"].ToString());
                         cad = new CodeAttributeDeclaration();
                         cad.Name = PublicNamesUsed["TypeConverter"].ToString();
                         cad.Arguments.Add(caa);
@@ -1326,7 +1326,7 @@ namespace System.Management
                             {
                                 if (prop.IsArray)
                                 {
-                                    cis.TrueStatements.Add(new CodeMethodReturnStatement (new CodePrimitiveExpression(null)));
+                                    cis.TrueStatements.Add(new CodeMethodReturnStatement(new CodePrimitiveExpression(null)));
                                 }
                                 else
                                 {
@@ -1339,7 +1339,7 @@ namespace System.Management
                                     cmie.Method.TargetObject = new CodeTypeReferenceExpression("System.Convert");
                                     cmie.Parameters.Add(new CodePrimitiveExpression(prop.NullEnumValue));
                                     cmie.Method.MethodName = arrConvFuncName;
-                                    cis.TrueStatements.Add(new CodeMethodReturnStatement (new CodeCastExpression(cmp.Type, cmie )));
+                                    cis.TrueStatements.Add(new CodeMethodReturnStatement(new CodeCastExpression(cmp.Type, cmie)));
                                 }
                             }
                             else
@@ -1355,7 +1355,7 @@ namespace System.Management
                                 cmie.Method.TargetObject = new CodeTypeReferenceExpression("System.Convert");
                                 if (prop.IsArray)
                                 {
-                                    CodeExpression [] cInit = {cmie };
+                                    CodeExpression[] cInit = { cmie };
                                     cis.TrueStatements.Add(new CodeMethodReturnStatement(
                                         new CodeArrayCreateExpression(cmp.Type, cInit)));
 
@@ -1363,10 +1363,10 @@ namespace System.Management
                                 else
                                 {
                                     // return (<EnumName>)System.Convert.<ConvertFuncName>(0);
-                                    cis.TrueStatements.Add(new CodeMethodReturnStatement (cmie));
+                                    cis.TrueStatements.Add(new CodeMethodReturnStatement(cmie));
                                 }
                             }
-                            cmp.GetStatements.Add (cis);
+                            cmp.GetStatements.Add(cis);
                         }
 
                         /*
@@ -1382,7 +1382,7 @@ namespace System.Management
                         */
                         cmm = new CodeMemberMethod();
                         cmm.Name = "ShouldSerialize" + PublicProperties[prop.Name].ToString();
-                        cmm.Attributes = MemberAttributes.Private |  MemberAttributes.Final;
+                        cmm.Attributes = MemberAttributes.Private | MemberAttributes.Final;
                         cmm.ReturnType = new CodeTypeReference("System.Boolean");
 
                         CodeConditionStatement cis2 = new CodeConditionStatement();
@@ -1395,7 +1395,7 @@ namespace System.Management
 
                         cmm.Statements.Add(cis2);
                         cmm.Statements.Add(new CodeMethodReturnStatement(new CodePrimitiveExpression(false)));
-                        cc.Members.Add (cmm);
+                        cc.Members.Add(cmm);
                     }
 
                     if (prop.Type == CimType.Reference)
@@ -1434,12 +1434,12 @@ namespace System.Management
                                 cmie.Method.TargetObject = new CodeTypeReferenceExpression("System.Convert");
                                 cmie.Parameters.Add(cie);
                                 cmie.Method.MethodName = arrConvFuncName;
-                                cmp.GetStatements.Add (new CodeMethodReturnStatement (new CodeCastExpression(cmp.Type, cmie )));
+                                cmp.GetStatements.Add(new CodeMethodReturnStatement(new CodeCastExpression(cmp.Type, cmie)));
                             }
                         }
                         else
                         {
-                            cmp.GetStatements.Add (new CodeMethodReturnStatement (new CodeCastExpression(cmp.Type, cie)));
+                            cmp.GetStatements.Add(new CodeMethodReturnStatement(new CodeCastExpression(cmp.Type, cie)));
                         }
                     }
 
@@ -1450,9 +1450,9 @@ namespace System.Management
                 {
                     if (bNullable)
                     {
-                        cmm2 = new CodeMemberMethod ();
+                        cmm2 = new CodeMemberMethod();
                         cmm2.Name = "Reset" + PublicProperties[prop.Name].ToString();
-                        cmm2.Attributes = MemberAttributes.Private |  MemberAttributes.Final;
+                        cmm2.Attributes = MemberAttributes.Private | MemberAttributes.Final;
                         cmm2.Statements.Add(new CodeAssignStatement(cie, new CodePrimitiveExpression(null)));
                     }
 
@@ -1504,14 +1504,14 @@ namespace System.Management
                                     CodeBinaryOperatorType.ValueEquality,
                                     new CodeArrayIndexerExpression(new CodeVariableReferenceExpression("value"),
                                         new CodePrimitiveExpression(0)));
-                           }
-                           else
-                           {
+                            }
+                            else
+                            {
                                 ccs.Condition = new CodeBinaryOperatorExpression(
                                     new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(new CodeTypeReference(PublicProperties[prop.Name].ToString() + "Values")), "NULL_ENUM_VALUE"),
                                     CodeBinaryOperatorType.ValueEquality,
                                     new CodeSnippetExpression("value"));
-                           }
+                            }
                             ccs.TrueStatements.Add(new CodeAssignStatement(cie, new CodePrimitiveExpression(null)));
                             ccs.FalseStatements.Add(new CodeAssignStatement(cie, new CodeSnippetExpression("value")));
                             cmp.SetStatements.Add(ccs);
@@ -1632,8 +1632,8 @@ namespace System.Management
                         writeValue = false;
                     }
                 }
-                    // check for ValueMap/Values and BitMap/BitValues pair and create
-                    // Enum Accordingly
+                // check for ValueMap/Values and BitMap/BitValues pair and create
+                // Enum Accordingly
                 else if (string.Equals(q.Name, "ValueMap", StringComparison.OrdinalIgnoreCase) && bMapsFailed == false)
                 {
                     try
@@ -1644,8 +1644,8 @@ namespace System.Management
                         {
                             if (q.Value != null)
                             {
-                                string [] strArray = (string [])q.Value;
-                                for (int i=0; i < strArray.Length; i++)
+                                string[] strArray = (string[])q.Value;
+                                for (int i = 0; i < strArray.Length; i++)
                                 {
                                     try
                                     {
@@ -1658,13 +1658,13 @@ namespace System.Management
                             }
                         }
                     }
-                        // if the value is not a numerical, then we cannot construct a enum
+                    // if the value is not a numerical, then we cannot construct a enum
                     catch (System.FormatException)
                     {
                         bMapsFailed = true;
                         ValueMap.Clear();
                     }
-                    catch (System.InvalidCastException )
+                    catch (System.InvalidCastException)
                     {
                         // This exception may occur if the qualifier value is not an array as expected
                         ValueMap.Clear();
@@ -1680,8 +1680,8 @@ namespace System.Management
                             if (q.Value != null)
                             {
                                 ArrayList arTemp = new ArrayList(5);
-                                string [] strArray = (string[])q.Value;
-                                for (int i=0; i < strArray.Length; i++)
+                                string[] strArray = (string[])q.Value;
+                                for (int i = 0; i < strArray.Length; i++)
                                 {
                                     if (strArray[i].Length == 0)
                                     {
@@ -1696,7 +1696,7 @@ namespace System.Management
                             }
                         }
                     }
-                    catch (System.InvalidCastException )
+                    catch (System.InvalidCastException)
                     {
                         // This exception may occur if the qualifier value is not an array as expected
                         Values.Clear();
@@ -1712,21 +1712,21 @@ namespace System.Management
                         {
                             if (q.Value != null)
                             {
-                                string [] strArray = (string [])q.Value;
-                                for (int i=0; i < strArray.Length; i++)
+                                string[] strArray = (string[])q.Value;
+                                for (int i = 0; i < strArray.Length; i++)
                                 {
                                     BitMap.Add(ConvertBitMapValueToInt32(strArray[i]));
                                 }
                             }
                         }
                     }
-                        // if the value is not a numerical, then we cannot construct a enum
+                    // if the value is not a numerical, then we cannot construct a enum
                     catch (System.FormatException)
                     {
                         BitMap.Clear();
                         bMapsFailed = true;
                     }
-                    catch (System.InvalidCastException )
+                    catch (System.InvalidCastException)
                     {
                         // This exception may occur if the qualifier value is not an array as expected
                         BitMap.Clear();
@@ -1742,8 +1742,8 @@ namespace System.Management
                             if (q.Value != null)
                             {
                                 ArrayList arTemp = new ArrayList(5);
-                                string [] strArray = (string [])q.Value;
-                                for (int i=0; i < strArray.Length; i++)
+                                string[] strArray = (string[])q.Value;
+                                for (int i = 0; i < strArray.Length; i++)
                                 {
                                     if (strArray[i].Length == 0)
                                     {
@@ -1758,7 +1758,7 @@ namespace System.Management
                             }
                         }
                     }
-                    catch (System.InvalidCastException )
+                    catch (System.InvalidCastException)
                     {
                         // This exception may occur if the qualifier value is not an array as expected
                         BitValues.Clear();
@@ -1772,9 +1772,9 @@ namespace System.Management
 
             // Property is not writeable only if "read" qualifier is present and its value is "true"
             // Also, for dynamic classes, absence of "write" qualifier means that the property is read-only.
-            if ((!bDynamicClass && !hasWrite )||
-                (!bDynamicClass && hasWrite && writeValue)||
-                (bDynamicClass && hasWrite && writeValue) )
+            if ((!bDynamicClass && !hasWrite||
+                (!bDynamicClass && hasWrite && writeValue) ||
+                (bDynamicClass && hasWrite && writeValue))
             {
                 bWrite = true;
             }
@@ -1838,7 +1838,7 @@ namespace System.Management
                     {
                         cmf.InitExpression = new CodePrimitiveExpression(ValueMap[i]);
                         long test = System.Convert.ToInt64(ValueMap[i], (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(ulong)));
-                        if (test > maxValue) maxValue=test;
+                        if (test > maxValue) maxValue = test;
 
                         if (bZeroFieldInEnum == false)
                         {
@@ -1854,7 +1854,7 @@ namespace System.Management
                     else
                     {
                         cmf.InitExpression = new CodePrimitiveExpression(i);
-                        if (i > maxValue) maxValue=i;
+                        if (i > maxValue) maxValue = i;
                     }
                     EnumObj.Members.Add(cmf);
                 }
@@ -1862,7 +1862,7 @@ namespace System.Management
                 // If there is no 0 valued field in enum, just add a invalid for enum
                 // This is just to show in property browser
 
-                if ((bNullable == true)  &&  (bZeroFieldInEnum == false))
+                if ((bNullable == true) && (bZeroFieldInEnum == false))
                 {
                     // use the 0 enum position for NULL
                     cmf = new CodeMemberField();
@@ -1871,20 +1871,20 @@ namespace System.Management
                     EnumObj.Members.Add(cmf);
                     prop.NullEnumValue = 0;
                 }
-                else if ((bNullable == true) &&  (bZeroFieldInEnum == true))
+                else if ((bNullable == true) && (bZeroFieldInEnum == true))
                 {
                     // must create an entry for NULL that is not zero and is not used
                     // use the another unused enum position for NULL
-                    cmf = new CodeMemberField ();
+                    cmf = new CodeMemberField();
                     cmf.Name = "NULL_ENUM_VALUE";
-                    cmf.InitExpression = new CodePrimitiveExpression((int)(maxValue+1));
+                    cmf.InitExpression = new CodePrimitiveExpression((int)(maxValue + 1));
                     EnumObj.Members.Add(cmf);
-                    prop.NullEnumValue = (int)(maxValue+1);
+                    prop.NullEnumValue = (int)(maxValue + 1);
                 }
                 else if ((bNullable == false) && (bZeroFieldInEnum == false))
                 {
                     // add an entry for 0 valued enum
-                    cmf = new CodeMemberField ();
+                    cmf = new CodeMemberField();
                     cmf.Name = "INVALID_ENUM_VALUE";
                     cmf.InitExpression = new CodePrimitiveExpression(0);
                     EnumObj.Members.Add(cmf);
@@ -1942,12 +1942,12 @@ namespace System.Management
                     {
                         cmf.InitExpression = new CodePrimitiveExpression(BitMap[i]);
                         long test = System.Convert.ToInt64(BitMap[i], (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(ulong)));
-                        if (test > maxBitValue) maxBitValue=test;
+                        if (test > maxBitValue) maxBitValue = test;
                     }
                     else
                     {
                         cmf.InitExpression = new CodePrimitiveExpression(bitValue);
-                        if (bitValue > maxBitValue) maxBitValue=bitValue;
+                        if (bitValue > maxBitValue) maxBitValue = bitValue;
 
                         // Now shift 1 more bit so that we can put it for the
                         // next element in the enum
@@ -1957,7 +1957,7 @@ namespace System.Management
 
                     if (bZeroFieldInEnum == false)
                     {
-                        if ( (System.Convert.ToInt64(BitMap[i], (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(ulong))) == 0) )
+                        if ((System.Convert.ToInt64(BitMap[i], (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(ulong))) == 0))
                         {
                             bZeroFieldInEnum = true;
                         }
@@ -1968,24 +1968,24 @@ namespace System.Management
                 // If there is no 0 valued field in enum, just add a invalid for enum
                 // This is just to show in property browser
 
-                if ((bNullable == true) &&  (bZeroFieldInEnum == false))
+                if ((bNullable == true) && (bZeroFieldInEnum == false))
                 {
                     // use the 0 enum position for NULL
-                    cmf = new CodeMemberField ();
+                    cmf = new CodeMemberField();
                     cmf.Name = "NULL_ENUM_VALUE";
                     cmf.InitExpression = new CodePrimitiveExpression(0);
                     EnumObj.Members.Add(cmf);
                     prop.NullEnumValue = 0;
                 }
-                else if ((bNullable == true) &&  (bZeroFieldInEnum == true))
+                else if ((bNullable == true) && (bZeroFieldInEnum == true))
                 {
                     // must create an entry for NULL that is not zero and is not used
                     // use the another unused enum position for NULL
-                    cmf = new CodeMemberField ();
+                    cmf = new CodeMemberField();
                     cmf.Name = "NULL_ENUM_VALUE";
                     if (BitValues.Count > 30)
                     {
-                         maxBitValue = maxBitValue + 1;
+                        maxBitValue = maxBitValue + 1;
                     }
                     else
                     {
@@ -1993,14 +1993,14 @@ namespace System.Management
                     }
                     cmf.InitExpression = new CodePrimitiveExpression((int)(maxBitValue));
                     EnumObj.Members.Add(cmf);
-                     // just add one - we won't preserve the bit shifting but this won't be used in CIM anyway.
-                     prop.NullEnumValue = (int)(maxBitValue);
+                    // just add one - we won't preserve the bit shifting but this won't be used in CIM anyway.
+                    prop.NullEnumValue = (int)(maxBitValue);
 
                 }
                 else if ((bNullable == false) && (bZeroFieldInEnum == false))
                 {
                     // add an entry for 0 valued enum
-                    cmf = new CodeMemberField ();
+                    cmf = new CodeMemberField();
                     cmf.Name = "INVALID_ENUM_VALUE";
                     cmf.InitExpression = new CodePrimitiveExpression(0);
                     EnumObj.Members.Add(cmf);
@@ -2039,11 +2039,11 @@ namespace System.Management
             cmm.Attributes = MemberAttributes.Private | MemberAttributes.Static | MemberAttributes.Final;
             cmm.ReturnType = new CodeTypeReference("System.String");
 
-            for (int i=0; i < arrKeys.Count; i++)
+            for (int i = 0; i < arrKeys.Count; i++)
             {
                 strType = ((CodeTypeReference)arrKeyType[i]).BaseType;
                 cmm.Parameters.Add(new CodeParameterDeclarationExpression(strType,
-                    "key"+arrKeys[i].ToString()));
+                    "key" + arrKeys[i].ToString()));
             }
 
             string strPath = OriginalNamespace + ":" + OriginalClassName;
@@ -2059,15 +2059,15 @@ namespace System.Management
                 cmm.Statements.Add(new CodeVariableDeclarationStatement("System.String", strPathObject, new CodePrimitiveExpression(strPath)));
                 CodeMethodInvokeExpression cmietoAdd;
 
-                for (int i=0; i < arrKeys.Count; i++)
+                for (int i = 0; i < arrKeys.Count; i++)
                 {
                     if (((CodeTypeReference)arrKeyType[i]).BaseType == "System.String")
                     {
-                        CodeMethodInvokeExpression cmie1 = GenerateConcatStrings(new CodeVariableReferenceExpression("key"+arrKeys[i]), new CodePrimitiveExpression("\""));
+                        CodeMethodInvokeExpression cmie1 = GenerateConcatStrings(new CodeVariableReferenceExpression("key" + arrKeys[i]), new CodePrimitiveExpression("\""));
 
                         CodeMethodInvokeExpression cmie2 = GenerateConcatStrings(new CodePrimitiveExpression("\""), cmie1);
 
-                        CodeMethodInvokeExpression cmie3 = GenerateConcatStrings(new CodePrimitiveExpression(((i==0)?("."+arrKeys[i]+"="):(","+arrKeys[i]+"="))), cmie2);
+                        CodeMethodInvokeExpression cmie3 = GenerateConcatStrings(new CodePrimitiveExpression(((i == 0) ? ("." + arrKeys[i] + "=") : ("," + arrKeys[i] + "="))), cmie2);
 
                         cmietoAdd = GenerateConcatStrings(new CodeVariableReferenceExpression(strPathObject), cmie3);
 
@@ -2075,10 +2075,10 @@ namespace System.Management
                     else
                     {
                         cmie = new CodeMethodInvokeExpression();
-                        cmie.Method.TargetObject = new CodeCastExpression(new CodeTypeReference(((CodeTypeReference)arrKeyType[i]).BaseType + " "), new CodeVariableReferenceExpression("key"+arrKeys[i]));
+                        cmie.Method.TargetObject = new CodeCastExpression(new CodeTypeReference(((CodeTypeReference)arrKeyType[i]).BaseType + " "), new CodeVariableReferenceExpression("key" + arrKeys[i]));
                         cmie.Method.MethodName = "ToString";
 
-                        CodeMethodInvokeExpression cmie1 = GenerateConcatStrings(new CodePrimitiveExpression(((i==0)?("."+arrKeys[i]+"="):(","+arrKeys[i]+"="))), cmie);
+                        CodeMethodInvokeExpression cmie1 = GenerateConcatStrings(new CodePrimitiveExpression(((i == 0) ? ("." + arrKeys[i] + "=") : ("," + arrKeys[i] + "="))), cmie);
 
                         cmietoAdd = GenerateConcatStrings(new CodeVariableReferenceExpression(strPathObject), cmie1);
 
@@ -2147,11 +2147,11 @@ namespace System.Management
                 cmieInit.Method.MethodName = PrivateNamesUsed["InitialObjectFunc"].ToString();
                 cmieInit.Method.TargetObject = new CodeThisReferenceExpression();
 
-                for (int i=0; i < arrKeys.Count; i++)
+                for (int i = 0; i < arrKeys.Count; i++)
                 {
                     cpde = new CodeParameterDeclarationExpression();
                     cpde.Type = new CodeTypeReference(((CodeTypeReference)arrKeyType[i]).BaseType);
-                    cpde.Name = "key"+arrKeys[i].ToString();
+                    cpde.Name = "key" + arrKeys[i].ToString();
                     cctor.Parameters.Add(cpde);
                 }
 
@@ -2172,9 +2172,9 @@ namespace System.Management
                 cmie.Method.TargetObject = new CodeTypeReferenceExpression(PrivateNamesUsed["GeneratedClassName"].ToString());
                 cmie.Method.MethodName = PublicNamesUsed["ConstructPathFunction"].ToString();
 
-                for (int i=0; i < arrKeys.Count; i++)
+                for (int i = 0; i < arrKeys.Count; i++)
                 {
-                    cmie.Parameters.Add(new CodeVariableReferenceExpression("key"+arrKeys[i]));
+                    cmie.Parameters.Add(new CodeVariableReferenceExpression("key" + arrKeys[i]));
                 }
 
                 coce = new CodeObjectCreateExpression();
@@ -2206,11 +2206,11 @@ namespace System.Management
 
             if (arrKeyType.Count > 0)
             {
-                for (int i=0; i < arrKeys.Count; i++)
+                for (int i = 0; i < arrKeys.Count; i++)
                 {
                     cpde = new CodeParameterDeclarationExpression();
                     cpde.Type = new CodeTypeReference(((CodeTypeReference)arrKeyType[i]).BaseType);
-                    cpde.Name = "key"+arrKeys[i].ToString();
+                    cpde.Name = "key" + arrKeys[i].ToString();
                     cctor.Parameters.Add(cpde);
                 }
 
@@ -2233,9 +2233,9 @@ namespace System.Management
                 cmie.Method.TargetObject = new CodeTypeReferenceExpression(PrivateNamesUsed["GeneratedClassName"].ToString());
                 cmie.Method.MethodName = PublicNamesUsed["ConstructPathFunction"].ToString();
 
-                for (int i=0; i < arrKeys.Count; i++)
+                for (int i = 0; i < arrKeys.Count; i++)
                 {
-                    cmie.Parameters.Add(new CodeVariableReferenceExpression("key"+arrKeys[i]));
+                    cmie.Parameters.Add(new CodeVariableReferenceExpression("key" + arrKeys[i]));
                 }
 
                 coce = new CodeObjectCreateExpression();
@@ -2357,7 +2357,7 @@ namespace System.Management
 
             cmieInit.Parameters.Add(new CodeVariableReferenceExpression(PrivateNamesUsed["ScopeParam"].ToString()));
             cmie = new CodeMethodInvokeExpression();
-            cmie.Method.TargetObject =new CodeTypeReferenceExpression(PrivateNamesUsed["GeneratedClassName"].ToString());
+            cmie.Method.TargetObject = new CodeTypeReferenceExpression(PrivateNamesUsed["GeneratedClassName"].ToString());
             cmie.Method.MethodName = PublicNamesUsed["ConstructPathFunction"].ToString();
 
             coce = new CodeObjectCreateExpression();
@@ -2777,9 +2777,9 @@ namespace System.Management
         {
             string strInParams = "inParams";
             string strOutParams = "outParams";
-            string strClassObj    = "classObj";
-            bool    bStatic        = false;
-            bool    bPrivileges = false;
+            string strClassObj = "classObj";
+            bool bStatic = false;
+            bool bPrivileges = false;
             CodePropertyReferenceExpression cprePriveleges = null;
             CimType cimRetType = CimType.SInt8;                        // Initialized to remove warnings
             CodeTypeReference retRefType = null;
@@ -2789,7 +2789,7 @@ namespace System.Management
             ArrayList outParamsName = new ArrayList(5);
             ArrayList inoutParams = new ArrayList(5);
             ArrayList inoutParamsType = new ArrayList(5);
-            for (int k=0; k< PublicMethods.Count; k++)
+            for (int k = 0; k < PublicMethods.Count; k++)
             {
 
                 bStatic = false;
@@ -2920,7 +2920,7 @@ namespace System.Management
                             cpde.Direction = FieldDirection.In;
 
 
-                            if ( prop.Type == CimType.DateTime)
+                            if (prop.Type == CimType.DateTime)
                             {
                                 CodeTypeReference dateType = cpde.Type;
                                 // Check if it is Time interval and if so change the type to Time Interval
@@ -2929,7 +2929,7 @@ namespace System.Management
                             }
 
                             //Find out whether it is a in/out Parameter
-                            for (int i=0; i < outParamsName.Count; i++)
+                            for (int i = 0; i < outParamsName.Count; i++)
                             {
                                 if (string.Equals(prop.Name, outParamsName[i].ToString(), StringComparison.OrdinalIgnoreCase))
                                 {
@@ -3017,7 +3017,7 @@ namespace System.Management
                             }
 
                             bInOut = false;
-                            for (int i=0; i < inoutParams.Count; i++)
+                            for (int i = 0; i < inoutParams.Count; i++)
                             {
                                 if (string.Equals(prop.Name, inoutParams[i].ToString(), StringComparison.OrdinalIgnoreCase))
                                 {
@@ -3033,7 +3033,7 @@ namespace System.Management
                                 bRetVal = true;
                                 cimRetType = prop.Type;
 
-                                if ( prop.Type == CimType.DateTime)
+                                if (prop.Type == CimType.DateTime)
                                 {
                                     CodeTypeReference dateType = cmm.ReturnType;
                                     // Check if it is Time interval and if so change the type to Time Interval
@@ -3051,7 +3051,7 @@ namespace System.Management
                                 cpde.Direction = FieldDirection.Out;
                                 cmm.Parameters.Add(cpde);
 
-                                if ( prop.Type == CimType.DateTime)
+                                if (prop.Type == CimType.DateTime)
                                 {
                                     CodeTypeReference dateType = cpde.Type;
                                     // Check if it is Time interval and if so change the type to Time Interval
@@ -3167,7 +3167,7 @@ namespace System.Management
 
                 //Now for each in/out params generate the statement
                 //    <inoutParam> = outParams.Properties["<inoutParam>"];
-                for (int i=0; i < inoutParams.Count; i++)
+                for (int i = 0; i < inoutParams.Count; i++)
                 {
                     cpre = new CodePropertyReferenceExpression(new CodeVariableReferenceExpression(strOutParams), "Properties");
                     cie = new CodeIndexerExpression(cpre, new CodePrimitiveExpression(inoutParams[i].ToString()));
@@ -3250,7 +3250,7 @@ namespace System.Management
 
                         cis.FalseStatements.Add(new CodeMethodReturnStatement(cmie));
                     }
-                        // if the return type is array, then just do type casting before returning
+                    // if the return type is array, then just do type casting before returning
                     else
                     {
                         cis.TrueStatements.Add(new CodeMethodReturnStatement(
@@ -3723,19 +3723,19 @@ namespace System.Management
             string contextObject = "context";
             string TypeDstObject = "destinationType";
             string ValueVar = "value";
-            string CultureInfoClass    = "System.Globalization.CultureInfo";
+            string CultureInfoClass = "System.Globalization.CultureInfo";
             string CultureInfoVar = "culture";
-            string IDictionary    = "System.Collections.IDictionary";
-            string DictVar        = "dictionary";
-            string propColl        = "PropertyDescriptorCollection";
-            string AttributeVar    = "attributeVar";
+            string IDictionary = "System.Collections.IDictionary";
+            string DictVar = "dictionary";
+            string propColl = "PropertyDescriptorCollection";
+            string AttributeVar = "attributeVar";
 
 
             string baseTypeParam = "inBaseType";
             string baseTypeMemberVariable = "baseConverter";
             string typeMemberVariable = "baseType";
             string TypeDescriptorClass = "TypeDescriptor";
-            string srcType    = "srcType";
+            string srcType = "srcType";
 
 
             /*
@@ -3796,7 +3796,7 @@ namespace System.Management
             */
 
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.Name = "CanConvertFrom";
             cmm.ReturnType = new CodeTypeReference("System.Boolean");
 
@@ -3820,7 +3820,7 @@ namespace System.Management
             */
 
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.Name = "CanConvertTo";
             cmm.ReturnType = new CodeTypeReference("System.Boolean");
 
@@ -3844,7 +3844,7 @@ namespace System.Management
             */
 
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.Name = "ConvertFrom";
             cmm.ReturnType = new CodeTypeReference("System.Object");
 
@@ -3870,7 +3870,7 @@ namespace System.Management
                 */
 
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.ReturnType = new CodeTypeReference("System.Object");
 
             cmm.Name = "CreateInstance";
@@ -3893,7 +3893,7 @@ namespace System.Management
                 */
 
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.Name = "GetCreateInstanceSupported";
             cmm.ReturnType = new CodeTypeReference("System.Boolean");
 
@@ -3913,7 +3913,7 @@ namespace System.Management
                 */
 
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.Name = "GetProperties";
             cmm.Parameters.Add(new CodeParameterDeclarationExpression(TypeDescriptorContextClass, contextObject));
             cmm.Parameters.Add(new CodeParameterDeclarationExpression(new CodeTypeReference("System.Object"), ValueVar));
@@ -3938,7 +3938,7 @@ namespace System.Management
                 */
 
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.Name = "GetPropertiesSupported";
             cmm.Parameters.Add(new CodeParameterDeclarationExpression(TypeDescriptorContextClass, contextObject));
             cmm.ReturnType = new CodeTypeReference("System.Boolean");
@@ -3957,7 +3957,7 @@ namespace System.Management
                 */
 
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.Name = "GetStandardValues";
             cmm.Parameters.Add(new CodeParameterDeclarationExpression(TypeDescriptorContextClass, contextObject));
             cmm.ReturnType = new CodeTypeReference("System.ComponentModel.TypeConverter.StandardValuesCollection");
@@ -3976,7 +3976,7 @@ namespace System.Management
                 */
 
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.Name = "GetStandardValuesExclusive";
             cmm.Parameters.Add(new CodeParameterDeclarationExpression(TypeDescriptorContextClass, contextObject));
             cmm.ReturnType = new CodeTypeReference("System.Boolean");
@@ -3995,7 +3995,7 @@ namespace System.Management
                 */
 
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.Name = "GetStandardValuesSupported";
             cmm.Parameters.Add(new CodeParameterDeclarationExpression(TypeDescriptorContextClass, contextObject));
             cmm.ReturnType = new CodeTypeReference("System.Boolean");
@@ -4043,7 +4043,7 @@ namespace System.Management
 
             // make the member method
             cmm = new CodeMemberMethod();
-            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override  | MemberAttributes.Overloaded;
+            cmm.Attributes = MemberAttributes.Public | MemberAttributes.Override | MemberAttributes.Overloaded;
             cmm.Name = "ConvertTo";
             // add the 3 parameters
             cmm.Parameters.Add(new CodeParameterDeclarationExpression(TypeDescriptorContextClass, contextObject));
@@ -4088,7 +4088,7 @@ namespace System.Management
             */
 
             CodeBinaryOperatorExpression cboe2 = new CodeBinaryOperatorExpression();
-            cboe2.Left =  new CodeMethodInvokeExpression(
+            cboe2.Left = new CodeMethodInvokeExpression(
                 new CodeVariableReferenceExpression("value"), "GetType");
             cboe2.Right = new CodeVariableReferenceExpression("destinationType");
             cboe2.Operator = CodeBinaryOperatorType.IdentityEquality;
@@ -4131,8 +4131,8 @@ namespace System.Management
             //   if ( (baseType == typeof(System.Boolean)) && (baseType.BaseType == typeof(System.ValueType)) )
             cis = new CodeConditionStatement();
             cboe1 = new CodeBinaryOperatorExpression();
-            cboe1.Left = new  CodeVariableReferenceExpression(typeMemberVariable);
-            cboe1.Right = new CodeTypeOfExpression (PublicNamesUsed["Boolean"].ToString());
+            cboe1.Left = new CodeVariableReferenceExpression(typeMemberVariable);
+            cboe1.Right = new CodeTypeOfExpression(PublicNamesUsed["Boolean"].ToString());
             cboe1.Operator = CodeBinaryOperatorType.IdentityEquality;
 
             cboe2 = new CodeBinaryOperatorExpression();
@@ -4140,7 +4140,7 @@ namespace System.Management
                 new CodeVariableReferenceExpression(typeMemberVariable),
                 "BaseType");
 
-            cboe2.Right = new CodeTypeOfExpression (PublicNamesUsed["ValueType"].ToString());
+            cboe2.Right = new CodeTypeOfExpression(PublicNamesUsed["ValueType"].ToString());
             cboe2.Operator = CodeBinaryOperatorType.IdentityEquality;
 
             cboe3 = new CodeBinaryOperatorExpression();
@@ -4247,7 +4247,7 @@ namespace System.Management
 
             ccc.BaseTypes.Add("System.Object");
             ccc.BaseTypes.Add("ICollection");
-            ccc.TypeAttributes =TypeAttributes.NestedPublic;
+            ccc.TypeAttributes = TypeAttributes.NestedPublic;
 
             cf = new CodeMemberField();
             cf.Name = strObjectCollection;
@@ -4423,7 +4423,7 @@ namespace System.Management
 
             //public class ServiceEnumerator : IEnumerator
             ecc = new CodeTypeDeclaration(PrivateNamesUsed["EnumeratorClass"].ToString());
-            ecc.TypeAttributes =TypeAttributes.NestedPublic;
+            ecc.TypeAttributes = TypeAttributes.NestedPublic;
 
             ecc.BaseTypes.Add("System.Object");
             ecc.BaseTypes.Add("System.Collections.IEnumerator");
@@ -4432,7 +4432,7 @@ namespace System.Management
             cf = new CodeMemberField();
             cf.Name = strObjectEnumerator;
             cf.Attributes = MemberAttributes.Private | MemberAttributes.Final;
-            cf.Type = new CodeTypeReference(strManagementObjectCollectionType+"."+
+            cf.Type = new CodeTypeReference(strManagementObjectCollectionType + "." +
                 strManagementObjectEnumeratorType);
             ecc.Members.Add(cf);
 
@@ -4504,7 +4504,7 @@ namespace System.Management
                 new CodeVariableReferenceExpression(strObjectEnumerator),
                 "Reset"
                 );
-            cmm.Statements.Add(new CodeExpressionStatement (cmie));
+            cmm.Statements.Add(new CodeExpressionStatement(cmie));
             ecc.Members.Add(cmm);
 
             ccc.Members.Add(ecc);
@@ -4517,7 +4517,7 @@ namespace System.Management
         private int IsContainedIn(string strToFind, ref SortedList sortedList)
         {
             int nIndex = -1;
-            for (int i=0; i < sortedList.Count; i++)
+            for (int i = 0; i < sortedList.Count; i++)
             {
                 if (string.Equals(sortedList.GetByIndex(i).ToString(), strToFind, StringComparison.OrdinalIgnoreCase))
                 {
@@ -4544,108 +4544,108 @@ namespace System.Management
             switch (cType)
             {
                 case CimType.SInt8:
-                {
-                    strType = "System.SByte";
-                    break;
-                }
+                    {
+                        strType = "System.SByte";
+                        break;
+                    }
                 case CimType.UInt8:
-                {
-                    strType = "System.Byte";
-                    break;
-                }
+                    {
+                        strType = "System.Byte";
+                        break;
+                    }
                 case CimType.SInt16:
-                {
-                    strType = "System.Int16";
-                    break;
-                }
-                case CimType.UInt16:
-                {
-                    if (bUnsignedSupported == false)
                     {
                         strType = "System.Int16";
+                        break;
                     }
-                    else
+                case CimType.UInt16:
                     {
-                        strType = "System.UInt16";
+                        if (bUnsignedSupported == false)
+                        {
+                            strType = "System.Int16";
+                        }
+                        else
+                        {
+                            strType = "System.UInt16";
+                        }
+                        break;
                     }
-                    break;
-                }
                 case CimType.SInt32:
-                {
-                    strType = "System.Int32";
-                    break;
-                }
-                case CimType.UInt32:
-                {
-                    if (bUnsignedSupported == false)
                     {
                         strType = "System.Int32";
+                        break;
                     }
-                    else
+                case CimType.UInt32:
                     {
-                        strType = "System.UInt32";
+                        if (bUnsignedSupported == false)
+                        {
+                            strType = "System.Int32";
+                        }
+                        else
+                        {
+                            strType = "System.UInt32";
+                        }
+                        break;
                     }
-                    break;
-                }
                 case CimType.SInt64:
-                {
-                    strType = "System.Int64";
-                    break;
-                }
-                case CimType.UInt64:
-                {
-                    if (bUnsignedSupported == false)
                     {
                         strType = "System.Int64";
+                        break;
                     }
-                    else
+                case CimType.UInt64:
                     {
-                        strType = "System.UInt64";
+                        if (bUnsignedSupported == false)
+                        {
+                            strType = "System.Int64";
+                        }
+                        else
+                        {
+                            strType = "System.UInt64";
+                        }
+                        break;
                     }
-                    break;
-                }
                 case CimType.Real32:
-                {
-                    strType = "System.Single";
-                    break;
-                }
+                    {
+                        strType = "System.Single";
+                        break;
+                    }
                 case CimType.Real64:
-                {
-                    strType = "System.Double";
-                    break;
-                }
+                    {
+                        strType = "System.Double";
+                        break;
+                    }
                 case CimType.Boolean:
-                {
-                    strType = "System.Boolean";
-                    break;
-                }
+                    {
+                        strType = "System.Boolean";
+                        break;
+                    }
                 case CimType.String:
-                {
-                    strType = "System.String";
-                    break;
-                }
+                    {
+                        strType = "System.String";
+                        break;
+                    }
                 case CimType.DateTime:
-                {
-                    strType = "System.DateTime";
-                    break;
-                }
+                    {
+                        strType = "System.DateTime";
+                        break;
+                    }
                 case CimType.Reference:
-                {
-                    strType = PublicNamesUsed["PathClass"].ToString();
-                    break;
-                }
+                    {
+                        strType = PublicNamesUsed["PathClass"].ToString();
+                        break;
+                    }
                 case CimType.Char16:
-                {
-                    strType = "System.Char";
-                    break;
-                }
+                    {
+                        strType = "System.Char";
+                        break;
+                    }
                 case CimType.Object:
                 default:
                     strType = PublicNamesUsed["BaseObjClass"].ToString();
                     break;
             }
 
-            if (isArray )
+            if (isArray)
             {
                 return new CodeTypeReference(strType, 1);
             }
@@ -4670,10 +4670,10 @@ namespace System.Management
                 case CimType.SInt8:
                 case CimType.SInt16:
                 case CimType.SInt32:
-                {
-                    retVal = true;
-                    break;
-                }
+                    {
+                        retVal = true;
+                        break;
+                    }
                 case CimType.SInt64:
                 case CimType.UInt64:
                 case CimType.Real32:
@@ -4724,7 +4724,7 @@ namespace System.Management
             string strRet = string.Empty;
             string strToReplace = "_";
             string strToAdd = string.Empty;
-            bool  bAdd = true;
+            bool bAdd = true;
             if (str.Length == 0)
             {
                 return string.Copy("");
@@ -4738,7 +4738,7 @@ namespace System.Management
                 strToAdd = "l";
             }
 
-            for (int i=0; i < str.Length; i++)
+            for (int i = 0; i < str.Length; i++)
             {
                 bAdd = true;
                 if (char.IsLetterOrDigit(arrString[i]) == false)
@@ -4774,11 +4774,11 @@ namespace System.Management
         private void ResolveEnumNameValues(ArrayList arrIn, ref ArrayList arrayOut)
         {
             arrayOut.Clear();
-            int        nCurIndex = 0;
+            int nCurIndex = 0;
             string strToAdd = string.Empty;
             IFormatProvider formatProv = (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int));
 
-            for ( int i = 0; i < arrIn.Count; i++)
+            for (int i = 0; i < arrIn.Count; i++)
             {
                 strToAdd = arrIn[i].ToString();
                 strToAdd = ResolveCollision(strToAdd, true);
@@ -4804,7 +4804,7 @@ namespace System.Management
         /// </summary>
         private static bool IsContainedInArray(string strToFind, ArrayList arrToSearch)
         {
-            for (int i=0; i < arrToSearch.Count; i++)
+            for (int i = 0; i < arrToSearch.Count; i++)
             {
                 if (string.Equals(arrToSearch[i].ToString(), strToFind, StringComparison.OrdinalIgnoreCase))
                 {
@@ -4842,7 +4842,7 @@ namespace System.Management
 
                     case CodeLanguage.CSharp:
                         strProvider = "C#.";
-                        cp= new CSharpCodeProvider();
+                        cp = new CSharpCodeProvider();
                         break;
 
                     case CodeLanguage.VJSharp:
@@ -4860,7 +4860,7 @@ namespace System.Management
                         if (asm != null)
                         {
                             codeProvType = asm.GetType("Microsoft.VJSharp.VJSharpCodeProvider");
-                            if ( codeProvType != null)
+                            if (codeProvType != null)
                             {
                                 cp = (System.CodeDom.Compiler.CodeDomProvider)Activator.CreateInstance(codeProvType);
                                 bSucceeded = true;
@@ -4882,7 +4882,7 @@ namespace System.Management
                         if (asm != null)
                         {
                             codeProvType = asm.GetType("Microsoft.VisualC.CppCodeProvider");
-                            if ( codeProvType != null)
+                            if (codeProvType != null)
                             {
                                 cp = (System.CodeDom.Compiler.CodeDomProvider)Activator.CreateInstance(codeProvType);
                                 bSucceeded = true;
@@ -4893,7 +4893,7 @@ namespace System.Management
             }
             catch
             {
-                throw new ArgumentOutOfRangeException(SR.Format(SR.UnableToCreateCodeGeneratorException, strProvider ));
+                throw new ArgumentOutOfRangeException(SR.Format(SR.UnableToCreateCodeGeneratorException, strProvider));
             }
 
             if (bSucceeded == true)
@@ -5064,61 +5064,61 @@ namespace System.Management
                     break;
 
                 case CimType.UInt32:
-                {
-                    if (bUnsignedSupported == false)
                     {
-                        retFunctionName = "ToInt32";
-                    }
-                    else
-                    {
-                        retFunctionName = "ToUInt32";
+                        if (bUnsignedSupported == false)
+                        {
+                            retFunctionName = "ToInt32";
+                        }
+                        else
+                        {
+                            retFunctionName = "ToUInt32";
+                        }
+                        break;
                     }
-                    break;
-                }
                 case CimType.SInt64:
-                {
-                    retFunctionName = "ToInt64";
-                    break;
-                }
-                case CimType.UInt64:
-                {
-                    if (bUnsignedSupported == false)
                     {
                         retFunctionName = "ToInt64";
+                        break;
                     }
-                    else
+                case CimType.UInt64:
                     {
-                        retFunctionName = "ToUInt64";
+                        if (bUnsignedSupported == false)
+                        {
+                            retFunctionName = "ToInt64";
+                        }
+                        else
+                        {
+                            retFunctionName = "ToUInt64";
+                        }
+                        break;
                     }
-                    break;
-                }
                 case CimType.Real32:
-                {
-                    retFunctionName = "ToSingle";
-                    break;
-                }
+                    {
+                        retFunctionName = "ToSingle";
+                        break;
+                    }
                 case CimType.Real64:
-                {
-                    retFunctionName = "ToDouble";
-                    break;
-                }
+                    {
+                        retFunctionName = "ToDouble";
+                        break;
+                    }
                 case CimType.Boolean:
-                {
-                    retFunctionName = "ToBoolean";
-                    break;
-                }
+                    {
+                        retFunctionName = "ToBoolean";
+                        break;
+                    }
 
                 case CimType.Char16:
-                {
-                    retFunctionName = "ToChar";
-                    break;
-                }
+                    {
+                        retFunctionName = "ToChar";
+                        break;
+                    }
 
                 case CimType.String:
-                {
-                    retFunctionName = "ToString";
-                    break;
-                }
+                    {
+                        retFunctionName = "ToString";
+                        break;
+                    }
 
             }
             return retFunctionName;
@@ -5159,7 +5159,7 @@ namespace System.Management
         /// Gets the dynamic qualifier on the class to find if the
         /// class is a dynamic class
         /// </summary>
-        private bool  IsDynamicClass()
+        private bool IsDynamicClass()
         {
             bool ret = false;
             try
@@ -5315,7 +5315,7 @@ namespace System.Management
         private void GenerateClassNameProperty()
         {
             string strRetVar = "strRet";
-            cmp = new CodeMemberProperty ();
+            cmp = new CodeMemberProperty();
             cmp.Name = PublicNamesUsed["ClassNameProperty"].ToString();
             cmp.Attributes = MemberAttributes.Public | MemberAttributes.Final;
             cmp.Type = new CodeTypeReference("System.String");
@@ -5335,7 +5335,7 @@ namespace System.Management
             cad.Arguments.Add(caa);
             cmp.CustomAttributes.Add(cad);
 
-            cmp.GetStatements.Add (new CodeVariableDeclarationStatement("System.String", strRetVar,
+            cmp.GetStatements.Add(new CodeVariableDeclarationStatement("System.String", strRetVar,
                 new CodeVariableReferenceExpression(PrivateNamesUsed["CreationClassName"].ToString())));
 
 
@@ -5388,8 +5388,8 @@ namespace System.Management
 
             cmp.GetStatements.Add(cis);
 
-            cmp.GetStatements.Add (new CodeMethodReturnStatement (new CodeVariableReferenceExpression(strRetVar)));
-            cc.Members.Add (cmp);
+            cmp.GetStatements.Add(new CodeMethodReturnStatement(new CodeVariableReferenceExpression(strRetVar)));
+            cc.Members.Add(cmp);
         }
 
         /// <summary>
@@ -5401,7 +5401,7 @@ namespace System.Management
             string strPathParam = "path";
             string strGetOptions = "OptionsParam";
 
-            cmm = new CodeMemberMethod ();
+            cmm = new CodeMemberMethod();
             cmm.Name = PrivateNamesUsed["ClassNameCheckFunc"].ToString();
             cmm.Attributes = MemberAttributes.Private | MemberAttributes.Final;
             cmm.ReturnType = new CodeTypeReference("System.Boolean");
@@ -5469,11 +5469,11 @@ namespace System.Management
             // Call this function to generate the first overload of this function
             GenerateIfClassvalidFuncWithAllParams();
 
-            string strTempObj    = "theObj";
-            string strnCtr        = "count";
+            string strTempObj = "theObj";
+            string strnCtr = "count";
             string strDerivation = "parentClasses";
 
-            cmm = new CodeMemberMethod ();
+            cmm = new CodeMemberMethod();
             cmm.Name = PrivateNamesUsed["ClassNameCheckFunc"].ToString();
             cmm.Attributes = MemberAttributes.Private | MemberAttributes.Final;
             cmm.ReturnType = new CodeTypeReference("System.Boolean");
@@ -5612,15 +5612,15 @@ namespace System.Management
 
                     if (varToAssign == null)
                     {
-                        cis1.TrueStatements.Add (new CodeMethodReturnStatement(CreateObjectForProperty(strType, cmie)));
+                        cis1.TrueStatements.Add(new CodeMethodReturnStatement(CreateObjectForProperty(strType, cmie)));
                         statColl.Add(cis1);
-                        statColl.Add (new CodeMethodReturnStatement(new CodePrimitiveExpression(null)));
+                        statColl.Add(new CodeMethodReturnStatement(new CodePrimitiveExpression(null)));
                     }
                     else
                     {
                         // Assign null to variable
                         statColl.Add(new CodeAssignStatement(varToAssign, new CodePrimitiveExpression(null)));
-                        cis1.TrueStatements.Add (new CodeAssignStatement(varToAssign, CreateObjectForProperty(strType, cmie)));
+                        cis1.TrueStatements.Add(new CodeAssignStatement(varToAssign, CreateObjectForProperty(strType, cmie)));
                         statColl.Add(cis1);
                     }
                 }
@@ -5749,14 +5749,14 @@ namespace System.Management
                 cmie2.Method.MethodName = "ToString";
                 cmie2.Method.TargetObject = cmie1;
 
-                cfls.Statements.Add( new CodeAssignStatement(new CodeIndexerExpression(new CodeVariableReferenceExpression(strArray),
+                cfls.Statements.Add(new CodeAssignStatement(new CodeIndexerExpression(new CodeVariableReferenceExpression(strArray),
                     new CodeVariableReferenceExpression(strnCtr)), CreateObjectForProperty(strType, cmie2)));
 
                 cis1.TrueStatements.Add(cfls);
                 if (varToAssign == null)
                 {
                     cis1.TrueStatements.Add(new CodeMethodReturnStatement(new CodeVariableReferenceExpression(strArray)));
-                    statColl.Add (cis1);
+                    statColl.Add(cis1);
                     statColl.Add(new CodeMethodReturnStatement(new CodePrimitiveExpression(null)));
                 }
                 else
@@ -5764,7 +5764,7 @@ namespace System.Management
                     // Assign null to variable
                     statColl.Add(new CodeAssignStatement(varToAssign, new CodePrimitiveExpression(null)));
                     cis1.TrueStatements.Add(new CodeAssignStatement(varToAssign, new CodeVariableReferenceExpression(strArray)));
-                    statColl.Add (cis1);
+                    statColl.Add(cis1);
                 }
 
             }
@@ -5861,14 +5861,14 @@ namespace System.Management
 
                 cmie1.Parameters.Add(new CodeVariableReferenceExpression(strnCtr));
 
-                cfls.Statements.Add( new CodeAssignStatement(new CodeIndexerExpression(new CodeVariableReferenceExpression(strArray),
+                cfls.Statements.Add(new CodeAssignStatement(new CodeIndexerExpression(new CodeVariableReferenceExpression(strArray),
                     new CodeVariableReferenceExpression(strnCtr)), ConvertPropertyToString(strType, cmie1)));
 
                 cis1.TrueStatements.Add(cfls);
 
                 cis1.TrueStatements.Add(new CodeAssignStatement(prop, new CodeVariableReferenceExpression(strArray)));
                 cis1.FalseStatements.Add(new CodeAssignStatement(prop, new CodePrimitiveExpression(null)));
-                statColl.Add (cis1);
+                statColl.Add(cis1);
             }
         }
 
@@ -5879,7 +5879,7 @@ namespace System.Management
         {
             switch (strType)
             {
-                case "System.DateTime" :
+                case "System.DateTime":
                     if (param == null)
                     {
                         return new CodeFieldReferenceExpression(new CodeTypeReferenceExpression("System.DateTime"), "MinValue");
@@ -5892,7 +5892,7 @@ namespace System.Management
                         return cmie;
                     }
 
-                case "System.TimeSpan" :
+                case "System.TimeSpan":
                     if (param == null)
                     {
                         coce = new CodeObjectCreateExpression();
@@ -5931,14 +5931,14 @@ namespace System.Management
         {
             switch (strType)
             {
-                case "System.DateTime" :
+                case "System.DateTime":
 
                     CodeMethodInvokeExpression cmie1 = new CodeMethodInvokeExpression();
                     cmie1.Parameters.Add(new CodeCastExpression(new CodeTypeReference("System.DateTime"), beginingExpression));
                     cmie1.Method.MethodName = PrivateNamesUsed["ToDMTFDateTimeMethod"].ToString();
                     return cmie1;
 
-                case "System.TimeSpan" :
+                case "System.TimeSpan":
 
                     CodeMethodInvokeExpression cmie2 = new CodeMethodInvokeExpression();
                     cmie2.Parameters.Add(new CodeCastExpression(new CodeTypeReference("System.TimeSpan"), beginingExpression));
@@ -5946,7 +5946,7 @@ namespace System.Management
                     return cmie2;
 
                 case "System.Management.ManagementPath":
-                    return  new CodePropertyReferenceExpression(new CodeCastExpression(
+                    return new CodePropertyReferenceExpression(new CodeCastExpression(
                         new CodeTypeReference(PublicNamesUsed["PathClass"].ToString()),
                         beginingExpression), PublicNamesUsed["PathProperty"].ToString());
 
@@ -6056,7 +6056,7 @@ namespace System.Management
             cmie2.Method.MethodName = arrConvFuncName;
             cfls.Statements.Add(new CodeAssignStatement(new CodeIndexerExpression(new CodeVariableReferenceExpression(ArrToRet),
                 new CodeVariableReferenceExpression(strnCtr)),
-                new CodeCastExpression(new CodeTypeReference(strEnumName), cmie2 )));
+                new CodeCastExpression(new CodeTypeReference(strEnumName), cmie2)));
 
 
             cmProp.GetStatements.Add(cfls);
@@ -6114,7 +6114,7 @@ namespace System.Management
         // is "interval" then the returned CodeTypeReference is of type System.TimeSpan
         // otherwise the returned type will be System.DateTime.
         // This functions is called only for cimtype.DateTime type properties
-        private  bool GetDateTimeType(PropertyData prop, ref CodeTypeReference codeType )
+        private bool GetDateTimeType(PropertyData prop, ref CodeTypeReference codeType)
         {
             bool isTimeInterval = false;
             codeType = null;
@@ -6124,7 +6124,7 @@ namespace System.Management
             }
             else
             {
-                codeType =  new CodeTypeReference("System.DateTime");
+                codeType = new CodeTypeReference("System.DateTime");
             }
 
             try
@@ -6138,7 +6138,7 @@ namespace System.Management
                     }
                     else
                     {
-                        codeType =  new CodeTypeReference("System.TimeSpan");
+                        codeType = new CodeTypeReference("System.TimeSpan");
                     }
                 }
 
@@ -6313,7 +6313,7 @@ namespace System.Management
         private void AddToDateTimeFunction()
         {
             string dmtfParam = "dmtfDate";
-            string year    = "year";
+            string year = "year";
             string month = "month";
             string day = "day";
             string hour = "hour";
@@ -6341,7 +6341,7 @@ namespace System.Management
             cmmdt.Statements.Add(new CodeVariableDeclarationStatement(new CodeTypeReference("System.Int32"), year, new CodePropertyReferenceExpression(cvreInitializer, "Year")));
 
             //Int32 month = initializer.Month;
-            cmmdt.Statements.Add(new CodeVariableDeclarationStatement(new CodeTypeReference("System.Int32"), month,    new CodePropertyReferenceExpression(cvreInitializer, "Month")));
+            cmmdt.Statements.Add(new CodeVariableDeclarationStatement(new CodeTypeReference("System.Int32"), month, new CodePropertyReferenceExpression(cvreInitializer, "Month")));
 
             //Int32 day = initializer.Day;
             cmmdt.Statements.Add(new CodeVariableDeclarationStatement(new CodeTypeReference("System.Int32"), day, new CodePropertyReferenceExpression(cvreInitializer, "Day")));
@@ -6435,7 +6435,7 @@ namespace System.Management
                 }
             */
 
-            CodeMethodReferenceExpression  cmre = new CodeMethodReferenceExpression(new CodeVariableReferenceExpression(dmtf), "Substring");
+            CodeMethodReferenceExpression cmre = new CodeMethodReferenceExpression(new CodeVariableReferenceExpression(dmtf), "Substring");
             CodeMethodInvokeExpression cmie = new CodeMethodInvokeExpression();
             cmie.Method = cmre;
             cmie.Parameters.Add(new CodePrimitiveExpression(15));
@@ -6450,7 +6450,7 @@ namespace System.Management
             cis = new CodeConditionStatement();
             cis.Condition = cboe;
 
-            CodeMethodReferenceExpression  cmre1 = new CodeMethodReferenceExpression(new CodeTypeReferenceExpression("System.Int64"), "Parse");
+            CodeMethodReferenceExpression cmre1 = new CodeMethodReferenceExpression(new CodeTypeReferenceExpression("System.Int64"), "Parse");
             CodeMethodInvokeExpression cmie1 = new CodeMethodInvokeExpression();
             cmie1.Method = cmre1;
             cmie1.Parameters.Add(new CodeVariableReferenceExpression(tempStr));
@@ -6604,7 +6604,7 @@ namespace System.Management
             /*
                 datetime = datetime.AddTicks(ticks);
             */
-            CodeMethodReferenceExpression  cmre2 = new CodeMethodReferenceExpression(new CodeVariableReferenceExpression(datetimeVariable), "AddTicks");
+            CodeMethodReferenceExpression cmre2 = new CodeMethodReferenceExpression(new CodeVariableReferenceExpression(datetimeVariable), "AddTicks");
             CodeMethodInvokeExpression cmie2 = new CodeMethodInvokeExpression();
             cmie2.Method = cmre2;
             cmie2.Parameters.Add(new CodeVariableReferenceExpression(ticks));
@@ -6738,7 +6738,7 @@ namespace System.Management
             int SubStringParam1,
             int SubStringParam2)
         {
-            CodeMethodReferenceExpression  cmre = new CodeMethodReferenceExpression(new CodeVariableReferenceExpression(dmtfVarName), "Substring");
+            CodeMethodReferenceExpression cmre = new CodeMethodReferenceExpression(new CodeVariableReferenceExpression(dmtfVarName), "Substring");
             CodeMethodInvokeExpression cmie = new CodeMethodInvokeExpression();
             cmie.Method = cmre;
             cmie.Parameters.Add(new CodePrimitiveExpression(SubStringParam1));
@@ -6757,7 +6757,7 @@ namespace System.Management
             cmie.Method = cmre;
             cmie.Parameters.Add(new CodeVariableReferenceExpression(tempVarName));
 
-            cis.TrueStatements.Add( new CodeAssignStatement(new CodeVariableReferenceExpression(toAssign), cmie));
+            cis.TrueStatements.Add(new CodeAssignStatement(new CodeVariableReferenceExpression(toAssign), cmie));
 
             cmmdt.Add(cis);
         }
@@ -6765,7 +6765,7 @@ namespace System.Management
         private void AddToDMTFTimeIntervalFunction()
         {
             string dmtfTimeSpan = "dmtftimespan";
-            string timespan    = "timespan";
+            string timespan = "timespan";
             string tsTemp = "tsTemp";
             string microsec = "microsec";
             string strmicrosec = "strMicroSec";
@@ -7028,7 +7028,7 @@ namespace System.Management
         private void AddToDMTFDateTimeFunction()
         {
             string strUtc = "utcString";
-            string dateParam    = "date";
+            string dateParam = "date";
 
             CodeCastExpression cast = null;
 
@@ -7352,7 +7352,7 @@ namespace System.Management
 
         private void AddToTimeSpanFunction()
         {
-            string tsParam    = "dmtfTimespan";
+            string tsParam = "dmtfTimespan";
             string days = "days";
             string hours = "hours";
             string minutes = "minutes";
@@ -7661,7 +7661,7 @@ namespace System.Management
         private static void ToTimeSpanHelper(int start, int numOfCharacters, string strVarToAssign, CodeStatementCollection statCol)
         {
             string strTemp = "tempString";
-            string tsParam    = "dmtfTimespan";
+            string tsParam = "dmtfTimespan";
 
             CodeMethodInvokeExpression cmie = new CodeMethodInvokeExpression();
             cmie.Method = new CodeMethodReferenceExpression(new CodeVariableReferenceExpression(tsParam), "Substring");
@@ -7688,7 +7688,7 @@ namespace System.Management
         private void GenerateMethodToInitializeVariables()
         {
 
-            CodeMemberMethod cmmInit = new CodeMemberMethod ();
+            CodeMemberMethod cmmInit = new CodeMemberMethod();
             cmmInit.Name = PrivateNamesUsed["initVariable"].ToString();
             cmmInit.Attributes = MemberAttributes.Private | MemberAttributes.Final;
 
@@ -7706,7 +7706,7 @@ namespace System.Management
         //
         private static CodeMethodInvokeExpression GenerateConcatStrings(CodeExpression ce1, CodeExpression ce2)
         {
-            CodeExpression []cmieParams = {ce1, ce2 };
+            CodeExpression[] cmieParams = { ce1, ce2 };
 
             CodeMethodInvokeExpression cmie = new CodeMethodInvokeExpression(new CodeTypeReferenceExpression("System.String"),
                 "Concat",
index aa90f04..962017a 100644 (file)
@@ -7,278 +7,298 @@ using System.Runtime.InteropServices;
 namespace System.Management
 {
 
-internal class WmiEventSink : IWmiEventSource
-{
-    private static int                      s_hash = 0;
-    private readonly int                             hash;
-    private readonly ManagementOperationObserver     watcher;
-    private readonly object                          context;
-    private readonly ManagementScope                 scope;
-    private object                          stub;           // The secured IWbemObjectSink
-
-    // Used for Put's only
-    internal event InternalObjectPutEventHandler  InternalObjectPut;
-    private readonly ManagementPath                  path;
-    private readonly string                          className;
-    private readonly bool                            isLocal;
-
-
-    private static ManagementOperationObserver watcherParameter;
-    private static object contextParameter;
-    private static ManagementScope scopeParameter;
-    private static string pathParameter;
-    private static string classNameParameter;
-    private static WmiEventSink wmiEventSinkNew;
-
-    internal static WmiEventSink GetWmiEventSink(
-        ManagementOperationObserver watcher,
-        object context,
-        ManagementScope scope,
-        string path,
-        string className)
-    {
-        if (MTAHelper.IsNoContextMTA())
-            return new WmiEventSink(watcher, context, scope, path, className);
-
-        watcherParameter = watcher;
-        contextParameter = context;
-        scopeParameter = scope;
-        pathParameter = path;
-        classNameParameter = className;
-
-        //
-        // Ensure we are able to trap exceptions from worker thread.
-        //
-        ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethod ( HackToCreateWmiEventSink ) );
-        disp.Start ( );
-
-        return wmiEventSinkNew;
-    }
-
-    private static void HackToCreateWmiEventSink()
+    internal class WmiEventSink : IWmiEventSource
     {
-        wmiEventSinkNew = new WmiEventSink(watcherParameter, contextParameter, scopeParameter, pathParameter, classNameParameter);
-    }
+        private static int s_hash = 0;
+        private readonly int hash;
+        private readonly ManagementOperationObserver watcher;
+        private readonly object context;
+        private readonly ManagementScope scope;
+        private object stub;           // The secured IWbemObjectSink
+
+        // Used for Put's only
+        internal event InternalObjectPutEventHandler InternalObjectPut;
+        private readonly ManagementPath path;
+        private readonly string className;
+        private readonly bool isLocal;
+
+
+        private static ManagementOperationObserver watcherParameter;
+        private static object contextParameter;
+        private static ManagementScope scopeParameter;
+        private static string pathParameter;
+        private static string classNameParameter;
+        private static WmiEventSink wmiEventSinkNew;
+
+        internal static WmiEventSink GetWmiEventSink(
+            ManagementOperationObserver watcher,
+            object context,
+            ManagementScope scope,
+            string path,
+            string className)
+        {
+            if (MTAHelper.IsNoContextMTA())
+                return new WmiEventSink(watcher, context, scope, path, className);
+
+            watcherParameter = watcher;
+            contextParameter = context;
+            scopeParameter = scope;
+            pathParameter = path;
+            classNameParameter = className;
+
+            //
+            // Ensure we are able to trap exceptions from worker thread.
+            //
+            ThreadDispatch disp = new ThreadDispatch(new ThreadDispatch.ThreadWorkerMethod(HackToCreateWmiEventSink));
+            disp.Start();
+
+            return wmiEventSinkNew;
+        }
 
-    protected WmiEventSink (ManagementOperationObserver watcher,
-                         object context,
-                         ManagementScope scope,
-                         string path,
-                         string className)
-    {
-        try {
-            this.context = context;
-            this.watcher = watcher;
-            this.className = className;
-            this.isLocal = false;
+        private static void HackToCreateWmiEventSink()
+        {
+            wmiEventSinkNew = new WmiEventSink(watcherParameter, contextParameter, scopeParameter, pathParameter, classNameParameter);
+        }
 
-            if (null != path)
+        protected WmiEventSink(ManagementOperationObserver watcher,
+                             object context,
+                             ManagementScope scope,
+                             string path,
+                             string className)
+        {
+            try
             {
-                this.path = new ManagementPath (path);
-                if ((0==string.Compare(this.path.Server, ".", StringComparison.OrdinalIgnoreCase)) ||
-                    (0==string.Compare(this.path.Server, System.Environment.MachineName, StringComparison.OrdinalIgnoreCase)))
+                this.context = context;
+                this.watcher = watcher;
+                this.className = className;
+                this.isLocal = false;
+
+                if (null != path)
                 {
-                            this.isLocal = true;
+                    this.path = new ManagementPath(path);
+                    if ((0 == string.Compare(this.path.Server, ".", StringComparison.OrdinalIgnoreCase)) ||
+                        (0 == string.Compare(this.path.Server, System.Environment.MachineName, StringComparison.OrdinalIgnoreCase)))
+                    {
+                        this.isLocal = true;
+                    }
                 }
-            }
 
-            if (null != scope)
-            {
-                this.scope = (ManagementScope) scope.Clone ();
-                if (null == path) // use scope to see if sink is local
+                if (null != scope)
                 {
-                    if ((0==string.Compare(this.scope.Path.Server, ".", StringComparison.OrdinalIgnoreCase)) ||
-                        (0==string.Compare(this.scope.Path.Server, System.Environment.MachineName, StringComparison.OrdinalIgnoreCase)))
+                    this.scope = (ManagementScope)scope.Clone();
+                    if (null == path) // use scope to see if sink is local
                     {
-                                this.isLocal = true;
+                        if ((0 == string.Compare(this.scope.Path.Server, ".", StringComparison.OrdinalIgnoreCase)) ||
+                            (0 == string.Compare(this.scope.Path.Server, System.Environment.MachineName, StringComparison.OrdinalIgnoreCase)))
+                        {
+                            this.isLocal = true;
+                        }
                     }
                 }
-            }
 
-            WmiNetUtilsHelper.GetDemultiplexedStub_f (this, this.isLocal, out stub);
-            hash = Threading.Interlocked.Increment(ref s_hash);
-        } catch {}
-    }
+                WmiNetUtilsHelper.GetDemultiplexedStub_f(this, this.isLocal, out stub);
+                hash = Threading.Interlocked.Increment(ref s_hash);
+            }
+            catch { }
+        }
 
-    public override int GetHashCode () {
-        return hash;
-    }
+        public override int GetHashCode()
+        {
+            return hash;
+        }
 
-    public IWbemObjectSink Stub {
-        get {
-            try {
-                return (null != stub) ? (IWbemObjectSink) stub : null;
-            } catch {
-                return null;
+        public IWbemObjectSink Stub
+        {
+            get
+            {
+                try
+                {
+                    return (null != stub) ? (IWbemObjectSink)stub : null;
+                }
+                catch
+                {
+                    return null;
+                }
             }
         }
-    }
-
-    public virtual void Indicate (IntPtr pIWbemClassObject)
-    {
-        Marshal.AddRef(pIWbemClassObject);
-        IWbemClassObjectFreeThreaded obj = new IWbemClassObjectFreeThreaded(pIWbemClassObject);
-        try {
-            ObjectReadyEventArgs args = new ObjectReadyEventArgs (context,
-                                        ManagementBaseObject.GetBaseObject (obj, scope));
-            watcher.FireObjectReady (args);
-        } catch {}
-    }
 
-    public void SetStatus (
-                    int flags,
-                    int hResult,
-                    string message,
-                    IntPtr pErrorObj)
-    {
-        IWbemClassObjectFreeThreaded errObj = null;
-        if (pErrorObj != IntPtr.Zero)
+        public virtual void Indicate(IntPtr pIWbemClassObject)
         {
-            Marshal.AddRef(pErrorObj);
-            errObj = new IWbemClassObjectFreeThreaded(pErrorObj);
+            Marshal.AddRef(pIWbemClassObject);
+            IWbemClassObjectFreeThreaded obj = new IWbemClassObjectFreeThreaded(pIWbemClassObject);
+            try
+            {
+                ObjectReadyEventArgs args = new ObjectReadyEventArgs(context,
+                                            ManagementBaseObject.GetBaseObject(obj, scope));
+                watcher.FireObjectReady(args);
+            }
+            catch { }
         }
 
-        try {
-            if (flags == (int) tag_WBEM_STATUS_TYPE.WBEM_STATUS_COMPLETE)
+        public void SetStatus(
+                        int flags,
+                        int hResult,
+                        string message,
+                        IntPtr pErrorObj)
+        {
+            IWbemClassObjectFreeThreaded errObj = null;
+            if (pErrorObj != IntPtr.Zero)
             {
-                // Is this a Put? If so fire the ObjectPut event
-                if (null != path)
-                {
-                    if (null == className)
-                        path.RelativePath = message;
-                    else
-                        path.RelativePath = className;
+                Marshal.AddRef(pErrorObj);
+                errObj = new IWbemClassObjectFreeThreaded(pErrorObj);
+            }
 
-                    // Fire the internal event (if anyone is interested)
-                    if (null != InternalObjectPut)
+            try
+            {
+                if (flags == (int)tag_WBEM_STATUS_TYPE.WBEM_STATUS_COMPLETE)
+                {
+                    // Is this a Put? If so fire the ObjectPut event
+                    if (null != path)
                     {
-                        try {
-                            InternalObjectPutEventArgs iargs = new InternalObjectPutEventArgs (path);
-                            InternalObjectPut (this, iargs);
-                        } catch {}
+                        if (null == className)
+                            path.RelativePath = message;
+                        else
+                            path.RelativePath = className;
+
+                        // Fire the internal event (if anyone is interested)
+                        if (null != InternalObjectPut)
+                        {
+                            try
+                            {
+                                InternalObjectPutEventArgs iargs = new InternalObjectPutEventArgs(path);
+                                InternalObjectPut(this, iargs);
+                            }
+                            catch { }
+                        }
+
+                        ObjectPutEventArgs args = new ObjectPutEventArgs(context, path);
+                        watcher.FireObjectPut(args);
                     }
 
-                    ObjectPutEventArgs args = new ObjectPutEventArgs (context, path);
-                    watcher.FireObjectPut(args);
-                }
-
-                // Fire Completed event
-                CompletedEventArgs args2 = null;
-                if ( errObj != null )
+                    // Fire Completed event
+                    CompletedEventArgs args2 = null;
+                    if (errObj != null)
                     {
-                        args2 = new CompletedEventArgs (context, hResult,
-                                                new ManagementBaseObject (errObj)
+                        args2 = new CompletedEventArgs(context, hResult,
+                                                new ManagementBaseObject(errObj)
                                                 );
                     }
-                else
+                    else
                     {
-                        args2 = new CompletedEventArgs (context, hResult,
+                        args2 = new CompletedEventArgs(context, hResult,
                                                 null
                                                 );
                     }
-                watcher.FireCompleted (args2);
+                    watcher.FireCompleted(args2);
 
-                // Unhook and tidy up
-                watcher.RemoveSink (this);
-            }
-            else if (0 != (flags & (int) tag_WBEM_STATUS_TYPE.WBEM_STATUS_PROGRESS))
-            {
-                // Fire Progress event
-                ProgressEventArgs args = new ProgressEventArgs (context,
-                    (int) (((uint)hResult & 0xFFFF0000) >> 16), hResult & 0xFFFF, message);
+                    // Unhook and tidy up
+                    watcher.RemoveSink(this);
+                }
+                else if (0 != (flags & (int)tag_WBEM_STATUS_TYPE.WBEM_STATUS_PROGRESS))
+                {
+                    // Fire Progress event
+                    ProgressEventArgs args = new ProgressEventArgs(context,
+                        (int)(((uint)hResult & 0xFFFF0000) >> 16), hResult & 0xFFFF, message);
 
-                watcher.FireProgress (args);
+                    watcher.FireProgress(args);
+                }
             }
-        } catch {}
-    }
+            catch { }
+        }
 
-    internal void Cancel ()
-    {
-        try {
-            scope.GetIWbemServices().CancelAsyncCall_((IWbemObjectSink) stub);
-        } catch {}
-    }
+        internal void Cancel()
+        {
+            try
+            {
+                scope.GetIWbemServices().CancelAsyncCall_((IWbemObjectSink)stub);
+            }
+            catch { }
+        }
 
-    internal void ReleaseStub ()
-    {
-        try {
-            /*
-             * We force a release of the stub here so as to allow
-             * unsecapp.exe to die as soon as possible.
-             */
-            if (null != stub)
+        internal void ReleaseStub()
+        {
+            try
             {
-                System.Runtime.InteropServices.Marshal.ReleaseComObject(stub);
-                stub = null;
+                /*
+                 * We force a release of the stub here so as to allow
+                 * unsecapp.exe to die as soon as possible.
+                 */
+                if (null != stub)
+                {
+                    System.Runtime.InteropServices.Marshal.ReleaseComObject(stub);
+                    stub = null;
+                }
             }
-        } catch {}
-    }
+            catch { }
+        }
 
-}
+    }
 
-// Special sink implementation for ManagementObject.Get
-// Doesn't issue ObjectReady events
-internal class WmiGetEventSink : WmiEventSink
-{
-    private readonly ManagementObject    managementObject;
+    // Special sink implementation for ManagementObject.Get
+    // Doesn't issue ObjectReady events
+    internal class WmiGetEventSink : WmiEventSink
+    {
+        private readonly ManagementObject managementObject;
 
-    private static ManagementOperationObserver watcherParameter;
-    private static object contextParameter;
-    private static ManagementScope scopeParameter;
-    private static ManagementObject managementObjectParameter;
+        private static ManagementOperationObserver watcherParameter;
+        private static object contextParameter;
+        private static ManagementScope scopeParameter;
+        private static ManagementObject managementObjectParameter;
 
-    private static WmiGetEventSink wmiGetEventSinkNew;
+        private static WmiGetEventSink wmiGetEventSinkNew;
 
-    internal static WmiGetEventSink GetWmiGetEventSink(
-        ManagementOperationObserver watcher,
-        object context,
-        ManagementScope scope,
-        ManagementObject managementObject)
-    {
-        if (MTAHelper.IsNoContextMTA())
-            return new WmiGetEventSink(watcher, context, scope, managementObject);
+        internal static WmiGetEventSink GetWmiGetEventSink(
+            ManagementOperationObserver watcher,
+            object context,
+            ManagementScope scope,
+            ManagementObject managementObject)
+        {
+            if (MTAHelper.IsNoContextMTA())
+                return new WmiGetEventSink(watcher, context, scope, managementObject);
 
-        watcherParameter = watcher;
-        contextParameter = context;
-        scopeParameter = scope;
-        managementObjectParameter = managementObject;
+            watcherParameter = watcher;
+            contextParameter = context;
+            scopeParameter = scope;
+            managementObjectParameter = managementObject;
 
-        //
-        // Ensure we are able to trap exceptions from worker thread.
-        //
-        ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethod ( HackToCreateWmiGetEventSink ) );
-        disp.Start ( );
+            //
+            // Ensure we are able to trap exceptions from worker thread.
+            //
+            ThreadDispatch disp = new ThreadDispatch(new ThreadDispatch.ThreadWorkerMethod(HackToCreateWmiGetEventSink));
+            disp.Start();
 
-        return wmiGetEventSinkNew;
-    }
+            return wmiGetEventSinkNew;
+        }
 
-    private static void HackToCreateWmiGetEventSink()
-    {
-        wmiGetEventSinkNew = new WmiGetEventSink(watcherParameter, contextParameter, scopeParameter, managementObjectParameter);
-    }
+        private static void HackToCreateWmiGetEventSink()
+        {
+            wmiGetEventSinkNew = new WmiGetEventSink(watcherParameter, contextParameter, scopeParameter, managementObjectParameter);
+        }
 
 
-    private WmiGetEventSink (ManagementOperationObserver watcher,
-                         object context,
-                         ManagementScope scope,
-                         ManagementObject managementObject) :
-        base (watcher, context, scope, null, null)
-    {
-        this.managementObject = managementObject;
-    }
+        private WmiGetEventSink(ManagementOperationObserver watcher,
+                             object context,
+                             ManagementScope scope,
+                             ManagementObject managementObject) :
+            base(watcher, context, scope, null, null)
+        {
+            this.managementObject = managementObject;
+        }
 
-    public override void Indicate (IntPtr pIWbemClassObject)
-    {
-        Marshal.AddRef(pIWbemClassObject);
-        IWbemClassObjectFreeThreaded obj = new IWbemClassObjectFreeThreaded(pIWbemClassObject);
-        if (null != managementObject)
+        public override void Indicate(IntPtr pIWbemClassObject)
         {
-            try {
-                managementObject.wbemObject = obj;
-            } catch {}
+            Marshal.AddRef(pIWbemClassObject);
+            IWbemClassObjectFreeThreaded obj = new IWbemClassObjectFreeThreaded(pIWbemClassObject);
+            if (null != managementObject)
+            {
+                try
+                {
+                    managementObject.wbemObject = obj;
+                }
+                catch { }
+            }
         }
     }
-}
 
 
 
index 91a318a..9bd9bc1 100644 (file)
@@ -45,17 +45,17 @@ namespace System.Management
     [ComImport]
     [Guid("1CF2B120-547D-101B-8E65-08002B2BD119")]
     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
-        internal interface IErrorInfo
+    internal interface IErrorInfo
     {
         Guid GetGUID();
 
-         [return:MarshalAs(UnmanagedType.BStr)]
+        [return: MarshalAs(UnmanagedType.BStr)]
         string GetSource();
 
-        [return:MarshalAs(UnmanagedType.BStr)]
+        [return: MarshalAs(UnmanagedType.BStr)]
         string GetDescription();
 
-        [return:MarshalAs(UnmanagedType.BStr)]
+        [return: MarshalAs(UnmanagedType.BStr)]
         string GetHelpFile();
 
         uint GetHelpContext();
index cc58504..a941139 100644 (file)
@@ -131,10 +131,10 @@ namespace System.Net.Http
                     ICredentials proxyCreds = state.Proxy == null ?
                         state.DefaultProxyCredentials :
                         state.Proxy.Credentials;
-                     if (proxyCreds == null)
-                     {
-                         break;
-                     }
+                    if (proxyCreds == null)
+                    {
+                        break;
+                    }
 
                     // Determine authorization scheme to use. We ignore the firstScheme
                     // parameter which is included in the supportedSchemes flags already.
@@ -336,7 +336,7 @@ namespace System.Net.Http
                     authScheme == Interop.WinHttp.WINHTTP_AUTH_SCHEME_NTLM)
                 {
                     // Allow WinHTTP to transmit the default credentials.
-                    ChangeDefaultCredentialsPolicy(requestHandle, authTarget, allowDefaultCredentials:true);
+                    ChangeDefaultCredentialsPolicy(requestHandle, authTarget, allowDefaultCredentials: true);
                     userName = null;
                     password = null;
                 }
index 06e1d0e..cea24d3 100644 (file)
@@ -554,8 +554,8 @@ namespace System.Net.Http
             state.DefaultProxyCredentials = _defaultProxyCredentials;
             state.PreAuthenticate = _preAuthenticate;
 
-            Task.Factory.StartNew(
-                s => {
+            Task.Factory.StartNew(s =>
+                {
                     var whrs = (WinHttpRequestState)s;
                     _ = whrs.Handler.StartRequestAsync(whrs);
                 },
@@ -1223,7 +1223,7 @@ namespace System.Net.Http
             _authHelper.ChangeDefaultCredentialsPolicy(
                 state.RequestHandle,
                 Interop.WinHttp.WINHTTP_AUTH_TARGET_SERVER,
-                allowDefaultCredentials:false);
+                allowDefaultCredentials: false);
         }
 
         private void SetRequestHandleBufferingOptions(SafeWinHttpHandle requestHandle)
index 7524708..11a2c5d 100644 (file)
@@ -125,12 +125,7 @@ namespace System.Net.Http
 
         public bool CheckCertificateRevocationList { get; set; }
 
-        public Func<
-            HttpRequestMessage,
-            X509Certificate2,
-            X509Chain,
-            SslPolicyErrors,
-            bool> ServerCertificateValidationCallback { get; set; }
+        public Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> ServerCertificateValidationCallback { get; set; }
 
         public WinHttpTransportContext TransportContext
         {
index a90c56f..550b111 100644 (file)
@@ -70,7 +70,7 @@ namespace System.Net.Http.Headers
                     return true;
                 }
             }
-                else if (parent.ContainsParsedValue(KnownHeaders.Connection.Descriptor, HeaderUtilities.ConnectionClose))
+            else if (parent.ContainsParsedValue(KnownHeaders.Connection.Descriptor, HeaderUtilities.ConnectionClose))
             {
                 return true;
             }
index 07c33a2..a6a932f 100644 (file)
@@ -113,7 +113,7 @@ namespace System.Net.Http
         {
             for (int i = 0; i < input.Length; i++)
             {
-                if (!IsTokenChar((char) input[i]))
+                if (!IsTokenChar((char)input[i]))
                 {
                     return false;
                 }
index d561f7f..c2277fc 100644 (file)
@@ -210,7 +210,7 @@ namespace System.Net.Http
         {
             try
             {
-                var streams = new Stream[2 + (_nestedContent.Count*2)];
+                var streams = new Stream[2 + (_nestedContent.Count * 2)];
                 var scratch = new StringBuilder();
                 int streamIndex = 0;
 
index acf4041..e7d52d8 100644 (file)
@@ -61,12 +61,10 @@ namespace System.Net
         [Event(HandlerMessageId, Keywords = Keywords.Debug, Level = EventLevel.Verbose)]
         public void HandlerMessage(int poolId, int workerId, int requestId, string memberName, string message) =>
             WriteEvent(HandlerMessageId, poolId, workerId, requestId, memberName, message);
-            //Console.WriteLine($"{poolId}/{workerId}/{requestId}: ({memberName}): {message}");  // uncomment for debugging only
 
         [Event(HandlerErrorId, Keywords = Keywords.Debug, Level = EventLevel.Error)]
         public void HandlerMessageError(int poolId, int workerId, int requestId, string memberName, string message) =>
             WriteEvent(HandlerErrorId, poolId, workerId, requestId, memberName, message);
-            //Console.WriteLine($"{poolId}/{workerId}/{requestId}: ({memberName}): {message}");  // uncomment for debugging only
 
         [NonEvent]
         public static void AuthenticationInfo(Uri uri, string message)
index dad19b6..f6c126a 100644 (file)
@@ -120,7 +120,7 @@ namespace System.Net.Http
                         }
 
                         ChannelBinding channelBinding = connection.TransportContext?.GetChannelBinding(ChannelBindingKind.Endpoint);
-                        NTAuthentication authContext = new NTAuthentication(isServer:false, challenge.SchemeName, challenge.Credential, spn, ContextFlagsPal.Connection, channelBinding);
+                        NTAuthentication authContext = new NTAuthentication(isServer: false, challenge.SchemeName, challenge.Credential, spn, ContextFlagsPal.Connection, channelBinding);
                         string challengeData = challenge.ChallengeData;
                         try
                         {
@@ -169,12 +169,12 @@ namespace System.Net.Http
 
         public static Task<HttpResponseMessage> SendWithNtProxyAuthAsync(HttpRequestMessage request, Uri proxyUri, ICredentials proxyCredentials, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
         {
-            return SendWithNtAuthAsync(request, proxyUri, proxyCredentials, isProxyAuth:true, connection, connectionPool, cancellationToken);
+            return SendWithNtAuthAsync(request, proxyUri, proxyCredentials, isProxyAuth: true, connection, connectionPool, cancellationToken);
         }
 
         public static Task<HttpResponseMessage> SendWithNtConnectionAuthAsync(HttpRequestMessage request, ICredentials credentials, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
         {
-            return SendWithNtAuthAsync(request, request.RequestUri, credentials, isProxyAuth:false, connection, connectionPool, cancellationToken);
+            return SendWithNtAuthAsync(request, request.RequestUri, credentials, isProxyAuth: false, connection, connectionPool, cancellationToken);
         }
     }
 }
index de989db..c310a4d 100644 (file)
@@ -327,12 +327,12 @@ namespace System.Net.Http
 
         public static Task<HttpResponseMessage> SendWithProxyAuthAsync(HttpRequestMessage request, Uri proxyUri, ICredentials proxyCredentials, bool doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
         {
-            return SendWithAuthAsync(request, proxyUri, proxyCredentials, preAuthenticate:false, isProxyAuth:true, doRequestAuth, pool, cancellationToken);
+            return SendWithAuthAsync(request, proxyUri, proxyCredentials, preAuthenticate: false, isProxyAuth: true, doRequestAuth, pool, cancellationToken);
         }
 
         public static Task<HttpResponseMessage> SendWithRequestAuthAsync(HttpRequestMessage request, ICredentials credentials, bool preAuthenticate, HttpConnectionPool pool, CancellationToken cancellationToken)
         {
-            return SendWithAuthAsync(request, request.RequestUri, credentials, preAuthenticate, isProxyAuth:false, doRequestAuth:true, pool, cancellationToken);
+            return SendWithAuthAsync(request, request.RequestUri, credentials, preAuthenticate, isProxyAuth: false, doRequestAuth: true, pool, cancellationToken);
         }
     }
 }
index e13dc68..ad5a79a 100644 (file)
@@ -39,7 +39,7 @@ namespace System.Net.Http
         {
             if (cancellationToken.IsCancellationRequested)
             {
-                ThrowOperationCanceledException(innerException:null, cancellationToken);
+                ThrowOperationCanceledException(innerException: null, cancellationToken);
             }
         }
     }
index ff53f10..c526c2f 100644 (file)
@@ -21,9 +21,9 @@ namespace System.Net.Http
             /// "chunk extensions" are allowed. We place a limit on how long a line can be to avoid OOM issues if an
             /// infinite chunk length is sent.  This value is arbitrary and can be changed as needed.
             /// </remarks>
-            private const int MaxChunkBytesAllowed = 16*1024;
+            private const int MaxChunkBytesAllowed = 16 * 1024;
             /// <summary>How long a trailing header can be.  This value is arbitrary and can be changed as needed.</summary>
-            private const int MaxTrailingHeaderLength = 16*1024;
+            private const int MaxTrailingHeaderLength = 16 * 1024;
             /// <summary>The number of bytes remaining in the chunk.</summary>
             private ulong _chunkBytesRemaining;
             /// <summary>The current state of the parsing state machine for the chunked response.</summary>
@@ -374,7 +374,7 @@ namespace System.Net.Http
                                 {
                                     // Make sure that we don't inadvertently consume trailing headers
                                     // while draining a connection that's being returned back to the pool.
-                                    HttpConnection.ParseHeaderNameValue(_connection, currentLine, _response, isFromTrailer : true);
+                                    HttpConnection.ParseHeaderNameValue(_connection, currentLine, _response, isFromTrailer: true);
                                 }
                             }
 
index bd3e83d..bfd003d 100644 (file)
@@ -1353,8 +1353,8 @@ namespace System.Net.Http
             _outgoingBuffer.Commit(FrameHeader.Size);
         }
 
-         /// <summary>Abort all streams and cause further processing to fail.</summary>
-         /// <param name="abortException">Exception causing Abort to be called.</param>
+        /// <summary>Abort all streams and cause further processing to fail.</summary>
+        /// <param name="abortException">Exception causing Abort to be called.</param>
         private void Abort(Exception abortException)
         {
             // The connection has failed, e.g. failed IO or a connection-level frame error.
index cc80779..07b0638 100644 (file)
@@ -683,7 +683,7 @@ namespace System.Net.Http
             // (4) Receiving EOF from the server. If so, resetException will contain an exception like "expected 9 bytes of data", and canRetry will be false.
             public void OnReset(Exception resetException, Http2ProtocolErrorCode? resetStreamErrorCode = null, bool canRetry = false)
             {
-                if (NetEventSource.IsEnabled) Trace($"{nameof(resetException)}={resetException}, {nameof(resetStreamErrorCode )}={resetStreamErrorCode}");
+                if (NetEventSource.IsEnabled) Trace($"{nameof(resetException)}={resetException}, {nameof(resetStreamErrorCode)}={resetStreamErrorCode}");
 
                 bool cancel = false;
                 CancellationTokenSource requestBodyCancellationSource = null;
index eb0eb3d..7ad432f 100644 (file)
@@ -18,7 +18,7 @@ namespace System.Net.Http
 
         protected internal override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         {
-            return _poolManager.SendAsync(request, doRequestAuth:true, cancellationToken);
+            return _poolManager.SendAsync(request, doRequestAuth: true, cancellationToken);
         }
 
         protected override void Dispose(bool disposing)
index 6e4e0ac..19bba82 100644 (file)
@@ -888,7 +888,7 @@ namespace System.Net.Http
         // TODO: Remove this overload once https://github.com/dotnet/csharplang/issues/1331 is addressed
         // and the compiler doesn't prevent using spans in async methods.
         private static void ParseHeaderNameValue(HttpConnection connection, ArraySegment<byte> line, HttpResponseMessage response) =>
-            ParseHeaderNameValue(connection, (Span<byte>)line, response, isFromTrailer:false);
+            ParseHeaderNameValue(connection, (Span<byte>)line, response, isFromTrailer: false);
 
         private static void ParseHeaderNameValue(HttpConnection connection, ReadOnlySpan<byte> line, HttpResponseMessage response, bool isFromTrailer)
         {
index 59d440f..e0aac9f 100644 (file)
@@ -18,7 +18,7 @@ namespace System.Net.Http
 
         protected internal override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         {
-            return _poolManager.SendAsync(request, doRequestAuth:false, cancellationToken);
+            return _poolManager.SendAsync(request, doRequestAuth: false, cancellationToken);
         }
 
         protected override void Dispose(bool disposing)
index f2b27f0..5a7a96b 100644 (file)
@@ -265,14 +265,14 @@ namespace System.Net.Http
 
         public Task<HttpResponseMessage> SendProxyConnectAsync(HttpRequestMessage request, Uri proxyUri, CancellationToken cancellationToken)
         {
-            return SendAsyncCore(request, proxyUri, doRequestAuth:false, isProxyConnect:true, cancellationToken);
+            return SendAsyncCore(request, proxyUri, doRequestAuth: false, isProxyConnect: true, cancellationToken);
         }
 
         public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, bool doRequestAuth, CancellationToken cancellationToken)
         {
             if (_proxy == null)
             {
-                return SendAsyncCore(request, null, doRequestAuth, isProxyConnect:false, cancellationToken);
+                return SendAsyncCore(request, null, doRequestAuth, isProxyConnect: false, cancellationToken);
             }
 
             // Do proxy lookup.
@@ -296,7 +296,7 @@ namespace System.Net.Http
                 throw new NotSupportedException(SR.net_http_invalid_proxy_scheme);
             }
 
-            return SendAsyncCore(request, proxyUri, doRequestAuth, isProxyConnect:false, cancellationToken);
+            return SendAsyncCore(request, proxyUri, doRequestAuth, isProxyConnect: false, cancellationToken);
         }
 
         /// <summary>Disposes of the pools, disposing of each individual pool.</summary>
index 88bd901..83408c7 100644 (file)
@@ -22,7 +22,7 @@ namespace System.Net.Http
         private readonly WinInetProxyHelper _proxyHelper;
         private SafeWinHttpHandle _sessionHandle;
         private bool _disposed;
-        private static readonly char[] s_proxyDelimiters = {';', ' ', '\n', '\r', '\t'};
+        private static readonly char[] s_proxyDelimiters = { ';', ' ', '\n', '\r', '\t' };
 
         public static bool TryCreate(out IWebProxy proxy)
         {
@@ -55,7 +55,7 @@ namespace System.Net.Http
                 }
             }
 
-            proxy  = new HttpWindowsProxy(proxyHelper, sessionHandle);
+            proxy = new HttpWindowsProxy(proxyHelper, sessionHandle);
             return true;
         }
 
@@ -95,11 +95,11 @@ namespace System.Net.Http
                         if (idx < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[idx] == '[')
                         {
                             // Strip [] from IPv6 so we can use IdnHost laster for matching.
-                            idx +=1;
+                            idx += 1;
                         }
 
                         start = idx;
-                        while (idx < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[idx] != ' ' && proxyHelper.ProxyBypass[idx] != ';' && proxyHelper.ProxyBypass[idx] != ']') {idx += 1; };
+                        while (idx < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[idx] != ' ' && proxyHelper.ProxyBypass[idx] != ';' && proxyHelper.ProxyBypass[idx] != ']') { idx += 1; };
 
                         if (idx == start)
                         {
@@ -113,16 +113,16 @@ namespace System.Net.Http
                         }
                         else
                         {
-                            tmp = proxyHelper.ProxyBypass.Substring(start, idx-start);
+                            tmp = proxyHelper.ProxyBypass.Substring(start, idx - start);
                         }
 
                         // Skip trailing characters if any.
                         if (idx < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[idx] != ';')
                         {
                             // Got stopped at space or ']'. Strip until next ';' or end.
-                            while (idx < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[idx] != ';' ) {idx += 1; };
+                            while (idx < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[idx] != ';') { idx += 1; };
                         }
-                        if  (idx < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[idx] == ';')
+                        if (idx < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[idx] == ';')
                         {
                             idx++;
                         }
@@ -155,7 +155,7 @@ namespace System.Net.Http
 
                 if (_bypassLocal)
                 {
-                    _localIp =  new List<IPAddress>();
+                    _localIp = new List<IPAddress>();
                     foreach (NetworkInterface netInterface in NetworkInterface.GetAllNetworkInterfaces())
                     {
                         IPInterfaceProperties ipProps = netInterface.GetIPProperties();
index 04a51e3..7652ab7 100644 (file)
@@ -67,13 +67,13 @@ namespace System.Net
 
         private string m_domainKey = string.Empty; // Do not rename (binary serialization)
 
-/*
-    TODO: #13607
-    VSO 449560
-    Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
-    block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
-    public, this is a temporary workaround till that happens.
-*/
+        /*
+            TODO: #13607
+            VSO 449560
+            Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
+            block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
+            public, this is a temporary workaround till that happens.
+        */
 #if uap
         public
 #else
@@ -81,13 +81,13 @@ namespace System.Net
 #endif
         bool IsQuotedVersion = false;
 
-/*
-    TODO: #13607
-    VSO 449560
-    Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
-    block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
-    public, this is a temporary workaround till that happens.
-*/
+        /*
+            TODO: #13607
+            VSO 449560
+            Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
+            block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
+            public, this is a temporary workaround till that happens.
+        */
 #if uap
         public
 #else
@@ -242,13 +242,13 @@ namespace System.Net
             }
         }
 
-/*
-    TODO: #13607
-    VSO 449560
-    Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
-    block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
-    public, this is a temporary workaround till that happens.
-*/
+        /*
+            TODO: #13607
+            VSO 449560
+            Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
+            block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
+            public, this is a temporary workaround till that happens.
+        */
 #if uap
         public
 #else
@@ -286,13 +286,13 @@ namespace System.Net
             }
         }
 
-/*
-    TODO: #13607
-    VSO 449560
-    Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
-    block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
-    public, this is a temporary workaround till that happens.
-*/
+        /*
+            TODO: #13607
+            VSO 449560
+            Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
+            block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
+            public, this is a temporary workaround till that happens.
+        */
 #if uap
         public
 #else
@@ -703,13 +703,13 @@ namespace System.Net
             }
         }
 
-/*
-    TODO: #13607
-    VSO 449560
-    Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
-    block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
-    public, this is a temporary workaround till that happens.
-*/
+        /*
+            TODO: #13607
+            VSO 449560
+            Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
+            block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
+            public, this is a temporary workaround till that happens.
+        */
 #if uap
         public
 #else
@@ -844,13 +844,13 @@ namespace System.Net
             }
         }
 
-/*
-    TODO: #13607
-    VSO 449560
-    Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
-    block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
-    public, this is a temporary workaround till that happens.
-*/
+        /*
+            TODO: #13607
+            VSO 449560
+            Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
+            block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
+            public, this is a temporary workaround till that happens.
+        */
 #if uap
         public
 #else
index 667b828..01e19e5 100644 (file)
@@ -194,13 +194,13 @@ namespace System.Net
         // If isStrict == true, replace the cookie if found same with newest Variant.
         // Returns 1 if added, 0 if replaced or rejected.
 
-/*
-    TODO: #13607
-    VSO 449560
-    Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
-    block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
-    public, this is a temporary workaround till that happens.
-*/
+        /*
+            TODO: #13607
+            VSO 449560
+            Reflecting on internal method won't work on AOT without rd.xml and DisableReflection
+            block in toolchain.Networking team will be working on exposing methods from S.Net.Primitive
+            public, this is a temporary workaround till that happens.
+        */
 #if uap
         public
 #else
index 198670f..a320990 100644 (file)
@@ -13,7 +13,7 @@ using System.Threading;
 using System.Threading.Tasks;
 namespace System.Net
 {
-    public abstract class WebRequest :  MarshalByRefObject, ISerializable
+    public abstract class WebRequest : MarshalByRefObject, ISerializable
     {
         internal class WebRequestPrefixElement
         {
index e565db9..6296ed9 100644 (file)
@@ -107,7 +107,7 @@ namespace System.Net
         /// </devdoc>
         public virtual Stream GetResponseStream()
         {
-             throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
+            throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
         }
 
         /// <devdoc>
index c686893..e29252f 100644 (file)
@@ -372,7 +372,7 @@ namespace System.Net.Security
                 SetException(e);
                 if (_exception.SourceException != e)
                 {
-                   ThrowIfExceptional();
+                    ThrowIfExceptional();
                 }
                 throw;
             }
index 306ca97..d62adc6 100644 (file)
@@ -261,7 +261,7 @@ namespace System.Net.Sockets
         }
     }
 
-    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError=true)]
+    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError = true)]
     internal unsafe delegate bool AcceptExDelegate(
                 SafeSocketHandle listenSocketHandle,
                 SafeSocketHandle acceptSocketHandle,
@@ -272,7 +272,7 @@ namespace System.Net.Sockets
                 out int bytesReceived,
                 NativeOverlapped* overlapped);
 
-    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError=true)]
+    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError = true)]
     internal delegate void GetAcceptExSockaddrsDelegate(
                 IntPtr buffer,
                 int receiveDataLength,
@@ -284,7 +284,7 @@ namespace System.Net.Sockets
                 out int remoteSocketAddressLength);
 
 
-    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError=true)]
+    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError = true)]
     internal unsafe delegate bool ConnectExDelegate(
                 SafeSocketHandle socketHandle,
                 IntPtr socketAddress,
@@ -294,21 +294,21 @@ namespace System.Net.Sockets
                 out int bytesSent,
                 NativeOverlapped* overlapped);
 
-    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError=true)]
+    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError = true)]
     internal unsafe delegate bool DisconnectExDelegate(
                 SafeSocketHandle socketHandle,
                 NativeOverlapped* overlapped,
                 int flags,
                 int reserved);
 
-    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError=true)]
+    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError = true)]
     internal delegate bool DisconnectExDelegateBlocking(
                 SafeSocketHandle socketHandle,
                 IntPtr overlapped,
                 int flags,
                 int reserved);
 
-    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError=true)]
+    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError = true)]
     internal unsafe delegate SocketError WSARecvMsgDelegate(
                 SafeSocketHandle socketHandle,
                 IntPtr msg,
@@ -316,7 +316,7 @@ namespace System.Net.Sockets
                 NativeOverlapped* overlapped,
                 IntPtr completionRoutine);
 
-    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError=true)]
+    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError = true)]
     internal delegate SocketError WSARecvMsgDelegateBlocking(
                 SafeSocketHandle socketHandle,
                 IntPtr msg,
@@ -324,7 +324,7 @@ namespace System.Net.Sockets
                 IntPtr overlapped,
                 IntPtr completionRoutine);
 
-    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError=true)]
+    [UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError = true)]
     internal unsafe delegate bool TransmitPacketsDelegate(
                 SafeSocketHandle socketHandle,
                 IntPtr packetArray,
index b321bb0..0e146df 100644 (file)
@@ -162,7 +162,7 @@ namespace System.Net.Sockets
             if (NetEventSource.IsEnabled) NetEventSource.Info(this, $"_innerSocket={_innerSocket}");
 
 #if DEBUG
-                // If this throws it could be very bad.
+            // If this throws it could be very bad.
             try
             {
 #endif
index 7d5d819..9b85ee3 100644 (file)
@@ -2132,7 +2132,7 @@ namespace System.Net.Sockets
             }
 
             ValidateForMultiConnect(isMultiEndpoint: false);
-            return UnsafeBeginConnect(remoteEP, callback, state, flowContext:true);
+            return UnsafeBeginConnect(remoteEP, callback, state, flowContext: true);
         }
 
         private bool CanUseConnectEx(EndPoint remoteEP)
index 3150fa5..31d33e7 100644 (file)
@@ -1199,7 +1199,7 @@ namespace System.Net
             // Count them first.
             for (int i = 0; i < count; i++)
             {
-                char ch = (char) bytes[offset + i];
+                char ch = (char)bytes[offset + i];
 
                 if (ch == ' ')
                 {
@@ -1221,8 +1221,8 @@ namespace System.Net
 
             for (int i = 0; i < count; i++)
             {
-                byte b = bytes[offset+i];
-                char ch = (char) b;
+                byte b = bytes[offset + i];
+                char ch = (char)b;
 
                 if (IsSafe(ch))
                 {
@@ -1230,13 +1230,13 @@ namespace System.Net
                 }
                 else if (ch == ' ')
                 {
-                    expandedBytes[pos++] = (byte) '+';
+                    expandedBytes[pos++] = (byte)'+';
                 }
                 else
                 {
-                    expandedBytes[pos++] = (byte) '%';
-                    expandedBytes[pos++] = (byte) IntToHex((b >> 4) & 0xf);
-                    expandedBytes[pos++] = (byte) IntToHex(b & 0x0f);
+                    expandedBytes[pos++] = (byte)'%';
+                    expandedBytes[pos++] = (byte)IntToHex((b >> 4) & 0xf);
+                    expandedBytes[pos++] = (byte)IntToHex(b & 0x0f);
                 }
             }
 
index 375e4f4..69f5341 100644 (file)
@@ -218,7 +218,7 @@ namespace System.Net
 
         public static bool IsRestricted(string headerName, bool response)
         {
-            headerName =  HttpValidationHelpers.CheckBadHeaderNameChars(headerName);
+            headerName = HttpValidationHelpers.CheckBadHeaderNameChars(headerName);
             return response ? HeaderInfo[headerName].IsResponseRestricted : HeaderInfo[headerName].IsRequestRestricted;
         }
 
index dac5b93..63dbd3b 100644 (file)
@@ -174,7 +174,7 @@ namespace System.Net.WebSockets
 
                 if (response.StatusCode != HttpStatusCode.SwitchingProtocols)
                 {
-                    throw new WebSocketException(WebSocketError.NotAWebSocket, SR.Format(SR.net_WebSockets_Connect101Expected, (int) response.StatusCode));
+                    throw new WebSocketException(WebSocketError.NotAWebSocket, SR.Format(SR.net_WebSockets_Connect101Expected, (int)response.StatusCode));
                 }
 
                 // The Connection, Upgrade, and SecWebSocketAccept headers are required and with specific values.
index 03a39e4..b19096d 100644 (file)
@@ -202,7 +202,7 @@ namespace System.Numerics.Tensors
             for (int i = 0; i < sourceStrides.Length; i++)
             {
                 // reverse the index for reverseStride so that we divide by largest stride first
-                var nIndex = sourceReverseStride ? sourceStrides.Length - 1 - i: i;
+                var nIndex = sourceReverseStride ? sourceStrides.Length - 1 - i : i;
 
                 var sourceStride = sourceStrides[nIndex];
                 var transformStride = transformStrides[nIndex];
index e0d9f6e..6cad09a 100644 (file)
@@ -767,7 +767,7 @@ namespace System.Runtime.Serialization
         private static Type s_typeOfDBNull;
         internal static Type TypeOfDBNull
         {
-           get
+            get
             {
                 if (s_typeOfDBNull == null)
                     s_typeOfDBNull = typeof(DBNull);
index 677e2c1..17d4ef2 100644 (file)
@@ -81,7 +81,7 @@ namespace System.Runtime.Serialization.Json
                             }
                             else
                             {
-                                tempDelegate =  new JsonFormatReaderGenerator().GenerateGetOnlyCollectionReader(TraditionalCollectionDataContract);
+                                tempDelegate = new JsonFormatReaderGenerator().GenerateGetOnlyCollectionReader(TraditionalCollectionDataContract);
                             }
 
                             Interlocked.MemoryBarrier();
index e480e47..a659fc8 100644 (file)
@@ -236,7 +236,7 @@ namespace System.Runtime.Serialization.Json
             return ParseJsonDate(ReadElementContentAsString(), _dateTimeFormat);
         }
 
-        #if USE_REFEMIT
+#if USE_REFEMIT
         public override bool TryReadDateTimeArray(XmlObjectSerializerReadContext context,
 #else
         internal override bool TryReadDateTimeArray(XmlObjectSerializerReadContext context,
index 041dff5..af38aaf 100644 (file)
@@ -23,7 +23,7 @@ namespace System.Runtime.Serialization
             obj = ResolveAdapterType(obj, classContract);
             if (classContract.IsISerializable)
             {
-                context.WriteISerializable(xmlWriter, (ISerializable) obj);
+                context.WriteISerializable(xmlWriter, (ISerializable)obj);
             }
             else
             {
index b7c4e72..f3c9f2f 100644 (file)
@@ -1065,7 +1065,7 @@ namespace System.Runtime.Serialization
             {
                 for (int i = 0; i < xmlAttributes.Count; i++)
                 {
-                    wrapperElement.Attributes.Append((XmlAttribute) xmlAttributes[i]);
+                    wrapperElement.Attributes.Append((XmlAttribute)xmlAttributes[i]);
                 }
             }
             if (xmlChildNodes != null)
index b6a6848..2848b00 100644 (file)
@@ -126,8 +126,8 @@ namespace System
             public string? String;
             public Offset Offset;
             public string? DnsSafeHost;    // stores dns safe host when idn is on and we have unicode or idn host
-            public MoreInfo? MoreInfo;       // Multi-threading: This field must be always accessed through a _local_
-                                            // stack copy of m_Info.
+            public MoreInfo? MoreInfo;     // Multi-threading: This field must be always accessed through a _local_
+                                           // stack copy of m_Info.
         };
 
         [StructLayout(LayoutKind.Sequential, Pack = 1)]
index d714f3a..9103afd 100644 (file)
@@ -2,60 +2,61 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-namespace System {
+namespace System
+{
 
-    public class HttpStyleUriParser: UriParser
+    public class HttpStyleUriParser : UriParser
     {
-        public HttpStyleUriParser():base(UriParser.HttpUri.Flags)
+        public HttpStyleUriParser() : base(UriParser.HttpUri.Flags)
         {
         }
     }
 
-    public class FtpStyleUriParser: UriParser
+    public class FtpStyleUriParser : UriParser
     {
-        public FtpStyleUriParser():base(UriParser.FtpUri.Flags)
+        public FtpStyleUriParser() : base(UriParser.FtpUri.Flags)
         {
         }
     }
 
-    public class FileStyleUriParser: UriParser
+    public class FileStyleUriParser : UriParser
     {
-        public FileStyleUriParser():base(UriParser.FileUri.Flags)
+        public FileStyleUriParser() : base(UriParser.FileUri.Flags)
         {
         }
     }
 
-    public class NewsStyleUriParser: UriParser
+    public class NewsStyleUriParser : UriParser
     {
-        public NewsStyleUriParser():base(UriParser.NewsUri.Flags)
+        public NewsStyleUriParser() : base(UriParser.NewsUri.Flags)
         {
         }
     }
 
-    public class GopherStyleUriParser: UriParser
+    public class GopherStyleUriParser : UriParser
     {
-        public GopherStyleUriParser():base(UriParser.GopherUri.Flags)
+        public GopherStyleUriParser() : base(UriParser.GopherUri.Flags)
         {
         }
     }
 
-    public class LdapStyleUriParser: UriParser
+    public class LdapStyleUriParser : UriParser
     {
-        public LdapStyleUriParser():base(UriParser.LdapUri.Flags)
+        public LdapStyleUriParser() : base(UriParser.LdapUri.Flags)
         {
         }
     }
 
-    public class NetPipeStyleUriParser: UriParser
+    public class NetPipeStyleUriParser : UriParser
     {
-        public NetPipeStyleUriParser():base(UriParser.NetPipeUri.Flags)
+        public NetPipeStyleUriParser() : base(UriParser.NetPipeUri.Flags)
         {
         }
     }
 
-    public class NetTcpStyleUriParser: UriParser
+    public class NetTcpStyleUriParser : UriParser
     {
-        public NetTcpStyleUriParser():base(UriParser.NetTcpUri.Flags)
+        public NetTcpStyleUriParser() : base(UriParser.NetTcpUri.Flags)
         {
         }
     }
index 1bea7bc..2e64f22 100644 (file)
@@ -252,17 +252,17 @@ namespace System
 
         internal void CheckSetIsSimpleFlag()
         {
-            Type type  = this.GetType();
-
-            if (    type == typeof(GenericUriParser)
-                ||  type == typeof(HttpStyleUriParser)
-                ||  type == typeof(FtpStyleUriParser)
-                ||  type == typeof(FileStyleUriParser)
-                ||  type == typeof(NewsStyleUriParser)
-                ||  type == typeof(GopherStyleUriParser)
-                ||  type == typeof(NetPipeStyleUriParser)
-                ||  type == typeof(NetTcpStyleUriParser)
-                ||  type == typeof(LdapStyleUriParser)
+            Type type = this.GetType();
+
+            if (type == typeof(GenericUriParser)
+                || type == typeof(HttpStyleUriParser)
+                || type == typeof(FtpStyleUriParser)
+                || type == typeof(FileStyleUriParser)
+                || type == typeof(NewsStyleUriParser)
+                || type == typeof(GopherStyleUriParser)
+                || type == typeof(NetPipeStyleUriParser)
+                || type == typeof(NetTcpStyleUriParser)
+                || type == typeof(LdapStyleUriParser)
                 )
             {
                 _flags |= UriSyntaxFlags.SimpleUserSyntax;
index d6ed5ad..9adafce 100644 (file)
@@ -228,7 +228,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as a <see cref="string"/>.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator string (XAttribute attribute)
+        public static explicit operator string(XAttribute attribute)
         {
             if (attribute == null) return null;
             return attribute.value;
@@ -247,7 +247,7 @@ namespace System.Xml.Linq
         /// Thrown if the specified attribute is null.
         /// </exception>
         [CLSCompliant(false)]
-        public static explicit operator bool (XAttribute attribute)
+        public static explicit operator bool(XAttribute attribute)
         {
             if (attribute == null) throw new ArgumentNullException(nameof(attribute));
             return XmlConvert.ToBoolean(attribute.value.ToLowerInvariant());
@@ -263,7 +263,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as a <see cref="bool"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator bool? (XAttribute attribute)
+        public static explicit operator bool?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToBoolean(attribute.value.ToLowerInvariant());
@@ -282,7 +282,7 @@ namespace System.Xml.Linq
         /// Thrown if the specified attribute is null.
         /// </exception>
         [CLSCompliant(false)]
-        public static explicit operator int (XAttribute attribute)
+        public static explicit operator int(XAttribute attribute)
         {
             if (attribute == null) throw new ArgumentNullException(nameof(attribute));
             return XmlConvert.ToInt32(attribute.value);
@@ -298,7 +298,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as an <see cref="int"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator int? (XAttribute attribute)
+        public static explicit operator int?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToInt32(attribute.value);
@@ -317,7 +317,7 @@ namespace System.Xml.Linq
         /// Thrown if the specified attribute is null.
         /// </exception>
         [CLSCompliant(false)]
-        public static explicit operator uint (XAttribute attribute)
+        public static explicit operator uint(XAttribute attribute)
         {
             if (attribute == null) throw new ArgumentNullException(nameof(attribute));
             return XmlConvert.ToUInt32(attribute.value);
@@ -333,7 +333,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as an <see cref="uint"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator uint? (XAttribute attribute)
+        public static explicit operator uint?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToUInt32(attribute.value);
@@ -352,7 +352,7 @@ namespace System.Xml.Linq
         /// Thrown if the specified attribute is null.
         /// </exception>
         [CLSCompliant(false)]
-        public static explicit operator long (XAttribute attribute)
+        public static explicit operator long(XAttribute attribute)
         {
             if (attribute == null) throw new ArgumentNullException(nameof(attribute));
             return XmlConvert.ToInt64(attribute.value);
@@ -368,7 +368,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as a <see cref="long"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator long? (XAttribute attribute)
+        public static explicit operator long?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToInt64(attribute.value);
@@ -387,7 +387,7 @@ namespace System.Xml.Linq
         /// Thrown if the specified attribute is null.
         /// </exception>
         [CLSCompliant(false)]
-        public static explicit operator ulong (XAttribute attribute)
+        public static explicit operator ulong(XAttribute attribute)
         {
             if (attribute == null) throw new ArgumentNullException(nameof(attribute));
             return XmlConvert.ToUInt64(attribute.value);
@@ -403,7 +403,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as an <see cref="ulong"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator ulong? (XAttribute attribute)
+        public static explicit operator ulong?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToUInt64(attribute.value);
@@ -422,7 +422,7 @@ namespace System.Xml.Linq
         /// Thrown if the specified attribute is null.
         /// </exception>
         [CLSCompliant(false)]
-        public static explicit operator float (XAttribute attribute)
+        public static explicit operator float(XAttribute attribute)
         {
             if (attribute == null) throw new ArgumentNullException(nameof(attribute));
             return XmlConvert.ToSingle(attribute.value);
@@ -438,7 +438,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as a <see cref="float"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator float? (XAttribute attribute)
+        public static explicit operator float?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToSingle(attribute.value);
@@ -457,7 +457,7 @@ namespace System.Xml.Linq
         /// Thrown if the specified attribute is null.
         /// </exception>
         [CLSCompliant(false)]
-        public static explicit operator double (XAttribute attribute)
+        public static explicit operator double(XAttribute attribute)
         {
             if (attribute == null) throw new ArgumentNullException(nameof(attribute));
             return XmlConvert.ToDouble(attribute.value);
@@ -473,7 +473,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as a <see cref="double"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator double? (XAttribute attribute)
+        public static explicit operator double?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToDouble(attribute.value);
@@ -492,7 +492,7 @@ namespace System.Xml.Linq
         /// Thrown if the specified attribute is null.
         /// </exception>
         [CLSCompliant(false)]
-        public static explicit operator decimal (XAttribute attribute)
+        public static explicit operator decimal(XAttribute attribute)
         {
             if (attribute == null) throw new ArgumentNullException(nameof(attribute));
             return XmlConvert.ToDecimal(attribute.value);
@@ -508,7 +508,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as a <see cref="decimal"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator decimal? (XAttribute attribute)
+        public static explicit operator decimal?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToDecimal(attribute.value);
@@ -543,7 +543,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as a <see cref="DateTime"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator DateTime? (XAttribute attribute)
+        public static explicit operator DateTime?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return DateTime.Parse(attribute.value, CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.RoundtripKind);
@@ -578,7 +578,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as a <see cref="DateTimeOffset"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator DateTimeOffset? (XAttribute attribute)
+        public static explicit operator DateTimeOffset?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToDateTimeOffset(attribute.value);
@@ -613,7 +613,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as a <see cref="TimeSpan"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator TimeSpan? (XAttribute attribute)
+        public static explicit operator TimeSpan?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToTimeSpan(attribute.value);
@@ -648,7 +648,7 @@ namespace System.Xml.Linq
         /// The content of this <see cref="XAttribute"/> as a <see cref="Guid"/>?.
         /// </returns>
         [CLSCompliant(false)]
-        public static explicit operator Guid? (XAttribute attribute)
+        public static explicit operator Guid?(XAttribute attribute)
         {
             if (attribute == null) return null;
             return XmlConvert.ToGuid(attribute.value);
index 160c856..8595997 100644 (file)
@@ -429,7 +429,7 @@ namespace System.Xml.Linq
             XDocument d = InitLoad(reader, options);
             d.ReadContentFrom(reader, options);
 
-            if ( !reader.EOF) throw new InvalidOperationException(SR.InvalidOperation_ExpectedEndOfFile);
+            if (!reader.EOF) throw new InvalidOperationException(SR.InvalidOperation_ExpectedEndOfFile);
             if (d.Root == null) throw new InvalidOperationException(SR.InvalidOperation_MissingRoot);
             return d;
         }
index bd05752..521fcc1 100644 (file)
@@ -1338,7 +1338,7 @@ namespace System.Xml.Linq
         /// </returns>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator string (XElement element)
+        public static explicit operator string(XElement element)
         {
             if (element == null) return null;
             return element.Value;
@@ -1361,7 +1361,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator bool (XElement element)
+        public static explicit operator bool(XElement element)
         {
             if (element == null) throw new ArgumentNullException(nameof(element));
             return XmlConvert.ToBoolean(element.Value.ToLowerInvariant());
@@ -1381,7 +1381,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator bool? (XElement element)
+        public static explicit operator bool?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToBoolean(element.Value.ToLowerInvariant());
@@ -1404,7 +1404,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator int (XElement element)
+        public static explicit operator int(XElement element)
         {
             if (element == null) throw new ArgumentNullException(nameof(element));
             return XmlConvert.ToInt32(element.Value);
@@ -1424,7 +1424,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator int? (XElement element)
+        public static explicit operator int?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToInt32(element.Value);
@@ -1447,7 +1447,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator uint (XElement element)
+        public static explicit operator uint(XElement element)
         {
             if (element == null) throw new ArgumentNullException(nameof(element));
             return XmlConvert.ToUInt32(element.Value);
@@ -1467,7 +1467,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator uint? (XElement element)
+        public static explicit operator uint?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToUInt32(element.Value);
@@ -1490,7 +1490,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator long (XElement element)
+        public static explicit operator long(XElement element)
         {
             if (element == null) throw new ArgumentNullException(nameof(element));
             return XmlConvert.ToInt64(element.Value);
@@ -1510,7 +1510,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator long? (XElement element)
+        public static explicit operator long?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToInt64(element.Value);
@@ -1533,7 +1533,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator ulong (XElement element)
+        public static explicit operator ulong(XElement element)
         {
             if (element == null) throw new ArgumentNullException(nameof(element));
             return XmlConvert.ToUInt64(element.Value);
@@ -1553,7 +1553,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator ulong? (XElement element)
+        public static explicit operator ulong?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToUInt64(element.Value);
@@ -1576,7 +1576,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator float (XElement element)
+        public static explicit operator float(XElement element)
         {
             if (element == null) throw new ArgumentNullException(nameof(element));
             return XmlConvert.ToSingle(element.Value);
@@ -1596,7 +1596,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator float? (XElement element)
+        public static explicit operator float?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToSingle(element.Value);
@@ -1619,7 +1619,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator double (XElement element)
+        public static explicit operator double(XElement element)
         {
             if (element == null) throw new ArgumentNullException(nameof(element));
             return XmlConvert.ToDouble(element.Value);
@@ -1639,7 +1639,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator double? (XElement element)
+        public static explicit operator double?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToDouble(element.Value);
@@ -1662,7 +1662,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator decimal (XElement element)
+        public static explicit operator decimal(XElement element)
         {
             if (element == null) throw new ArgumentNullException(nameof(element));
             return XmlConvert.ToDecimal(element.Value);
@@ -1682,7 +1682,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator decimal? (XElement element)
+        public static explicit operator decimal?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToDecimal(element.Value);
@@ -1725,7 +1725,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator DateTime? (XElement element)
+        public static explicit operator DateTime?(XElement element)
         {
             if (element == null) return null;
             return DateTime.Parse(element.Value, CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.RoundtripKind);
@@ -1768,7 +1768,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator DateTimeOffset? (XElement element)
+        public static explicit operator DateTimeOffset?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToDateTimeOffset(element.Value);
@@ -1811,7 +1811,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator TimeSpan? (XElement element)
+        public static explicit operator TimeSpan?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToTimeSpan(element.Value);
@@ -1854,7 +1854,7 @@ namespace System.Xml.Linq
         /// </exception>
         [CLSCompliant(false)]
         [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")]
-        public static explicit operator Guid? (XElement element)
+        public static explicit operator Guid?(XElement element)
         {
             if (element == null) return null;
             return XmlConvert.ToGuid(element.Value);
index f1d8c5d..1f6fa3b 100644 (file)
@@ -274,7 +274,7 @@ namespace System.Xml.Linq
                         }
                         else
                         {
-                            n = ((XNode) e.content).next;
+                            n = ((XNode)e.content).next;
                             continue;
                         }
                     }
index 306f945..0e8e7d3 100644 (file)
@@ -81,7 +81,7 @@ namespace System.Xml.Linq
             if (annotation == null) throw new ArgumentNullException(nameof(annotation));
             if (annotations == null)
             {
-                annotations = annotation is object[] ? new object[] { annotation } : annotation;
+                annotations = annotation is object[]? new object[] { annotation } : annotation;
             }
             else
             {
index 7ca0613..cb00e97 100644 (file)
@@ -108,7 +108,7 @@ namespace System.Xml.Linq
             if (cancellationToken.IsCancellationRequested)
                 return Task.FromCanceled(cancellationToken);
 
-            return parent is XDocument?
+            return parent is XDocument ?
                 writer.WriteWhitespaceAsync(text) :
                 writer.WriteStringAsync(text);
         }
index 94a4cf1..cf4cd69 100644 (file)
@@ -997,7 +997,7 @@ namespace System.Xml
                                 pSrc += 2;
                             }
                             /* Invalid XML character */
-                            else  if (ch <= 0x7F || ch >= 0xFFFE)
+                            else if (ch <= 0x7F || ch >= 0xFFFE)
                             {
                                 pDst = InvalidXmlChar(ch, pDst, true);
                                 pSrc++;
@@ -1117,7 +1117,7 @@ namespace System.Xml
                                 pSrc += 2;
                             }
                             /* Invalid XML character */
-                            else  if (ch <= 0x7F || ch >= 0xFFFE)
+                            else if (ch <= 0x7F || ch >= 0xFFFE)
                             {
                                 pDst = InvalidXmlChar(ch, pDst, true);
                                 pSrc++;
@@ -1195,7 +1195,7 @@ namespace System.Xml
                         pSrc += 2;
                     }
                     /* Invalid XML character */
-                    else  if (ch <= 0x7F || ch >= 0xFFFE)
+                    else if (ch <= 0x7F || ch >= 0xFFFE)
                     {
                         pDst = InvalidXmlChar(ch, pDst, false);
                         pSrc++;
@@ -1299,7 +1299,7 @@ namespace System.Xml
                                 pSrc += 2;
                             }
                             /* Invalid XML character */
-                            else  if (ch <= 0x7F || ch >= 0xFFFE)
+                            else if (ch <= 0x7F || ch >= 0xFFFE)
                             {
                                 pDst = InvalidXmlChar(ch, pDst, false);
                                 pSrc++;
@@ -1448,7 +1448,7 @@ namespace System.Xml
                                 pSrc += 2;
                             }
                             /* Invalid XML character */
-                            else  if (ch <= 0x7F || ch >= 0xFFFE)
+                            else if (ch <= 0x7F || ch >= 0xFFFE)
                             {
                                 pDst = InvalidXmlChar(ch, pDst, false);
                                 pSrc++;
@@ -1593,7 +1593,7 @@ namespace System.Xml
                                 pSrc += 2;
                             }
                             /* Invalid XML character */
-                            else  if (ch <= 0x7F || ch >= 0xFFFE)
+                            else if (ch <= 0x7F || ch >= 0xFFFE)
                             {
                                 pDst = InvalidXmlChar(ch, pDst, false);
                                 pSrc++;
@@ -1658,8 +1658,8 @@ namespace System.Xml
                 }
                 else
                 {
-                        *pDst = (char)ch;
-                        pDst++;
+                    *pDst = (char)ch;
+                    pDst++;
                     return pDst;
                 }
             }
@@ -1675,7 +1675,7 @@ namespace System.Xml
                 pSrc += 2;
             }
             /* Invalid XML character */
-            else  if (ch <= 0x7F || ch >= 0xFFFE)
+            else if (ch <= 0x7F || ch >= 0xFFFE)
             {
                 pDst = InvalidXmlChar(ch, pDst, false);
                 pSrc++;
@@ -1818,7 +1818,7 @@ namespace System.Xml
             fixed (char* pSrc = s)
             {
                 char* pS = pSrc;
-                while ((*pDst++ = (char)*pS++) != 0);
+                while ((*pDst++ = (char)*pS++) != 0) ;
             }
 
             pDst[-1] = (char)';';
index 4a8de8d..3dd9759 100644 (file)
@@ -762,7 +762,7 @@ namespace System.Xml
                                 pSrc += 2;
                             }
                             /* Invalid XML character */
-                            else  if (ch <= 0x7F || ch >= 0xFFFE)
+                            else if (ch <= 0x7F || ch >= 0xFFFE)
                             {
                                 pDst = InvalidXmlChar(ch, pDst, true);
                                 pSrc++;
@@ -966,7 +966,7 @@ namespace System.Xml
                                 pSrc += 2;
                             }
                             /* Invalid XML character */
-                            else  if (ch <= 0x7F || ch >= 0xFFFE)
+                            else if (ch <= 0x7F || ch >= 0xFFFE)
                             {
                                 pDst = InvalidXmlChar(ch, pDst, true);
                                 pSrc++;
@@ -1150,7 +1150,7 @@ namespace System.Xml
                         pSrc += 2;
                     }
                     /* Invalid XML character */
-                    else  if (ch <= 0x7F || ch >= 0xFFFE)
+                    else if (ch <= 0x7F || ch >= 0xFFFE)
                     {
                         pDst = InvalidXmlChar(ch, pDst, false);
                         pSrc++;
@@ -1369,7 +1369,7 @@ namespace System.Xml
                                 pSrc += 2;
                             }
                             /* Invalid XML character */
-                            else  if (ch <= 0x7F || ch >= 0xFFFE)
+                            else if (ch <= 0x7F || ch >= 0xFFFE)
                             {
                                 pDst = InvalidXmlChar(ch, pDst, false);
                                 pSrc++;
@@ -1600,7 +1600,7 @@ namespace System.Xml
                                     pSrc += 2;
                                 }
                                 /* Invalid XML character */
-                                else  if (ch <= 0x7F || ch >= 0xFFFE)
+                                else if (ch <= 0x7F || ch >= 0xFFFE)
                                 {
                                     pDst = InvalidXmlChar(ch, pDst, false);
                                     pSrc++;
@@ -1784,7 +1784,7 @@ namespace System.Xml
                                     pSrc += 2;
                                 }
                                 /* Invalid XML character */
-                                else  if (ch <= 0x7F || ch >= 0xFFFE)
+                                else if (ch <= 0x7F || ch >= 0xFFFE)
                                 {
                                     pDst = InvalidXmlChar(ch, pDst, false);
                                     pSrc++;
index 3655526..e02d5b9 100644 (file)
@@ -1870,7 +1870,7 @@ namespace System.Xml
             {
                 read = input.Read(bytes, byteCount, bytes.Length - byteCount);
                 byteCount += read;
-            } while (read > 0 && byteCount< 2);
+            } while (read > 0 && byteCount < 2);
 
             // create text or binary XML reader depenting on the stream first 2 bytes
             if (byteCount >= 2 && (bytes[0] == 0xdf && bytes[1] == 0xff))
index 14a5906..4d9c43e 100644 (file)
@@ -598,7 +598,7 @@ namespace System.Xml
                 }
             }
 
-            return  AddValidationAndConformanceInternal(reader, resolver, addConformanceWrapper: false);
+            return AddValidationAndConformanceInternal(reader, resolver, addConformanceWrapper: false);
         }
 
         private XmlReader AddValidationAndConformanceWrapper(XmlReader reader)
@@ -609,7 +609,7 @@ namespace System.Xml
                 resolver = GetXmlResolver_CheckConfig();
             }
 
-            return  AddValidationAndConformanceInternal(reader, resolver, addConformanceWrapper: true);
+            return AddValidationAndConformanceInternal(reader, resolver, addConformanceWrapper: true);
         }
 
         private XmlReader AddValidationAndConformanceInternal(XmlReader reader, XmlResolver resolver, bool addConformanceWrapper)
index 502b2be..19a93c0 100644 (file)
@@ -3962,7 +3962,7 @@ namespace System.Xml
             if (_dtdInfo == null ||
                  ((entity = _dtdInfo.LookupEntity(name)) == null))
             {
-               // Needed only for XmlTextReader (when used from XmlDocument)
+                // Needed only for XmlTextReader (when used from XmlDocument)
                 if (_disableUndeclaredEntityCheck)
                 {
                     SchemaEntity schemaEntity = new SchemaEntity(new XmlQualifiedName(name), false);
index 7a01835..1283ea3 100644 (file)
@@ -22,7 +22,7 @@ namespace System.Xml.Schema
 
         public virtual XmlSchemaDatatypeVariety Variety { get { return XmlSchemaDatatypeVariety.Atomic; } }
 
-        internal XmlSchemaDatatype() {}
+        internal XmlSchemaDatatype() { }
 
         public virtual object ChangeType(object value, Type targetType)
         {
index 47d5e44..9794d9f 100644 (file)
@@ -8,7 +8,7 @@ namespace System.Xml.Schema
 
     public abstract class XmlSchemaGroupBase : XmlSchemaParticle
     {
-        internal XmlSchemaGroupBase() {}
+        internal XmlSchemaGroupBase() { }
 
         [XmlIgnore]
         public abstract XmlSchemaObjectCollection Items { get; }
index 14a5d4f..761ed3f 100644 (file)
@@ -48,10 +48,10 @@ namespace System.Xml.Serialization
                 AddImport(intf, types);
 
             ConstructorInfo[] ctors = type.GetConstructors();
-            for (int i = 0; i<ctors.Length; i++)
+            for (int i = 0; i < ctors.Length; i++)
             {
                 ParameterInfo[] parms = ctors[i].GetParameters();
-                for (int j = 0; j<parms.Length; j++)
+                for (int j = 0; j < parms.Length; j++)
                 {
                     AddImport(parms[j].ParameterType, types);
                 }
@@ -60,7 +60,7 @@ namespace System.Xml.Serialization
             if (type.IsGenericType)
             {
                 Type[] arguments = type.GetGenericArguments();
-                for (int i = 0; i<arguments.Length; i++)
+                for (int i = 0; i < arguments.Length; i++)
                 {
                     AddImport(arguments[i], types);
                 }
index a8fddb5..1af5fd4 100644 (file)
@@ -881,7 +881,8 @@ namespace System.Xml.Serialization
             }
         }
 
-        private bool CanOptimizeWriteListSequence(TypeDesc listElementTypeDesc) {
+        private bool CanOptimizeWriteListSequence(TypeDesc listElementTypeDesc)
+        {
             // check to see if we can write values of the attribute sequentially
             // currently we have only one data type (XmlQualifiedName) that we can not write "inline",
             // because we need to output xmlns:qx="..." for each of the qnames
@@ -1243,7 +1244,7 @@ namespace System.Xml.Serialization
                             {
                                 if (mapping.Members[j].Name == memberNameSpecified)
                                 {
-                                    specifiedSource = (bool) p[j];
+                                    specifiedSource = (bool)p[j];
                                     break;
                                 }
                             }
index 8f2bf4e..75d2aa8 100644 (file)
@@ -227,7 +227,7 @@ namespace System.Xml.Serialization
             }
         }
 
-        public static implicit operator string (SourceInfo source)
+        public static implicit operator string(SourceInfo source)
         {
             return source.Source;
         }
index 28a45a9..0ef7265 100644 (file)
@@ -2446,8 +2446,8 @@ namespace System.Xml.Serialization
                     }
                 }
 #if DEBUG
-                    // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                    if (choiceSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.ChoiceIdentifier.MemberName + " in the members mapping."));
+                // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+                if (choiceSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.ChoiceIdentifier.MemberName + " in the members mapping."));
 #endif
 
             }
@@ -3061,8 +3061,8 @@ namespace System.Xml.Serialization
 
                 string methodName = ReferenceMapping(derived);
 #if DEBUG
-                    // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                    if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, derived.TypeDesc.Name));
+                // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+                if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, derived.TypeDesc.Name));
 #endif
 
                 Writer.Write("return ");
@@ -3098,8 +3098,8 @@ namespace System.Xml.Serialization
                         Writer.WriteLine("Reader.ReadStartElement();");
                         string methodName = ReferenceMapping(mapping);
 #if DEBUG
-                            // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                            if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name));
+                        // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+                        if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name));
 #endif
                         Writer.Write("object e = ");
                         Writer.Write(methodName);
@@ -4778,8 +4778,8 @@ namespace System.Xml.Serialization
                 {
                     string methodName = ReferenceMapping(mapping);
 #if DEBUG
-                        // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                        if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name));
+                    // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+                    if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name));
 #endif
 
                     if (checkForNull)
@@ -4862,8 +4862,8 @@ namespace System.Xml.Serialization
             if (choice != null)
             {
 #if DEBUG
-                    // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                    if (choiceSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "need parent for the " + source));
+                // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+                if (choiceSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "need parent for the " + source));
 #endif
 
                 string enumTypeName = choice.Mapping.TypeDesc.CSharpName;
index 216c1e2..9c77453 100644 (file)
@@ -1521,7 +1521,7 @@ namespace System.Xml.Serialization
 
         internal static string GetName(Assembly a)
         {
-            return s_assemblyToNameMap != null ? (string) s_assemblyToNameMap[a] : null;
+            return s_assemblyToNameMap != null ? (string)s_assemblyToNameMap[a] : null;
         }
     }
 
@@ -2336,8 +2336,8 @@ namespace System.Xml.Serialization
             string methodName = ReferenceMapping(mapping);
 
 #if DEBUG
-                // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace);
+            // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+            if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace);
 #endif
 
             Writer.Write(methodName);
@@ -2383,8 +2383,8 @@ namespace System.Xml.Serialization
                 if (mapping is EnumMapping)
                 {
 #if DEBUG
-                        // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                        if (defaultValue.GetType() != typeof(string)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, name + " has invalid default type " + defaultValue.GetType().Name));
+                    // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+                    if (defaultValue.GetType() != typeof(string)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, name + " has invalid default type " + defaultValue.GetType().Name));
 #endif
 
                     Writer.Write("if (");
@@ -2684,8 +2684,8 @@ namespace System.Xml.Serialization
                     }
 
 #if DEBUG
-                        // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                        if (enumSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.ChoiceIdentifier.MemberName + " in the members mapping."));
+                    // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+                    if (enumSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.ChoiceIdentifier.MemberName + " in the members mapping."));
 #endif
                 }
 
@@ -2911,8 +2911,8 @@ namespace System.Xml.Serialization
                 string methodName = ReferenceMapping(derived);
 
 #if DEBUG
-                    // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                    if (methodName == null) throw new InvalidOperationException("derived from " + mapping.TypeDesc.FullName + ", " + SR.Format(SR.XmlInternalErrorMethod, derived.TypeDesc.Name) + Environment.StackTrace);
+                // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+                if (methodName == null) throw new InvalidOperationException("derived from " + mapping.TypeDesc.FullName + ", " + SR.Format(SR.XmlInternalErrorMethod, derived.TypeDesc.Name) + Environment.StackTrace);
 #endif
 
                 Writer.Write(methodName);
@@ -2949,8 +2949,8 @@ namespace System.Xml.Serialization
                         string methodName = ReferenceMapping(mapping);
 
 #if DEBUG
-                            // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                            if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace);
+                        // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+                        if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace);
 #endif
                         Writer.WriteLine("Writer.WriteStartElement(n, ns);");
                         Writer.Write("WriteXsiType(");
@@ -4033,8 +4033,8 @@ namespace System.Xml.Serialization
                     string methodName = ReferenceMapping(mapping);
 
 #if DEBUG
-                        // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
-                        if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace);
+                    // use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
+                    if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace);
 #endif
                     Writer.Write(methodName);
                     Writer.Write("(");
@@ -4142,7 +4142,7 @@ namespace System.Xml.Serialization
                 Writer.Write("!");
                 Writer.Write(source);
                 Writer.Write(".Equals(");
-                Type type= Type.GetType(mapping.TypeDesc.Type.FullName);
+                Type type = Type.GetType(mapping.TypeDesc.Type.FullName);
                 WriteValue(type != null ? Convert.ChangeType(value, type) : value);
                 Writer.Write(")");
             }
index 8468112..cd61310 100644 (file)
@@ -41,27 +41,27 @@ namespace System.Xml.Xsl.Qil
             set { _value = value; }
         }
 
-        public static implicit operator string (QilLiteral literal)
+        public static implicit operator string(QilLiteral literal)
         {
             return (string)literal._value;
         }
 
-        public static implicit operator int (QilLiteral literal)
+        public static implicit operator int(QilLiteral literal)
         {
             return (int)literal._value;
         }
 
-        public static implicit operator long (QilLiteral literal)
+        public static implicit operator long(QilLiteral literal)
         {
             return (long)literal._value;
         }
 
-        public static implicit operator double (QilLiteral literal)
+        public static implicit operator double(QilLiteral literal)
         {
             return (double)literal._value;
         }
 
-        public static implicit operator decimal (QilLiteral literal)
+        public static implicit operator decimal(QilLiteral literal)
         {
             return (decimal)literal._value;
         }
index 57fe64e..e484841 100644 (file)
@@ -106,7 +106,7 @@ namespace System.Xml.Xsl.Runtime
                 }
             }
 
-            public static implicit operator int (Options options)
+            public static implicit operator int(Options options)
             {
                 return options._value;
             }
index 1142876..941e321 100644 (file)
@@ -586,7 +586,7 @@ namespace System.Xml.Xsl
             }
 
             // Get the double value.
-            public static explicit operator double (BigNumber bn)
+            public static explicit operator double(BigNumber bn)
             {
                 uint uEx;
                 int exp;
@@ -2458,7 +2458,7 @@ namespace System.Xml.Xsl
 
                 Returns the double value of this floating decimal.
             */
-            public static explicit operator double (FloatingDecimal dec)
+            public static explicit operator double(FloatingDecimal dec)
             {
                 BigNumber num, numHi, numLo;
                 uint ul;
index d6d9d38..471bcc8 100644 (file)
@@ -577,7 +577,7 @@ namespace System.Xml.Xsl.Xslt
                 _prefix = rec.prefix;
                 _localName = rec.localName;
             }
-            public static implicit operator string (DelayedQName qn)
+            public static implicit operator string(DelayedQName qn)
             {
                 return qn._prefix.Length == 0 ? qn._localName : (qn._prefix + ':' + qn._localName);
             }
index 5703000..348dcaf 100644 (file)
@@ -890,7 +890,7 @@ namespace System.Reflection
                     if (left.IsStatic != right.IsStatic)
                         return false;
 
-                    if ( left.Name != right.Name)
+                    if (left.Name != right.Name)
                         return false;
 
                     Type[] leftGenericParameters = left.GetGenericArguments();
index 36a8982..1489304 100644 (file)
@@ -316,7 +316,7 @@ namespace System.Reflection.Metadata
         public Guid ReadGuid()
         {
             const int size = 16;
-            byte * ptr = GetCurrentPointerAndAdvance(size);
+            byte* ptr = GetCurrentPointerAndAdvance(size);
             if (BitConverter.IsLittleEndian)
             {
                 return *(Guid*)ptr;
index 3f29fcf..9680660 100644 (file)
@@ -98,7 +98,7 @@ namespace System.Reflection.PortableExecutable
 
         public static PEHeaderBuilder CreateExecutableHeader()
         {
-            return new PEHeaderBuilder(imageCharacteristics : Characteristics.ExecutableImage);
+            return new PEHeaderBuilder(imageCharacteristics: Characteristics.ExecutableImage);
         }
 
         public static PEHeaderBuilder CreateLibraryHeader()
index b9937b9..f19eb2f 100644 (file)
@@ -121,11 +121,11 @@ namespace System
                 int newMin = FindMostSpecificMethod(
                     candidates[currentMin],
                     paramOrder,
-                    paramArrayType1:null,
+                    paramArrayType1: null,
                     candidates[i],
                     paramOrder,
-                    paramArrayType2:null,
-                    types, args:null);
+                    paramArrayType2: null,
+                    types, args: null);
 
                 if (newMin == 0)
                 {
@@ -235,12 +235,12 @@ namespace System
                     newMin = FindMostSpecific(
                         candidates[currentMin].GetIndexParameters(),
                         paramOrder,
-                        paramArrayType1:null,
+                        paramArrayType1: null,
                         candidates[i].GetIndexParameters(),
                         paramOrder,
                         paramArrayType2: null,
                         indexes,
-                        args:null);
+                        args: null);
 
                 if (newMin == 0)
                 {
index 6dbfe2d..55b1760 100644 (file)
@@ -28,7 +28,7 @@ namespace System.Reflection
                     throw new BadImageFormatException(SR.NoMetadataInPeImage);
 
                 string location = (peStream is FileStream fs) ? (fs.Name ?? string.Empty) : string.Empty;
-                MetadataReader reader  = peReader.GetMetadataReader();
+                MetadataReader reader = peReader.GetMetadataReader();
                 RoAssembly candidate = new EcmaAssembly(this, peReader, reader, location);
                 AssemblyNameData defNameData = candidate.GetAssemblyNameDataNoCopy();
                 byte[] pkt = defNameData.PublicKeyToken ?? Array.Empty<byte>();
index b06f14a..e616b37 100644 (file)
@@ -238,7 +238,7 @@ namespace System.Reflection.TypeLoading.Ecma
 
                     if (br.RemainingBytes == 0)
                         break;
-                    ma.MarshalType  = br.ReadSerializedString();
+                    ma.MarshalType = br.ReadSerializedString();
                     ma.MarshalTypeRef = Helpers.LoadTypeFromAssemblyQualifiedName(ma.MarshalType, module.GetRoAssembly(), ignoreCase: false, throwOnError: false);
 
                     if (br.RemainingBytes == 0)
index d9c8968..20bc2fb 100644 (file)
@@ -6,60 +6,60 @@ namespace System.Reflection.TypeLoading
 {
     internal static class Utf8Constants
     {
-        public static readonly byte[] System = {83, 121, 115, 116, 101, 109};
-        public static readonly byte[] SystemReflection = {83, 121, 115, 116, 101, 109, 46, 82, 101, 102, 108, 101, 99, 116, 105, 111, 110};
-        public static readonly byte[] SystemCollectionsGeneric = {83, 121, 115, 116, 101, 109, 46, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 115, 46, 71, 101, 110, 101, 114, 105, 99};
-        public static readonly byte[] SystemRuntimeInteropServices = {83, 121, 115, 116, 101, 109, 46, 82, 117, 110, 116, 105, 109, 101, 46, 73, 110, 116, 101, 114, 111, 112, 83, 101, 114, 118, 105, 99, 101, 115};
-        public static readonly byte[] SystemRuntimeCompilerServices = {83, 121, 115, 116, 101, 109, 46, 82, 117, 110, 116, 105, 109, 101, 46, 67, 111, 109, 112, 105, 108, 101, 114, 83, 101, 114, 118, 105, 99, 101, 115};
+        public static readonly byte[] System = { 83, 121, 115, 116, 101, 109 };
+        public static readonly byte[] SystemReflection = { 83, 121, 115, 116, 101, 109, 46, 82, 101, 102, 108, 101, 99, 116, 105, 111, 110 };
+        public static readonly byte[] SystemCollectionsGeneric = { 83, 121, 115, 116, 101, 109, 46, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 115, 46, 71, 101, 110, 101, 114, 105, 99 };
+        public static readonly byte[] SystemRuntimeInteropServices = { 83, 121, 115, 116, 101, 109, 46, 82, 117, 110, 116, 105, 109, 101, 46, 73, 110, 116, 101, 114, 111, 112, 83, 101, 114, 118, 105, 99, 101, 115 };
+        public static readonly byte[] SystemRuntimeCompilerServices = { 83, 121, 115, 116, 101, 109, 46, 82, 117, 110, 116, 105, 109, 101, 46, 67, 111, 109, 112, 105, 108, 101, 114, 83, 101, 114, 118, 105, 99, 101, 115 };
 
-        public static readonly byte[] Array = {65, 114, 114, 97, 121};
-        public static readonly byte[] Boolean = {66, 111, 111, 108, 101, 97, 110};
-        public static readonly byte[] Byte = {66, 121, 116, 101};
-        public static readonly byte[] Char = {67, 104, 97, 114};
-        public static readonly byte[] Double = {68, 111, 117, 98, 108, 101};
-        public static readonly byte[] Enum = {69, 110, 117, 109};
-        public static readonly byte[] Int16 = {73, 110, 116, 49, 54};
-        public static readonly byte[] Int32 = {73, 110, 116, 51, 50};
-        public static readonly byte[] Int64 = {73, 110, 116, 54, 52};
-        public static readonly byte[] IntPtr = {73, 110, 116, 80, 116, 114};
-        public static readonly byte[] Object = {79, 98, 106, 101, 99, 116};
+        public static readonly byte[] Array = { 65, 114, 114, 97, 121 };
+        public static readonly byte[] Boolean = { 66, 111, 111, 108, 101, 97, 110 };
+        public static readonly byte[] Byte = { 66, 121, 116, 101 };
+        public static readonly byte[] Char = { 67, 104, 97, 114 };
+        public static readonly byte[] Double = { 68, 111, 117, 98, 108, 101 };
+        public static readonly byte[] Enum = { 69, 110, 117, 109 };
+        public static readonly byte[] Int16 = { 73, 110, 116, 49, 54 };
+        public static readonly byte[] Int32 = { 73, 110, 116, 51, 50 };
+        public static readonly byte[] Int64 = { 73, 110, 116, 54, 52 };
+        public static readonly byte[] IntPtr = { 73, 110, 116, 80, 116, 114 };
+        public static readonly byte[] Object = { 79, 98, 106, 101, 99, 116 };
         public static readonly byte[] NullableT = { 78, 117, 108, 108, 97, 98, 108, 101, 96, 49 };
-        public static readonly byte[] SByte = {83, 66, 121, 116, 101};
-        public static readonly byte[] Single = {83, 105, 110, 103, 108, 101};
-        public static readonly byte[] String = {83, 116, 114, 105, 110, 103};
-        public static readonly byte[] TypedReference = {84, 121, 112, 101, 100, 82, 101, 102, 101, 114, 101, 110, 99, 101};
-        public static readonly byte[] UInt16 = {85, 73, 110, 116, 49, 54};
-        public static readonly byte[] UInt32 = {85, 73, 110, 116, 51, 50};
-        public static readonly byte[] UInt64 = {85, 73, 110, 116, 54, 52};
-        public static readonly byte[] UIntPtr = {85, 73, 110, 116, 80, 116, 114};
-        public static readonly byte[] ValueType = {86, 97, 108, 117, 101, 84, 121, 112, 101};
-        public static readonly byte[] Void = {86, 111, 105, 100};
-        public static readonly byte[] MulticastDelegate = {77, 117, 108, 116, 105, 99, 97, 115, 116, 68, 101, 108, 101, 103, 97, 116, 101};
-        public static readonly byte[] IEnumerableT = {73, 69, 110, 117, 109, 101, 114, 97, 98, 108, 101, 96, 49};
-        public static readonly byte[] ICollectionT = {73, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 96, 49};
-        public static readonly byte[] IListT = {73, 76, 105, 115, 116, 96, 49};
-        public static readonly byte[] IReadOnlyListT = {73, 82, 101, 97, 100, 79, 110, 108, 121, 76, 105, 115, 116, 96, 49};
-        public static readonly byte[] Type = {84, 121, 112, 101};
-        public static readonly byte[] DBNull = {68, 66, 78, 117, 108, 108};
-        public static readonly byte[] Decimal = {68, 101, 99, 105, 109, 97, 108};
-        public static readonly byte[] DateTime = {68, 97, 116, 101, 84, 105, 109, 101};
-        public static readonly byte[] ComImportAttribute = {67, 111, 109, 73, 109, 112, 111, 114, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] DllImportAttribute = {68, 108, 108, 73, 109, 112, 111, 114, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] CallingConvention = {67, 97, 108, 108, 105, 110, 103, 67, 111, 110, 118, 101, 110, 116, 105, 111, 110};
-        public static readonly byte[] CharSet = {67, 104, 97, 114, 83, 101, 116};
-        public static readonly byte[] MarshalAsAttribute = {77, 97, 114, 115, 104, 97, 108, 65, 115, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] UnmanagedType = {85, 110, 109, 97, 110, 97, 103, 101, 100, 84, 121, 112, 101};
-        public static readonly byte[] VarEnum = {86, 97, 114, 69, 110, 117, 109};
-        public static readonly byte[] InAttribute = {73, 110, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] OutAttriubute = {79, 117, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] OptionalAttribute = {79, 112, 116, 105, 111, 110, 97, 108, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] PreserveSigAttribute = {80, 114, 101, 115, 101, 114, 118, 101, 83, 105, 103, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] FieldOffsetAttribute = {70, 105, 101, 108, 100, 79, 102, 102, 115, 101, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] IsByRefLikeAttribute = {73, 115, 66, 121, 82, 101, 102, 76, 105, 107, 101, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] DecimalConstantAttribute = {68, 101, 99, 105, 109, 97, 108, 67, 111, 110, 115, 116, 97, 110, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] CustomConstantAttribute = {67, 117, 115, 116, 111, 109, 67, 111, 110, 115, 116, 97, 110, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] GuidAttribute = {71, 117, 105, 100, 65, 116, 116, 114, 105, 98, 117, 116, 101};
-        public static readonly byte[] DefaultMemberAttribute = {68, 101, 102, 97, 117, 108, 116, 77, 101, 109, 98, 101, 114, 65, 116, 116, 114, 105, 98, 117, 116, 101};
+        public static readonly byte[] SByte = { 83, 66, 121, 116, 101 };
+        public static readonly byte[] Single = { 83, 105, 110, 103, 108, 101 };
+        public static readonly byte[] String = { 83, 116, 114, 105, 110, 103 };
+        public static readonly byte[] TypedReference = { 84, 121, 112, 101, 100, 82, 101, 102, 101, 114, 101, 110, 99, 101 };
+        public static readonly byte[] UInt16 = { 85, 73, 110, 116, 49, 54 };
+        public static readonly byte[] UInt32 = { 85, 73, 110, 116, 51, 50 };
+        public static readonly byte[] UInt64 = { 85, 73, 110, 116, 54, 52 };
+        public static readonly byte[] UIntPtr = { 85, 73, 110, 116, 80, 116, 114 };
+        public static readonly byte[] ValueType = { 86, 97, 108, 117, 101, 84, 121, 112, 101 };
+        public static readonly byte[] Void = { 86, 111, 105, 100 };
+        public static readonly byte[] MulticastDelegate = { 77, 117, 108, 116, 105, 99, 97, 115, 116, 68, 101, 108, 101, 103, 97, 116, 101 };
+        public static readonly byte[] IEnumerableT = { 73, 69, 110, 117, 109, 101, 114, 97, 98, 108, 101, 96, 49 };
+        public static readonly byte[] ICollectionT = { 73, 67, 111, 108, 108, 101, 99, 116, 105, 111, 110, 96, 49 };
+        public static readonly byte[] IListT = { 73, 76, 105, 115, 116, 96, 49 };
+        public static readonly byte[] IReadOnlyListT = { 73, 82, 101, 97, 100, 79, 110, 108, 121, 76, 105, 115, 116, 96, 49 };
+        public static readonly byte[] Type = { 84, 121, 112, 101 };
+        public static readonly byte[] DBNull = { 68, 66, 78, 117, 108, 108 };
+        public static readonly byte[] Decimal = { 68, 101, 99, 105, 109, 97, 108 };
+        public static readonly byte[] DateTime = { 68, 97, 116, 101, 84, 105, 109, 101 };
+        public static readonly byte[] ComImportAttribute = { 67, 111, 109, 73, 109, 112, 111, 114, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] DllImportAttribute = { 68, 108, 108, 73, 109, 112, 111, 114, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] CallingConvention = { 67, 97, 108, 108, 105, 110, 103, 67, 111, 110, 118, 101, 110, 116, 105, 111, 110 };
+        public static readonly byte[] CharSet = { 67, 104, 97, 114, 83, 101, 116 };
+        public static readonly byte[] MarshalAsAttribute = { 77, 97, 114, 115, 104, 97, 108, 65, 115, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] UnmanagedType = { 85, 110, 109, 97, 110, 97, 103, 101, 100, 84, 121, 112, 101 };
+        public static readonly byte[] VarEnum = { 86, 97, 114, 69, 110, 117, 109 };
+        public static readonly byte[] InAttribute = { 73, 110, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] OutAttriubute = { 79, 117, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] OptionalAttribute = { 79, 112, 116, 105, 111, 110, 97, 108, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] PreserveSigAttribute = { 80, 114, 101, 115, 101, 114, 118, 101, 83, 105, 103, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] FieldOffsetAttribute = { 70, 105, 101, 108, 100, 79, 102, 102, 115, 101, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] IsByRefLikeAttribute = { 73, 115, 66, 121, 82, 101, 102, 76, 105, 107, 101, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] DecimalConstantAttribute = { 68, 101, 99, 105, 109, 97, 108, 67, 111, 110, 115, 116, 97, 110, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] CustomConstantAttribute = { 67, 117, 115, 116, 111, 109, 67, 111, 110, 115, 116, 97, 110, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] GuidAttribute = { 71, 117, 105, 100, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
+        public static readonly byte[] DefaultMemberAttribute = { 68, 101, 102, 97, 117, 108, 116, 77, 101, 109, 98, 101, 114, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
         public static readonly byte[] DateTimeConstantAttribute = { 68, 97, 116, 101, 84, 105, 109, 101, 67, 111, 110, 115, 116, 97, 110, 116, 65, 116, 116, 114, 105, 98, 117, 116, 101 };
     }
 }
index fb721d5..b3a9e08 100644 (file)
@@ -45,7 +45,7 @@ namespace System.Reflection.TypeLoading.Ecma
         public sealed override Guid ModuleVersionId => ModuleDefinition.Mvid.GetGuid(Reader);
         public sealed override string ScopeName => ModuleDefinition.Name.GetString(Reader);
 
-        public sealed override IEnumerable<CustomAttributeData> CustomAttributes  => ModuleDefinition.GetCustomAttributes().ToTrueCustomAttributes(this);
+        public sealed override IEnumerable<CustomAttributeData> CustomAttributes => ModuleDefinition.GetCustomAttributes().ToTrueCustomAttributes(this);
 
         internal MethodInfo ComputeEntryPoint(bool fileRefEntryPointAllowed)
         {
index e84ae2a..d4a4ad9 100644 (file)
@@ -41,9 +41,9 @@ namespace System.Reflection.TypeLoading
 
             MemberInfo[] results;
 
-            if ((results = QuerySpecificMemberTypeIfRequested(type, optionalName, bindingAttr, predicate, MemberTypes.Method, out QueryResult<MethodInfo>  methods)) != null)
+            if ((results = QuerySpecificMemberTypeIfRequested(type, optionalName, bindingAttr, predicate, MemberTypes.Method, out QueryResult<MethodInfo> methods)) != null)
                 return results;
-            if ((results = QuerySpecificMemberTypeIfRequested(type, optionalName, bindingAttr, predicate, MemberTypes.Constructor, out QueryResult<ConstructorInfo>  constructors)) != null)
+            if ((results = QuerySpecificMemberTypeIfRequested(type, optionalName, bindingAttr, predicate, MemberTypes.Constructor, out QueryResult<ConstructorInfo> constructors)) != null)
                 return results;
             if ((results = QuerySpecificMemberTypeIfRequested(type, optionalName, bindingAttr, predicate, MemberTypes.Property, out QueryResult<PropertyInfo> properties)) != null)
                 return results;
index 0f87239..81b0d9f 100644 (file)
@@ -150,7 +150,7 @@ namespace System.Reflection.TypeLoading
 
         internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter filter, Type reflectedType)
         {
-            int rank =_rank;
+            int rank = _rank;
 
             int uniquifier = 0;
             RoType systemInt32 = Loader.GetCoreType(CoreType.Int32);
index 80c2579..aa63d7f 100644 (file)
@@ -332,7 +332,7 @@ namespace System.Reflection
             }
 
             return token;
-         }
+        }
     }
 
     public static class MethodInfoExtensions
index 7ad8833..64191f6 100644 (file)
@@ -119,7 +119,7 @@ namespace System.Resources.Extensions
             ReadOnlySpan<char> typeSpan = assemblyQualifiedTypeName.AsSpan().TrimStart(s_whiteSpaceChars);
             ReadOnlySpan<char> typeName = ReadTypeName(typeSpan);
 
-            int hashCode =  0;
+            int hashCode = 0;
             for (int i = 0; i < typeName.Length; i++)
             {
                 hashCode = HashHelpers.Combine(hashCode, typeName[i].GetHashCode());
index 3fc14b2..eef8812 100644 (file)
@@ -10,7 +10,7 @@ using System.Diagnostics;
 namespace System.Resources
 {
     //internal sealed class FastResourceComparer : IComparer, IEqualityComparer, IComparer<String>, IEqualityComparer<String>
-    internal sealed class FastResourceComparer :IComparer<string>, IEqualityComparer<string>
+    internal sealed class FastResourceComparer : IComparer<string>, IEqualityComparer<string>
     {
         internal static readonly FastResourceComparer Default = new FastResourceComparer();
 
index 37b8ce8..ec98920 100644 (file)
@@ -59,7 +59,7 @@ namespace System.Runtime.CompilerServices
     [AttributeUsage(AttributeTargets.All)]
     internal sealed class DecoratedNameAttribute : Attribute
     {
-        public DecoratedNameAttribute(string decoratedName) {}
+        public DecoratedNameAttribute(string decoratedName) { }
     }
 
     // Indicates that the modified instance is pinned in memory.
@@ -121,7 +121,7 @@ namespace System.Runtime.CompilerServices
         public NativeCppClassAttribute() { }
     }
 
-    [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface, AllowMultiple=true, Inherited=false)]
+    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
     public sealed class RequiredAttributeAttribute : Attribute
     {
         public RequiredAttributeAttribute(Type requiredContract) => RequiredContract = requiredContract;
index 376198f..1f53dfd 100644 (file)
@@ -28,7 +28,7 @@ namespace System
             HResult = HResults.COR_E_CONTEXTMARSHAL;
         }
 
-        protected ContextMarshalException(SerializationInfo info, StreamingContext context): base(info, context)
+        protected ContextMarshalException(SerializationInfo info, StreamingContext context) : base(info, context)
         {
         }
     }
index 10e182b..33151f0 100644 (file)
@@ -14,7 +14,7 @@ namespace System
         }
         public LoaderOptimizationAttribute(LoaderOptimization value)
         {
-            _val = (byte) value;
+            _val = (byte)value;
         }
         public LoaderOptimization Value => (LoaderOptimization)_val;
     }
index b67200c..6017ddb 100644 (file)
@@ -18,7 +18,9 @@ namespace System.Runtime.CompilerServices
             : base(SR.Arg_SwitchExpressionException) { }
 
         public SwitchExpressionException(Exception? innerException) :
-            base(SR.Arg_SwitchExpressionException, innerException) { }
+            base(SR.Arg_SwitchExpressionException, innerException)
+        {
+        }
 
         public SwitchExpressionException(object? unmatchedValue) : this()
         {
index b7fc1c0..5b88be0 100644 (file)
@@ -60,7 +60,8 @@ namespace System.Runtime.Versioning
                 safeName.Append('r');
                 safeName.Append(clrID);
             }
-            if ((requires & SxSRequirements.AppDomainID) != 0) {
+            if ((requires & SxSRequirements.AppDomainID) != 0)
+            {
                 safeName.Append(separator);
                 safeName.Append("ad");
                 safeName.Append(AppDomain.CurrentDomain.Id);
index a72d047..3baa883 100644 (file)
@@ -18,7 +18,8 @@ namespace System.Runtime.InteropServices.ComTypes
     [ComImport]
     [Guid("0000010E-0000-0000-C000-000000000046")]
     [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
-    public interface IDataObject {
+    public interface IDataObject
+    {
 
         /// <summary>
         ///     Called by a data consumer to obtain data from a source data object.
index 7d00058..596e5e3 100644 (file)
@@ -24,7 +24,7 @@ namespace System.Runtime.InteropServices.ComTypes
         /// in NULL for that parameter).
         /// </summary>
         [PreserveSig]
-        int Next(int celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] STATDATA[] rgelt, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst=1)] int[] pceltFetched);
+        int Next(int celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] STATDATA[] rgelt, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst = 1)] int[] pceltFetched);
 
         /// <summary>
         /// Skips over the next specified number of elements in the enumeration sequence.
index 62d7d40..7da0f01 100644 (file)
@@ -253,7 +253,7 @@ namespace System.Numerics
         {
         }
 
-        public BigInteger(ReadOnlySpan<byte> value, bool isUnsigned=false, bool isBigEndian=false)
+        public BigInteger(ReadOnlySpan<byte> value, bool isUnsigned = false, bool isBigEndian = false)
         {
             int byteCount = value.Length;
 
@@ -1150,7 +1150,7 @@ namespace System.Numerics
         ///   </item>
         /// </list>
         /// </remarks>
-        public byte[] ToByteArray(bool isUnsigned=false, bool isBigEndian=false)
+        public byte[] ToByteArray(bool isUnsigned = false, bool isBigEndian = false)
         {
             int ignored = 0;
             return TryGetBytes(GetBytesMode.AllocateArray, default, isUnsigned, isBigEndian, ref ignored);
@@ -1167,7 +1167,7 @@ namespace System.Numerics
         /// <param name="isBigEndian">Whether or not to write the bytes in a big-endian byte order</param>
         /// <returns>true if the bytes fit in <paramref name="destination"/>; false if not all bytes could be written due to lack of space.</returns>
         /// <exception cref="OverflowException">If <paramref name="isUnsigned"/> is <c>true</c> and <see cref="Sign"/> is negative.</exception>
-        public bool TryWriteBytes(Span<byte> destination, out int bytesWritten, bool isUnsigned=false, bool isBigEndian=false)
+        public bool TryWriteBytes(Span<byte> destination, out int bytesWritten, bool isUnsigned = false, bool isBigEndian = false)
         {
             bytesWritten = 0;
             if (TryGetBytes(GetBytesMode.Span, destination, isUnsigned, isBigEndian, ref bytesWritten) == null)
@@ -1186,7 +1186,7 @@ namespace System.Numerics
 
         /// <summary>Gets the number of bytes that will be output by <see cref="ToByteArray(bool, bool)"/> and <see cref="TryWriteBytes(Span{byte}, out int, bool, bool)"/>.</summary>
         /// <returns>The number of bytes.</returns>
-        public int GetByteCount(bool isUnsigned=false)
+        public int GetByteCount(bool isUnsigned = false)
         {
             int count = 0;
             // Big or Little Endian doesn't matter for the byte count.
index 6fa62c1..d94653e 100644 (file)
@@ -453,7 +453,8 @@ namespace System.Numerics
             return new Complex(u, v);
         }
 
-        public static Complex Cos(Complex value) {
+        public static Complex Cos(Complex value)
+        {
             double p = Math.Exp(value.m_imaginary);
             double q = 1.0 / p;
             double sinh = (p - q) * 0.5;
@@ -532,7 +533,8 @@ namespace System.Numerics
             return (ImaginaryOne / two) * (Log(One - ImaginaryOne * value) - Log(One + ImaginaryOne * value));
         }
 
-        private static void Asin_Internal (double x, double y, out double b, out double bPrime, out double v) {
+        private static void Asin_Internal(double x, double y, out double b, out double bPrime, out double v)
+        {
 
             // This method for the inverse complex sine (and cosine) is described in Hull, Fairgrieve,
             // and Tang, "Implementing the Complex Arcsine and Arccosine Functions Using Exception Handling",
index fbf99a3..4805dc7 100644 (file)
@@ -229,7 +229,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
                 }
                 else
                 {
-                    return index > _objects.Length - 1 ? null  : _objects[index];
+                    return index > _objects.Length - 1 ? null : _objects[index];
                 }
             }
             set
index 01095e7..bd3f7b8 100644 (file)
@@ -39,7 +39,7 @@ namespace Windows.UI.Xaml
         }
 
         protected LayoutCycleException(SerializationInfo serializationInfo, StreamingContext streamingContext)
-            : base (serializationInfo, streamingContext)
+            : base(serializationInfo, streamingContext)
         {
         }
     }
index e0d60fb..affa25f 100644 (file)
@@ -296,15 +296,15 @@ namespace System.Threading.Tasks
 
         #region State bit field operations
 
-        internal bool CompletedSynchronously {[Pure] get { return (0 != (_state & STATEFLAG_COMPLETED_SYNCHRONOUSLY)); } }
+        internal bool CompletedSynchronously { [Pure] get { return (0 != (_state & STATEFLAG_COMPLETED_SYNCHRONOUSLY)); } }
 
-        private bool IsInStartedState {[Pure] get { return (0 != (_state & STATE_STARTED)); } }
+        private bool IsInStartedState { [Pure] get { return (0 != (_state & STATE_STARTED)); } }
 
-        private bool IsInRunToCompletionState {[Pure] get { return (0 != (_state & STATE_RUN_TO_COMPLETION)); } }
+        private bool IsInRunToCompletionState { [Pure] get { return (0 != (_state & STATE_RUN_TO_COMPLETION)); } }
 
-        private bool IsInErrorState {[Pure] get { return (0 != (_state & STATE_ERROR)); } }
+        private bool IsInErrorState { [Pure] get { return (0 != (_state & STATE_ERROR)); } }
 
-        private bool IsInClosedState {[Pure] get { return (0 != (_state & STATE_CLOSED)); } }
+        private bool IsInClosedState { [Pure] get { return (0 != (_state & STATE_CLOSED)); } }
 
         private bool IsInRunningState
         {
index d9b391c..ad19485 100644 (file)
@@ -37,11 +37,11 @@ namespace System.Security.AccessControl
 
         #region Constructors
 
-        internal AceEnumerator( GenericAcl collection )
+        internal AceEnumerator(GenericAcl collection)
         {
-            if ( collection == null )
+            if (collection == null)
             {
-                throw new ArgumentNullException( nameof(collection));
+                throw new ArgumentNullException(nameof(collection));
             }
 
             _acl = collection;
@@ -56,10 +56,10 @@ namespace System.Security.AccessControl
         {
             get
             {
-                if ( _current == -1 ||
-                    _current >= _acl.Count )
+                if (_current == -1 ||
+                    _current >= _acl.Count)
                 {
-                    throw new InvalidOperationException( SR.Arg_InvalidOperationException );
+                    throw new InvalidOperationException(SR.Arg_InvalidOperationException);
                 }
 
                 return _acl[_current];
@@ -68,14 +68,14 @@ namespace System.Security.AccessControl
 
         public GenericAce Current
         {
-            get { return (( IEnumerator )this ).Current as GenericAce; }
+            get { return ((IEnumerator)this).Current as GenericAce; }
         }
 
         public bool MoveNext()
         {
             _current++;
 
-            return ( _current < _acl.Count );
+            return (_current < _acl.Count);
         }
 
         public void Reset()
@@ -161,46 +161,42 @@ namespace System.Security.AccessControl
         // Returns the binary representation of the ACL
         //
 
-        public abstract void GetBinaryForm( byte[] binaryForm, int offset );
+        public abstract void GetBinaryForm(byte[] binaryForm, int offset);
 
         #endregion
 
         #region ICollection Implementation
 
-        void ICollection.CopyTo( Array array, int index )
+        void ICollection.CopyTo(Array array, int index)
         {
-            if ( array == null )
+            if (array == null)
             {
-                throw new ArgumentNullException( nameof(array));
+                throw new ArgumentNullException(nameof(array));
             }
 
-            if ( array.Rank != 1 )
+            if (array.Rank != 1)
             {
-                throw new RankException( SR.Rank_MultiDimNotSupported );
+                throw new RankException(SR.Rank_MultiDimNotSupported);
             }
 
-            if ( index < 0 )
+            if (index < 0)
             {
-                throw new ArgumentOutOfRangeException(
-nameof(index),
-                    SR.ArgumentOutOfRange_NeedNonNegNum );
+                throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum);
             }
-            else if ( array.Length - index < Count )
+            else if (array.Length - index < Count)
             {
-                throw new ArgumentOutOfRangeException(
-nameof(array),
-                    SR.ArgumentOutOfRange_ArrayTooSmall );
+                throw new ArgumentOutOfRangeException(nameof(array), SR.ArgumentOutOfRange_ArrayTooSmall);
             }
 
-            for ( int i = 0; i < Count; i++ )
+            for (int i = 0; i < Count; i++)
             {
-                array.SetValue( this[i], index + i );
+                array.SetValue(this[i], index + i);
             }
         }
 
-        public void CopyTo( GenericAce[] array, int index )
+        public void CopyTo(GenericAce[] array, int index)
         {
-            (( ICollection )this ).CopyTo( array, index );
+            ((ICollection)this).CopyTo(array, index);
         }
 
         public abstract int Count { get; }
@@ -221,12 +217,12 @@ nameof(array),
 
         IEnumerator IEnumerable.GetEnumerator()
         {
-            return new AceEnumerator( this );
+            return new AceEnumerator(this);
         }
 
         public AceEnumerator GetEnumerator()
         {
-            return (( IEnumerable )this ).GetEnumerator() as AceEnumerator;
+            return ((IEnumerable)this).GetEnumerator() as AceEnumerator;
         }
 
         #endregion
@@ -244,25 +240,23 @@ nameof(array),
 
         #region Private Methods
 
-        private static void VerifyHeader( byte[] binaryForm, int offset, out byte revision, out int count, out int length )
+        private static void VerifyHeader(byte[] binaryForm, int offset, out byte revision, out int count, out int length)
         {
-            if ( binaryForm == null )
+            if (binaryForm == null)
             {
-                throw new ArgumentNullException( nameof(binaryForm));
+                throw new ArgumentNullException(nameof(binaryForm));
             }
 
-            if ( offset < 0 )
+            if (offset < 0)
             {
                 //
                 // Offset must not be negative
                 //
 
-                throw new ArgumentOutOfRangeException(
-nameof(offset),
-                    SR.ArgumentOutOfRange_NeedNonNegNum );
+                throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
             }
 
-            if ( binaryForm.Length - offset < HeaderLength )
+            if (binaryForm.Length - offset < HeaderLength)
             {
                 //
                 // We expect at least the ACL header
@@ -272,10 +266,10 @@ nameof(offset),
             }
 
             revision = binaryForm[offset + 0];
-            length = ( binaryForm[offset + 2] << 0 ) + ( binaryForm[offset + 3] << 8 );
-            count = ( binaryForm[offset + 4] << 0 ) + ( binaryForm[offset + 5] << 8 );
+            length = (binaryForm[offset + 2] << 0) + (binaryForm[offset + 3] << 8);
+            count = (binaryForm[offset + 4] << 0) + (binaryForm[offset + 5] << 8);
 
-            if ( length > binaryForm.Length - offset )
+            if (length > binaryForm.Length - offset)
             {
                 //
                 // Reported length of ACL ought to be no longer than the
@@ -289,45 +283,39 @@ nameof(offset),
 
         InvalidParameter:
 
-            throw new ArgumentOutOfRangeException(
-nameof(binaryForm),
-                SR.ArgumentOutOfRange_ArrayTooSmall );
+            throw new ArgumentOutOfRangeException(nameof(binaryForm), SR.ArgumentOutOfRange_ArrayTooSmall);
         }
 
-        private void MarshalHeader( byte[] binaryForm, int offset )
+        private void MarshalHeader(byte[] binaryForm, int offset)
         {
-            if ( binaryForm == null )
+            if (binaryForm == null)
             {
-                throw new ArgumentNullException( nameof(binaryForm));
+                throw new ArgumentNullException(nameof(binaryForm));
             }
-            else if ( offset < 0 )
+            else if (offset < 0)
             {
-                throw new ArgumentOutOfRangeException(
-nameof(offset),
-                    SR.ArgumentOutOfRange_NeedNonNegNum );
+                throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
             }
-            else if ( BinaryLength > MaxBinaryLength )
+            else if (BinaryLength > MaxBinaryLength)
             {
-                throw new InvalidOperationException( SR.AccessControl_AclTooLong );
+                throw new InvalidOperationException(SR.AccessControl_AclTooLong);
             }
-            else if ( binaryForm.Length - offset < BinaryLength )
+            else if (binaryForm.Length - offset < BinaryLength)
             {
-                throw new ArgumentOutOfRangeException(
-nameof(binaryForm),
-                    SR.ArgumentOutOfRange_ArrayTooSmall );
+                throw new ArgumentOutOfRangeException(nameof(binaryForm), SR.ArgumentOutOfRange_ArrayTooSmall);
             }
 
             binaryForm[offset + 0] = Revision;
             binaryForm[offset + 1] = 0;
-            binaryForm[offset + 2] = unchecked(( byte )( BinaryLength >> 0 ));
-            binaryForm[offset + 3] = ( byte )( BinaryLength >> 8 );
-            binaryForm[offset + 4] = unchecked(( byte )( Count >> 0 ));
-            binaryForm[offset + 5] = ( byte )( Count >> 8 );
+            binaryForm[offset + 2] = unchecked((byte)(BinaryLength >> 0));
+            binaryForm[offset + 3] = (byte)(BinaryLength >> 8);
+            binaryForm[offset + 4] = unchecked((byte)(Count >> 0));
+            binaryForm[offset + 5] = (byte)(Count >> 8);
             binaryForm[offset + 6] = 0;
             binaryForm[offset + 7] = 0;
         }
 
-        internal void SetBinaryForm( byte[] binaryForm, int offset )
+        internal void SetBinaryForm(byte[] binaryForm, int offset)
         {
             int count, length;
 
@@ -335,7 +323,7 @@ nameof(binaryForm),
             // Verify the header and extract interesting header info
             //
 
-            VerifyHeader( binaryForm, offset, out _revision, out count, out length );
+            VerifyHeader(binaryForm, offset, out _revision, out count, out length);
 
             //
             // Remember how far ahead the binary form should end (for later verification)
@@ -345,16 +333,16 @@ nameof(binaryForm),
 
             offset += HeaderLength;
 
-            _aces = new List<GenericAce>( count );
+            _aces = new List<GenericAce>(count);
             int binaryLength = HeaderLength;
 
-            for ( int i = 0; i < count; i++ )
+            for (int i = 0; i < count; i++)
             {
-                GenericAce ace = GenericAce.CreateFromBinaryForm( binaryForm, offset );
+                GenericAce ace = GenericAce.CreateFromBinaryForm(binaryForm, offset);
 
                 int aceLength = ace.BinaryLength;
 
-                if ( binaryLength + aceLength > MaxBinaryLength )
+                if (binaryLength + aceLength > MaxBinaryLength)
                 {
                     //
                     // The ACE was too long - it would overflow the ACL maximum length
@@ -363,16 +351,16 @@ nameof(binaryForm),
                     throw new ArgumentException(SR.ArgumentException_InvalidAclBinaryForm, nameof(binaryForm));
                 }
 
-                _aces.Add( ace );
+                _aces.Add(ace);
 
-                if ( aceLength % 4 != 0 )
+                if (aceLength % 4 != 0)
                 {
                     //
                     // This indicates a bug in one of the ACE classes.
                     // Binary length of an ace must ALWAYS be divisible by 4.
                     //
 
-                    Debug.Assert( false, "aceLength % 4 != 0" );
+                    Debug.Assert(false, "aceLength % 4 != 0");
                     // Replacing SystemException with InvalidOperationException. This code path
                     // indicates a bad ACE, but I don't know of a great exception to represent that.
                     // InvalidOperation seems to be the closest, though it's definitely not exactly
@@ -382,7 +370,7 @@ nameof(binaryForm),
 
                 binaryLength += aceLength;
 
-                if ( _revision == AclRevisionDS )
+                if (_revision == AclRevisionDS)
                 {
                     //
                     // Increment the offset by the advertised length rather than the
@@ -401,7 +389,7 @@ nameof(binaryForm),
                 // Verify that no more than the advertised length of the ACL was consumed
                 //
 
-                if ( offset > length )
+                if (offset > length)
                 {
                     goto InvalidParameter;
                 }
@@ -424,21 +412,21 @@ nameof(binaryForm));
         // Creates an empty ACL
         //
 
-        public RawAcl( byte revision, int capacity )
+        public RawAcl(byte revision, int capacity)
             : base()
         {
             _revision = revision;
-            _aces = new List<GenericAce>( capacity );
+            _aces = new List<GenericAce>(capacity);
         }
 
         //
         // Creates an ACL from its binary representation
         //
 
-        public RawAcl( byte[] binaryForm, int offset )
+        public RawAcl(byte[] binaryForm, int offset)
             : base()
         {
-            SetBinaryForm( binaryForm, offset );
+            SetBinaryForm(binaryForm, offset);
         }
 
         #endregion
@@ -491,31 +479,31 @@ nameof(binaryForm));
         // Returns the binary representation of the ACL
         //
 
-        public override void GetBinaryForm( byte[] binaryForm, int offset )
+        public override void GetBinaryForm(byte[] binaryForm, int offset)
         {
             //
             // Populate the header
             //
 
-            MarshalHeader( binaryForm, offset );
+            MarshalHeader(binaryForm, offset);
             offset += HeaderLength;
 
-            for ( int i = 0; i < Count; i++ )
+            for (int i = 0; i < Count; i++)
             {
                 GenericAce ace = _aces[i];
 
-                ace.GetBinaryForm( binaryForm, offset );
+                ace.GetBinaryForm(binaryForm, offset);
 
                 int aceLength = ace.BinaryLength;
 
-                if ( aceLength % 4 != 0 )
+                if (aceLength % 4 != 0)
                 {
                     //
                     // This indicates a bug in one of the ACE classes.
                     // Binary length of an ace must ALWAYS be divisible by 4.
                     //
 
-                    Debug.Assert( false, "aceLength % 4 != 0" );
+                    Debug.Assert(false, "aceLength % 4 != 0");
                     // Replacing SystemException with InvalidOperationException. This code path
                     // indicates a bad ACE, but I don't know of a great exception to represent that.
                     // InvalidOperation seems to be the closest, though it's definitely not exactly
@@ -542,19 +530,19 @@ nameof(binaryForm));
 
             set
             {
-                if ( value == null )
+                if (value == null)
                 {
-                    throw new ArgumentNullException( nameof(value));
+                    throw new ArgumentNullException(nameof(value));
                 }
 
-                if ( value.BinaryLength % 4 != 0 )
+                if (value.BinaryLength % 4 != 0)
                 {
                     //
                     // This indicates a bug in one of the ACE classes.
                     // Binary length of an ace must ALWAYS be divisible by 4.
                     //
 
-                    Debug.Assert( false, "aceLength % 4 != 0" );
+                    Debug.Assert(false, "aceLength % 4 != 0");
                     // Replacing SystemException with InvalidOperationException. This code path
                     // indicates a bad ACE, but I don't know of a great exception to represent that.
                     // InvalidOperation seems to be the closest, though it's definitely not exactly
@@ -562,11 +550,11 @@ nameof(binaryForm));
                     throw new InvalidOperationException();
                 }
 
-                int newBinaryLength = BinaryLength - ( index < _aces.Count ? _aces[index].BinaryLength : 0 ) + value.BinaryLength;
+                int newBinaryLength = BinaryLength - (index < _aces.Count ? _aces[index].BinaryLength : 0) + value.BinaryLength;
 
-                if ( newBinaryLength > MaxBinaryLength )
+                if (newBinaryLength > MaxBinaryLength)
                 {
-                    throw new OverflowException( SR.AccessControl_AclTooLong );
+                    throw new OverflowException(SR.AccessControl_AclTooLong);
                 }
 
                 _aces[index] = value;
@@ -577,29 +565,29 @@ nameof(binaryForm));
         // Adds an ACE at the specified index
         //
 
-        public void InsertAce( int index, GenericAce ace )
+        public void InsertAce(int index, GenericAce ace)
         {
-            if ( ace == null )
+            if (ace == null)
             {
-                throw new ArgumentNullException( nameof(ace));
+                throw new ArgumentNullException(nameof(ace));
             }
 
-            if ( BinaryLength + ace.BinaryLength > MaxBinaryLength )
+            if (BinaryLength + ace.BinaryLength > MaxBinaryLength)
             {
-                throw new OverflowException( SR.AccessControl_AclTooLong );
+                throw new OverflowException(SR.AccessControl_AclTooLong);
             }
 
-            _aces.Insert( index, ace );
+            _aces.Insert(index, ace);
         }
 
         //
         // Removes an ACE at the specified index
         //
 
-        public void RemoveAce( int index )
+        public void RemoveAce(int index)
         {
             GenericAce ace = _aces[index];
-            _aces.RemoveAt( index );
+            _aces.RemoveAt(index);
         }
 
         #endregion
@@ -613,22 +601,22 @@ nameof(binaryForm));
         [Flags]
         private enum AF    // ACE flags
         {
-            CI        = 0x8,    // container inherit
-            OI        = 0x4,    // object inherit
-            IO        = 0x2,    // inherit only
-            NP        = 0x1,    // no propagate inherit
-            Invalid   = NP,     // not a valid combination of flags
+            CI = 0x8,     // container inherit
+            OI = 0x4,     // object inherit
+            IO = 0x2,     // inherit only
+            NP = 0x1,     // no propagate inherit
+            Invalid = NP, // not a valid combination of flags
         }
 
         [Flags]
         private enum PM    // Propagation matrix
         {
-            F         = 0x10,    // folder
-            CF        = 0x08,    // child folder
-            CO        = 0x04,    // child object
-            GF        = 0x02,    // grandchild folder
-            GO        = 0x01,    // grandchild object
-            Invalid   = GO,      // not a valid combination of flags
+            F = 0x10,     // folder
+            CF = 0x08,    // child folder
+            CO = 0x04,    // child object
+            GF = 0x02,    // grandchild folder
+            GO = 0x01,    // grandchild object
+            Invalid = GO, // not a valid combination of flags
         }
 
         private static readonly PM[] s_AFtoPM = CreateAFtoPMConversionMatrix();    // AceFlags-to-Propagation conversion matrix
@@ -638,7 +626,7 @@ nameof(binaryForm));
         {
             var afToPm = new PM[16];
 
-            for ( int i = 0; i < afToPm.Length; i++ )
+            for (int i = 0; i < afToPm.Length; i++)
             {
                 afToPm[i] = PM.Invalid;
             }
@@ -649,19 +637,19 @@ nameof(binaryForm));
             // Important: Not all combinations of inheritance bits are valid
             //
 
-            afToPm[( int )(   0   |   0   |   0   |   0   )] = PM.F |   0   |   0   |   0   |     0;
-            afToPm[( int )(   0   | AF.OI |   0   |   0   )] = PM.F |   0   | PM.CO |   0   | PM.GO;
-            afToPm[( int )(   0   | AF.OI |   0   | AF.NP )] = PM.F |   0   | PM.CO |   0   |     0;
-            afToPm[( int )(   0   | AF.OI | AF.IO |   0   )] =   0  |   0   | PM.CO |   0   | PM.GO;
-            afToPm[( int )(   0   | AF.OI | AF.IO | AF.NP )] =   0  |   0   | PM.CO |   0   |     0;
-            afToPm[( int )( AF.CI |   0   |   0   |   0   )] = PM.F | PM.CF |   0   | PM.GF |     0;
-            afToPm[( int )( AF.CI |   0   |   0   | AF.NP )] = PM.F | PM.CF |   0   |   0   |     0;
-            afToPm[( int )( AF.CI |   0   | AF.IO |   0   )] =   0  | PM.CF |   0   | PM.GF |     0;
-            afToPm[( int )( AF.CI |   0   | AF.IO | AF.NP )] =   0  | PM.CF |   0   |   0   |     0;
-            afToPm[( int )( AF.CI | AF.OI |   0   |   0   )] = PM.F | PM.CF | PM.CO | PM.GF | PM.GO;
-            afToPm[( int )( AF.CI | AF.OI |   0   | AF.NP )] = PM.F | PM.CF | PM.CO |   0   |     0;
-            afToPm[( int )( AF.CI | AF.OI | AF.IO |   0   )] =   0  | PM.CF | PM.CO | PM.GF | PM.GO;
-            afToPm[( int )( AF.CI | AF.OI | AF.IO | AF.NP )] =   0  | PM.CF | PM.CO |   0   |     0;
+            afToPm[(int)(   0   |   0   |   0   |   0   )] = PM.F |   0   |   0   |   0   |     0;
+            afToPm[(int)(   0   | AF.OI |   0   |   0   )] = PM.F |   0   | PM.CO |   0   | PM.GO;
+            afToPm[(int)(   0   | AF.OI |   0   | AF.NP )] = PM.F |   0   | PM.CO |   0   |     0;
+            afToPm[(int)(   0   | AF.OI | AF.IO |   0   )] =   0  |   0   | PM.CO |   0   | PM.GO;
+            afToPm[(int)(   0   | AF.OI | AF.IO | AF.NP )] =   0  |   0   | PM.CO |   0   |     0;
+            afToPm[(int)( AF.CI |   0   |   0   |   0   )] = PM.F | PM.CF |   0   | PM.GF |     0;
+            afToPm[(int)( AF.CI |   0   |   0   | AF.NP )] = PM.F | PM.CF |   0   |   0   |     0;
+            afToPm[(int)( AF.CI |   0   | AF.IO |   0   )] =   0  | PM.CF |   0   | PM.GF |     0;
+            afToPm[(int)( AF.CI |   0   | AF.IO | AF.NP )] =   0  | PM.CF |   0   |   0   |     0;
+            afToPm[(int)( AF.CI | AF.OI |   0   |   0   )] = PM.F | PM.CF | PM.CO | PM.GF | PM.GO;
+            afToPm[(int)( AF.CI | AF.OI |   0   | AF.NP )] = PM.F | PM.CF | PM.CO |   0   |     0;
+            afToPm[(int)( AF.CI | AF.OI | AF.IO |   0   )] =   0  | PM.CF | PM.CO | PM.GF | PM.GO;
+            afToPm[(int)( AF.CI | AF.OI | AF.IO | AF.NP )] =   0  | PM.CF | PM.CO |   0   |     0;
 
             return afToPm;
         }
@@ -670,7 +658,7 @@ nameof(binaryForm));
         {
             var pmToAf = new AF[32];
 
-            for ( int i = 0; i < pmToAf.Length; i++ )
+            for (int i = 0; i < pmToAf.Length; i++)
             {
                 pmToAf[i] = AF.Invalid;
             }
@@ -682,19 +670,19 @@ nameof(binaryForm));
             // the four ACE inheritance bits
             //
 
-            pmToAf[( int )( PM.F |   0   |   0   |   0   |   0   )] =    0   |   0   |   0   |     0;
-            pmToAf[( int )( PM.F |   0   | PM.CO |   0   | PM.GO )] =    0   | AF.OI |   0   |     0;
-            pmToAf[( int )( PM.F |   0   | PM.CO |   0   |   0   )] =    0   | AF.OI |   0   | AF.NP;
-            pmToAf[( int )(   0  |   0   | PM.CO |   0   | PM.GO )] =    0   | AF.OI | AF.IO |     0;
-            pmToAf[( int )(   0  |   0   | PM.CO |   0   |   0   )] =    0   | AF.OI | AF.IO | AF.NP;
-            pmToAf[( int )( PM.F | PM.CF |   0   | PM.GF |   0   )] =  AF.CI |   0   |   0   |     0;
-            pmToAf[( int )( PM.F | PM.CF |   0   |   0   |   0   )] =  AF.CI |   0   |   0   | AF.NP;
-            pmToAf[( int )(   0  | PM.CF |   0   | PM.GF |   0   )] =  AF.CI |   0   | AF.IO |     0;
-            pmToAf[( int )(   0  | PM.CF |   0   |   0   |   0   )] =  AF.CI |   0   | AF.IO | AF.NP;
-            pmToAf[( int )( PM.F | PM.CF | PM.CO | PM.GF | PM.GO )] =  AF.CI | AF.OI |   0   |     0;
-            pmToAf[( int )( PM.F | PM.CF | PM.CO |   0   |   0   )] =  AF.CI | AF.OI |   0   | AF.NP;
-            pmToAf[( int )(   0  | PM.CF | PM.CO | PM.GF | PM.GO )] =  AF.CI | AF.OI | AF.IO |     0;
-            pmToAf[( int )(   0  | PM.CF | PM.CO |   0   |   0   )] =  AF.CI | AF.OI | AF.IO | AF.NP;
+            pmToAf[(int)( PM.F |   0   |   0   |   0   |   0   )] =    0   |   0   |   0   |     0;
+            pmToAf[(int)( PM.F |   0   | PM.CO |   0   | PM.GO )] =    0   | AF.OI |   0   |     0;
+            pmToAf[(int)( PM.F |   0   | PM.CO |   0   |   0   )] =    0   | AF.OI |   0   | AF.NP;
+            pmToAf[(int)(   0  |   0   | PM.CO |   0   | PM.GO )] =    0   | AF.OI | AF.IO |     0;
+            pmToAf[(int)(   0  |   0   | PM.CO |   0   |   0   )] =    0   | AF.OI | AF.IO | AF.NP;
+            pmToAf[(int)( PM.F | PM.CF |   0   | PM.GF |   0   )] =  AF.CI |   0   |   0   |     0;
+            pmToAf[(int)( PM.F | PM.CF |   0   |   0   |   0   )] =  AF.CI |   0   |   0   | AF.NP;
+            pmToAf[(int)(   0  | PM.CF |   0   | PM.GF |   0   )] =  AF.CI |   0   | AF.IO |     0;
+            pmToAf[(int)(   0  | PM.CF |   0   |   0   |   0   )] =  AF.CI |   0   | AF.IO | AF.NP;
+            pmToAf[(int)( PM.F | PM.CF | PM.CO | PM.GF | PM.GO )] =  AF.CI | AF.OI |   0   |     0;
+            pmToAf[(int)( PM.F | PM.CF | PM.CO |   0   |   0   )] =  AF.CI | AF.OI |   0   | AF.NP;
+            pmToAf[(int)(   0  | PM.CF | PM.CO | PM.GF | PM.GO )] =  AF.CI | AF.OI | AF.IO |     0;
+            pmToAf[(int)(   0  | PM.CF | PM.CO |   0   |   0   )] =  AF.CI | AF.OI | AF.IO | AF.NP;
 
             return pmToAf;
         }
@@ -703,11 +691,11 @@ nameof(binaryForm));
         // Canonicalizes AceFlags into a form that the mapping tables understand
         //
 
-        private static AF AFFromAceFlags( AceFlags aceFlags, bool isDS )
+        private static AF AFFromAceFlags(AceFlags aceFlags, bool isDS)
         {
             AF af = 0;
 
-            if (( aceFlags & AceFlags.ContainerInherit ) != 0)
+            if ((aceFlags & AceFlags.ContainerInherit) != 0)
             {
                 af |= AF.CI;
             }
@@ -716,17 +704,17 @@ nameof(binaryForm));
             // ObjectInherit applies only to regular aces not object aces
             // so it can be ignored in the object aces case
             //
-            if (( !isDS ) && (( aceFlags & AceFlags.ObjectInherit ) != 0 ))
+            if ((!isDS) && ((aceFlags & AceFlags.ObjectInherit) != 0))
             {
                 af |= AF.OI;
             }
 
-            if (( aceFlags & AceFlags.InheritOnly ) != 0 )
+            if ((aceFlags & AceFlags.InheritOnly) != 0)
             {
                 af |= AF.IO;
             }
 
-            if (( aceFlags & AceFlags.NoPropagateInherit ) != 0 )
+            if ((aceFlags & AceFlags.NoPropagateInherit) != 0)
             {
                 af |= AF.NP;
             }
@@ -738,11 +726,11 @@ nameof(binaryForm));
         // Converts lookup table representation of AceFlags into the "public" form
         //
 
-        private static AceFlags AceFlagsFromAF( AF af, bool isDS )
+        private static AceFlags AceFlagsFromAF(AF af, bool isDS)
         {
             AceFlags aceFlags = 0;
 
-            if (( af & AF.CI ) != 0 )
+            if ((af & AF.CI) != 0)
             {
                 aceFlags |= AceFlags.ContainerInherit;
             }
@@ -751,17 +739,17 @@ nameof(binaryForm));
             // ObjectInherit applies only to regular aces not object aces
             // so it can be ignored in the object aces case
             //
-            if (( !isDS ) && (( af & AF.OI ) != 0 ))
+            if ((!isDS) && ((af & AF.OI) != 0))
             {
                 aceFlags |= AceFlags.ObjectInherit;
             }
 
-            if (( af & AF.IO ) != 0 )
+            if ((af & AF.IO) != 0)
             {
                 aceFlags |= AceFlags.InheritOnly;
             }
 
-            if (( af & AF.NP ) != 0 )
+            if ((af & AF.NP) != 0)
             {
                 aceFlags |= AceFlags.NoPropagateInherit;
             }
@@ -773,47 +761,47 @@ nameof(binaryForm));
         // Implements the merge of inheritance bits during the 'ADD' operation
         //
 
-        private static bool MergeInheritanceBits( AceFlags left, AceFlags right, bool isDS, out AceFlags result )
+        private static bool MergeInheritanceBits(AceFlags left, AceFlags right, bool isDS, out AceFlags result)
         {
             result = 0;
 
-            AF leftAF = AFFromAceFlags( left, isDS );
-            AF rightAF = AFFromAceFlags( right, isDS );
+            AF leftAF = AFFromAceFlags(left, isDS);
+            AF rightAF = AFFromAceFlags(right, isDS);
 
             PM leftPM = s_AFtoPM[(int)leftAF];
             PM rightPM = s_AFtoPM[(int)rightAF];
 
-            if ( leftPM == PM.Invalid || rightPM == PM.Invalid )
+            if (leftPM == PM.Invalid || rightPM == PM.Invalid)
             {
                 return false; // incorrect ACE flags?
             }
 
             PM resultPM = leftPM | rightPM;
-            AF resultAF = s_PMtoAF[( int )resultPM];
+            AF resultAF = s_PMtoAF[(int)resultPM];
 
-            if ( resultAF == AF.Invalid )
+            if (resultAF == AF.Invalid)
             {
                 return false;
             }
             else
             {
-                result = AceFlagsFromAF( resultAF, isDS );
+                result = AceFlagsFromAF(resultAF, isDS);
                 return true;
             }
         }
 
-        private static bool RemoveInheritanceBits( AceFlags existing, AceFlags remove, bool isDS, out AceFlags result, out bool total )
+        private static bool RemoveInheritanceBits(AceFlags existing, AceFlags remove, bool isDS, out AceFlags result, out bool total)
         {
             result = 0;
             total = false;
 
-            AF leftAF = AFFromAceFlags( existing, isDS );
-            AF rightAF = AFFromAceFlags( remove, isDS );
+            AF leftAF = AFFromAceFlags(existing, isDS);
+            AF rightAF = AFFromAceFlags(remove, isDS);
 
-            PM leftPM = s_AFtoPM[( int )leftAF];
-            PM rightPM = s_AFtoPM[( int )rightAF];
+            PM leftPM = s_AFtoPM[(int)leftAF];
+            PM rightPM = s_AFtoPM[(int)rightAF];
 
-            if ( leftPM == PM.Invalid || rightPM == PM.Invalid )
+            if (leftPM == PM.Invalid || rightPM == PM.Invalid)
             {
                 return false; // incorrect ACE flags?
             }
@@ -826,21 +814,21 @@ nameof(binaryForm));
             // communicate back the fact that removal is "total"
             //
 
-            if ( resultPM == 0 )
+            if (resultPM == 0)
             {
                 total = true;
                 return true;
             }
 
-            AF resultAF = s_PMtoAF[( int )resultPM];
+            AF resultAF = s_PMtoAF[(int)resultPM];
 
-            if ( resultAF == AF.Invalid )
+            if (resultAF == AF.Invalid)
             {
                 return false;
             }
             else
             {
-                result = AceFlagsFromAF( resultAF, isDS );
+                result = AceFlagsFromAF(resultAF, isDS);
                 return true;
             }
         }
@@ -866,9 +854,9 @@ nameof(binaryForm));
 
         private void CanonicalizeIfNecessary()
         {
-            if ( _isDirty )
+            if (_isDirty)
             {
-                Canonicalize( false, this is DiscretionaryAcl );
+                Canonicalize(false, this is DiscretionaryAcl);
                 _isDirty = false;
             }
         }
@@ -895,12 +883,12 @@ nameof(binaryForm));
         //        - user-defined ACEs (in the original order )
         //
 
-        private static int DaclAcePriority( GenericAce ace)
+        private static int DaclAcePriority(GenericAce ace)
         {
             int result;
             AceType type = ace.AceType;
 
-            if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
+            if ((ace.AceFlags & AceFlags.Inherited) != 0)
             {
                 //
                 // inherited aces are at the end as a group
@@ -908,23 +896,23 @@ nameof(binaryForm));
 
                 result = 2 * ushort.MaxValue + ace._indexInAcl;
             }
-            else if ( type == AceType.AccessDenied ||
-                type == AceType.AccessDeniedCallback )
+            else if (type == AceType.AccessDenied ||
+                type == AceType.AccessDeniedCallback)
             {
                 result = 0;
             }
-            else if ( type == AceType.AccessDeniedObject ||
-                type == AceType.AccessDeniedCallbackObject )
+            else if (type == AceType.AccessDeniedObject ||
+                type == AceType.AccessDeniedCallbackObject)
             {
                 result = 1;
             }
-            else if ( type == AceType.AccessAllowed ||
-                type == AceType.AccessAllowedCallback )
+            else if (type == AceType.AccessAllowed ||
+                type == AceType.AccessAllowedCallback)
             {
                 result = 2;
             }
-            else if ( type == AceType.AccessAllowedObject ||
-                type == AceType.AccessAllowedCallbackObject )
+            else if (type == AceType.AccessAllowedObject ||
+                type == AceType.AccessAllowedCallbackObject)
             {
                 result = 3;
             }
@@ -952,26 +940,26 @@ nameof(binaryForm));
         //        - user-defined ACEs (in the original order )
         //
 
-        private static int SaclAcePriority( GenericAce ace )
+        private static int SaclAcePriority(GenericAce ace)
         {
             int result;
             AceType type = ace.AceType;
 
-            if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
+            if ((ace.AceFlags & AceFlags.Inherited) != 0)
             {
                 result = 2 * ushort.MaxValue + ace._indexInAcl;
             }
-            else if ( type == AceType.SystemAudit ||
+            else if (type == AceType.SystemAudit ||
                 type == AceType.SystemAlarm ||
                 type == AceType.SystemAuditCallback ||
-                type == AceType.SystemAlarmCallback )
+                type == AceType.SystemAlarmCallback)
             {
                 result = 0;
             }
-            else if ( type == AceType.SystemAuditObject ||
+            else if (type == AceType.SystemAuditObject ||
                 type == AceType.SystemAlarmObject ||
                 type == AceType.SystemAuditCallbackObject ||
-                type == AceType.SystemAlarmCallbackObject )
+                type == AceType.SystemAlarmCallbackObject)
             {
                 result = 1;
             }
@@ -983,16 +971,16 @@ nameof(binaryForm));
             return result;
         }
 
-        private static ComparisonResult CompareAces( GenericAce ace1, GenericAce ace2, bool isDacl )
+        private static ComparisonResult CompareAces(GenericAce ace1, GenericAce ace2, bool isDacl)
         {
-            int ace1Priority = isDacl ? DaclAcePriority( ace1 ) : SaclAcePriority( ace1 );
-            int ace2Priority = isDacl ? DaclAcePriority( ace2 ) : SaclAcePriority( ace2 );
+            int ace1Priority = isDacl ? DaclAcePriority(ace1) : SaclAcePriority(ace1);
+            int ace2Priority = isDacl ? DaclAcePriority(ace2) : SaclAcePriority(ace2);
 
-            if ( ace1Priority < ace2Priority )
+            if (ace1Priority < ace2Priority)
             {
                 return ComparisonResult.LessThan;
             }
-            else if ( ace1Priority > ace2Priority )
+            else if (ace1Priority > ace2Priority)
             {
                 return ComparisonResult.GreaterThan;
             }
@@ -1001,15 +989,15 @@ nameof(binaryForm));
                 KnownAce k_ace1 = ace1 as KnownAce;
                 KnownAce k_ace2 = ace2 as KnownAce;
 
-                if ( k_ace1 != null && k_ace2 != null )
+                if (k_ace1 != null && k_ace2 != null)
                 {
-                    int result = k_ace1.SecurityIdentifier.CompareTo( k_ace2.SecurityIdentifier );
+                    int result = k_ace1.SecurityIdentifier.CompareTo(k_ace2.SecurityIdentifier);
 
-                    if ( result < 0 )
+                    if (result < 0)
                     {
                         return ComparisonResult.LessThan;
                     }
-                    else if ( result > 0 )
+                    else if (result > 0)
                     {
                         return ComparisonResult.GreaterThan;
                     }
@@ -1019,13 +1007,13 @@ nameof(binaryForm));
             }
         }
 
-        private void QuickSort( int left, int right, bool isDacl )
+        private void QuickSort(int left, int right, bool isDacl)
         {
             GenericAce pivot;
             int leftHold, rightHold;
             int pivotIndex;
 
-            if ( left >= right )
+            if (left >= right)
             {
                 return;
             }
@@ -1036,27 +1024,27 @@ nameof(binaryForm));
             pivot = _acl[left];
             pivotIndex = left;
 
-            while ( left < right )
+            while (left < right)
             {
-//              while (( _acl[right] >= pivot ) && ( left < right ))
-                while (( ComparisonResult.LessThan != CompareAces( _acl[right], pivot, isDacl ) ) && ( left < right ))
+                // while (( _acl[right] >= pivot ) && ( left < right ))
+                while ((ComparisonResult.LessThan != CompareAces(_acl[right], pivot, isDacl)) && (left < right))
                 {
                     right--;
                 }
 
-                if ( left != right )
+                if (left != right)
                 {
                     _acl[left] = _acl[right];
                     left++;
                 }
 
-//              while (( _acl[left] <= pivot ) && ( left < right ))
-                while (( ComparisonResult.GreaterThan != CompareAces( _acl[left], pivot, isDacl ) ) && ( left < right ))
+                // while (( _acl[left] <= pivot ) && ( left < right ))
+                while ((ComparisonResult.GreaterThan != CompareAces(_acl[left], pivot, isDacl)) && (left < right))
                 {
                     left++;
                 }
 
-                if ( left != right )
+                if (left != right)
                 {
                     _acl[right] = _acl[left];
                     right--;
@@ -1068,14 +1056,14 @@ nameof(binaryForm));
             left = leftHold;
             right = rightHold;
 
-            if ( left < pivotIndex )
+            if (left < pivotIndex)
             {
-                QuickSort( left, pivotIndex - 1, isDacl );
+                QuickSort(left, pivotIndex - 1, isDacl);
             }
 
-            if ( right > pivotIndex )
+            if (right > pivotIndex)
             {
-                QuickSort( pivotIndex + 1, right, isDacl );
+                QuickSort(pivotIndex + 1, right, isDacl);
             }
         }
 
@@ -1085,7 +1073,7 @@ nameof(binaryForm));
         // Returns 'true' if the ACE should remain in the ACL, 'false' otherwise
         //
 
-        private bool InspectAce( ref GenericAce ace, bool isDacl )
+        private bool InspectAce(ref GenericAce ace, bool isDacl)
         {
             const AceFlags AuditFlags =
                 AceFlags.SuccessfulAccess |
@@ -1103,15 +1091,15 @@ nameof(binaryForm));
 
             KnownAce knownAce = ace as KnownAce;
 
-            if ( knownAce != null )
+            if (knownAce != null)
             {
-                if ( knownAce.AccessMask == 0 )
+                if (knownAce.AccessMask == 0)
                 {
                     return false;
                 }
             }
 
-            if ( !IsContainer )
+            if (!IsContainer)
             {
                 //
                 // On a leaf object ACL, inheritance bits are meaningless.
@@ -1122,12 +1110,12 @@ nameof(binaryForm));
                 // no meaning.
                 //
 
-                if (( ace.AceFlags & AceFlags.InheritOnly ) != 0 )
+                if ((ace.AceFlags & AceFlags.InheritOnly) != 0)
                 {
                     return false;
                 }
 
-                if (( ace.AceFlags & InheritFlags ) != 0 )
+                if ((ace.AceFlags & InheritFlags) != 0)
                 {
                     unchecked { ace.AceFlags &= ~InheritFlags; }
                 }
@@ -1139,9 +1127,9 @@ nameof(binaryForm));
                 // the InheritOnly bit is meaningless and the entire ACE can be removed.
                 //
 
-                if ((( ace.AceFlags & AceFlags.InheritOnly ) != 0 ) &&
-                    (( ace.AceFlags & AceFlags.ContainerInherit ) == 0 ) &&
-                    (( ace.AceFlags & AceFlags.ObjectInherit ) == 0 ))
+                if (((ace.AceFlags & AceFlags.InheritOnly) != 0) &&
+                    ((ace.AceFlags & AceFlags.ContainerInherit) == 0) &&
+                    ((ace.AceFlags & AceFlags.ObjectInherit) == 0))
                 {
                     return false;
                 }
@@ -1150,9 +1138,9 @@ nameof(binaryForm));
                 // Without either "container inherit" or "object inherit" to go with it,
                 // the NoPropagateInherit bit is meaningless and can be turned off.
                 //
-                if ((( ace.AceFlags & AceFlags.NoPropagateInherit ) != 0 ) &&
-                    (( ace.AceFlags & AceFlags.ContainerInherit ) == 0 ) &&
-                    (( ace.AceFlags & AceFlags.ObjectInherit ) == 0 ))
+                if (((ace.AceFlags & AceFlags.NoPropagateInherit) != 0) &&
+                    ((ace.AceFlags & AceFlags.ContainerInherit) == 0) &&
+                    ((ace.AceFlags & AceFlags.ObjectInherit) == 0))
                 {
                     unchecked { ace.AceFlags &= ~AceFlags.NoPropagateInherit; }
                 }
@@ -1160,7 +1148,7 @@ nameof(binaryForm));
 
             QualifiedAce qualifiedAce = knownAce as QualifiedAce;
 
-            if ( isDacl )
+            if (isDacl)
             {
                 //
                 // There is no place for audit flags on a DACL
@@ -1168,14 +1156,14 @@ nameof(binaryForm));
 
                 unchecked { ace.AceFlags &= ~AuditFlags; }
 
-                if ( qualifiedAce != null )
+                if (qualifiedAce != null)
                 {
                     //
                     // Qualified ACEs in a DACL must be allow or deny ACEs
                     //
 
-                    if ( qualifiedAce.AceQualifier != AceQualifier.AccessAllowed &&
-                        qualifiedAce.AceQualifier != AceQualifier.AccessDenied )
+                    if (qualifiedAce.AceQualifier != AceQualifier.AccessAllowed &&
+                        qualifiedAce.AceQualifier != AceQualifier.AccessDenied)
                     {
                         return false;
                     }
@@ -1188,7 +1176,7 @@ nameof(binaryForm));
                 // flags can be removed
                 //
 
-                if (( ace.AceFlags & AuditFlags ) == 0 )
+                if ((ace.AceFlags & AuditFlags) == 0)
                 {
                     return false;
                 }
@@ -1197,9 +1185,9 @@ nameof(binaryForm));
                 // Qualified ACEs in a SACL must be audit ACEs
                 //
 
-                if ( qualifiedAce != null )
+                if (qualifiedAce != null)
                 {
-                    if ( qualifiedAce.AceQualifier != AceQualifier.SystemAudit )
+                    if (qualifiedAce.AceQualifier != AceQualifier.SystemAudit)
                     {
                         return false;
                     }
@@ -1212,20 +1200,20 @@ nameof(binaryForm));
         // Strips meaningless flags from ACEs, removes meaningless ACEs
         //
 
-        private void RemoveMeaninglessAcesAndFlags( bool isDacl )
+        private void RemoveMeaninglessAcesAndFlags(bool isDacl)
         {
             //
             // Be warned: do NOT use the Count property because it has
             // side-effect of calling canonicalization.
             //
 
-            for ( int i = _acl.Count - 1; i >= 0; i-- )
+            for (int i = _acl.Count - 1; i >= 0; i--)
             {
                 GenericAce ace = _acl[i];
 
-                if ( false == InspectAce( ref ace, isDacl ))
+                if (false == InspectAce(ref ace, isDacl))
                 {
-                    _acl.RemoveAce( i );
+                    _acl.RemoveAce(i);
                 }
             }
         }
@@ -1234,7 +1222,7 @@ nameof(binaryForm));
         // Converts the ACL to its canonical form
         //
 
-        private void Canonicalize( bool compact, bool isDacl )
+        private void Canonicalize(bool compact, bool isDacl)
         {
             //
             // for quick sort to work, we must not allow the ace's indexes - which are constantly
@@ -1248,27 +1236,27 @@ nameof(binaryForm));
                 _acl[aclIndex]._indexInAcl = aclIndex;
             }
 
-            QuickSort( 0, _acl.Count - 1, isDacl );
+            QuickSort(0, _acl.Count - 1, isDacl);
 
-            if ( compact )
+            if (compact)
             {
-                for ( int i = 0; i < Count - 1; i++ )
+                for (int i = 0; i < Count - 1; i++)
                 {
                     QualifiedAce thisAce = _acl[i] as QualifiedAce;
 
-                    if ( thisAce == null )
+                    if (thisAce == null)
                     {
                         continue;
                     }
 
                     QualifiedAce nextAce = _acl[i + 1] as QualifiedAce;
 
-                    if ( nextAce == null )
+                    if (nextAce == null)
                     {
                         continue;
                     }
 
-                    if ( true == MergeAces( ref thisAce, nextAce ))
+                    if (true == MergeAces(ref thisAce, nextAce))
                     {
                         _acl.RemoveAce(i + 1);
                     }
@@ -1280,7 +1268,7 @@ nameof(binaryForm));
         // This method determines whether the object type and inherited object type from the original ace
         // should be retained or not based on access mask and aceflags for a given split
         //
-        private void GetObjectTypesForSplit( ObjectAce originalAce, int accessMask, AceFlags aceFlags, out ObjectAceFlags objectFlags, out Guid objectType, out Guid inheritedObjectType )
+        private void GetObjectTypesForSplit(ObjectAce originalAce, int accessMask, AceFlags aceFlags, out ObjectAceFlags objectFlags, out Guid objectType, out Guid inheritedObjectType)
         {
 
             objectFlags = 0;
@@ -1290,7 +1278,7 @@ nameof(binaryForm));
             //
             // We should retain the object type if the access mask for this split contains any bits that refer to object type
             //
-            if (( accessMask & ObjectAce.AccessMaskWithObjectType ) != 0 )
+            if ((accessMask & ObjectAce.AccessMaskWithObjectType) != 0)
             {
                 // keep the original ace's object flags and object type
                 objectType = originalAce.ObjectAceType;
@@ -1300,7 +1288,7 @@ nameof(binaryForm));
             //
             // We should retain the inherited object type if the aceflags for this contains inheritance (ContainerInherit)
             //
-            if (( aceFlags & AceFlags.ContainerInherit ) != 0 )
+            if ((aceFlags & AceFlags.ContainerInherit) != 0)
             {
                 // keep the original ace's object flags and object type
                 inheritedObjectType = originalAce.InheritedObjectAceType;
@@ -1308,23 +1296,23 @@ nameof(binaryForm));
             }
         }
 
-        private bool ObjectTypesMatch( QualifiedAce ace, QualifiedAce newAce )
+        private bool ObjectTypesMatch(QualifiedAce ace, QualifiedAce newAce)
         {
-            Guid objectType = ( ace is ObjectAce ) ? (( ObjectAce ) ace ).ObjectAceType : Guid.Empty;
-            Guid newObjectType = ( newAce is ObjectAce ) ? (( ObjectAce ) newAce ).ObjectAceType : Guid.Empty;
+            Guid objectType = (ace is ObjectAce) ? ((ObjectAce)ace).ObjectAceType : Guid.Empty;
+            Guid newObjectType = (newAce is ObjectAce) ? ((ObjectAce)newAce).ObjectAceType : Guid.Empty;
 
-            return objectType.Equals( newObjectType );
+            return objectType.Equals(newObjectType);
         }
 
-        private bool InheritedObjectTypesMatch( QualifiedAce ace, QualifiedAce newAce )
+        private bool InheritedObjectTypesMatch(QualifiedAce ace, QualifiedAce newAce)
         {
-            Guid inheritedObjectType = ( ace is ObjectAce ) ? (( ObjectAce ) ace ).InheritedObjectAceType : Guid.Empty;
-            Guid newInheritedObjectType = ( newAce is ObjectAce ) ? (( ObjectAce ) newAce ).InheritedObjectAceType : Guid.Empty;
+            Guid inheritedObjectType = (ace is ObjectAce) ? ((ObjectAce)ace).InheritedObjectAceType : Guid.Empty;
+            Guid newInheritedObjectType = (newAce is ObjectAce) ? ((ObjectAce)newAce).InheritedObjectAceType : Guid.Empty;
 
-            return inheritedObjectType.Equals( newInheritedObjectType );
+            return inheritedObjectType.Equals(newInheritedObjectType);
         }
 
-        private bool AccessMasksAreMergeable( QualifiedAce ace, QualifiedAce newAce )
+        private bool AccessMasksAreMergeable(QualifiedAce ace, QualifiedAce newAce)
         {
             //
             // The access masks are mergeable in any of the following conditions
@@ -1333,15 +1321,15 @@ nameof(binaryForm));
             //     already contains all the bits of the new ace which refer to the object type
             //
 
-            if ( ObjectTypesMatch( ace, newAce ))
+            if (ObjectTypesMatch(ace, newAce))
             {
                 // case 1
                 return true;
             }
 
-            ObjectAceFlags objectFlags = ( ace is ObjectAce ) ? (( ObjectAce ) ace ).ObjectAceFlags : ObjectAceFlags.None;
-            if ((( ace.AccessMask & newAce.AccessMask & ObjectAce.AccessMaskWithObjectType ) ==  ( newAce.AccessMask & ObjectAce.AccessMaskWithObjectType )) &&
-                 (( objectFlags & ObjectAceFlags.ObjectAceTypePresent ) == 0 ))
+            ObjectAceFlags objectFlags = (ace is ObjectAce) ? ((ObjectAce)ace).ObjectAceFlags : ObjectAceFlags.None;
+            if (((ace.AccessMask & newAce.AccessMask & ObjectAce.AccessMaskWithObjectType) == (newAce.AccessMask & ObjectAce.AccessMaskWithObjectType)) &&
+                 ((objectFlags & ObjectAceFlags.ObjectAceTypePresent) == 0))
             {
                 // case 2
                 return true;
@@ -1350,7 +1338,7 @@ nameof(binaryForm));
             return false;
         }
 
-        private bool AceFlagsAreMergeable( QualifiedAce ace, QualifiedAce newAce )
+        private bool AceFlagsAreMergeable(QualifiedAce ace, QualifiedAce newAce)
         {
             //
             // The ace flags can be considered for merge in any of the following conditions
@@ -1359,14 +1347,14 @@ nameof(binaryForm));
             //     already contains all the bits of the new ace
             //
 
-            if ( InheritedObjectTypesMatch( ace, newAce ))
+            if (InheritedObjectTypesMatch(ace, newAce))
             {
                 // case 1
                 return true;
             }
 
-            ObjectAceFlags objectFlags = ( ace is ObjectAce ) ? (( ObjectAce ) ace ).ObjectAceFlags : ObjectAceFlags.None;
-            if (( objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent ) == 0 )
+            ObjectAceFlags objectFlags = (ace is ObjectAce) ? ((ObjectAce)ace).ObjectAceFlags : ObjectAceFlags.None;
+            if ((objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent) == 0)
             {
                 // case 2
 
@@ -1374,16 +1362,16 @@ nameof(binaryForm));
                 // This method is called only when the access masks of the two aces are already confirmed to be exact matches
                 // therefore the second condition of case 2 is already verified
                 //
-                Debug.Assert(( ace.AccessMask & newAce.AccessMask) ==  newAce.AccessMask, "AceFlagsAreMergeable:: AccessMask of existing ace does not contain all access bits of new ace.");
+                Debug.Assert((ace.AccessMask & newAce.AccessMask) == newAce.AccessMask, "AceFlagsAreMergeable:: AccessMask of existing ace does not contain all access bits of new ace.");
                 return true;
             }
 
             return false;
         }
 
-        private bool GetAccessMaskForRemoval( QualifiedAce ace, ObjectAceFlags objectFlags, Guid objectType, ref int accessMask )
+        private bool GetAccessMaskForRemoval(QualifiedAce ace, ObjectAceFlags objectFlags, Guid objectType, ref int accessMask)
         {
-            if (( ace.AccessMask & accessMask & ObjectAce.AccessMaskWithObjectType ) != 0 )
+            if ((ace.AccessMask & accessMask & ObjectAce.AccessMaskWithObjectType) != 0)
             {
 
                 //
@@ -1399,7 +1387,7 @@ nameof(binaryForm));
                 //
 
 
-                if ( ace is ObjectAce )
+                if (ace is ObjectAce)
                 {
                     bool commonAccessBitsWithObjectTypeExist = true;
                     ObjectAce objectAce = ace as ObjectAce;
@@ -1408,8 +1396,8 @@ nameof(binaryForm));
                     // if what we are trying to remove has an object type
                     // but the existing ace does not then this is an invalid case
                     //
-                    if ((( objectFlags & ObjectAceFlags.ObjectAceTypePresent ) != 0 ) &&
-                        (( objectAce.ObjectAceFlags & ObjectAceFlags.ObjectAceTypePresent ) == 0 ))
+                    if (((objectFlags & ObjectAceFlags.ObjectAceTypePresent) != 0) &&
+                        ((objectAce.ObjectAceFlags & ObjectAceFlags.ObjectAceTypePresent) == 0))
                     {
                         return false;
                     }
@@ -1419,14 +1407,14 @@ nameof(binaryForm));
                     // if object types match (since at this point we have ensured that both have object types present)
                     // then we have common access bits with object type
                     //
-                    commonAccessBitsWithObjectTypeExist = (( objectFlags & ObjectAceFlags.ObjectAceTypePresent ) == 0 ) ||
-                                                                                    objectAce.ObjectTypesMatch( objectFlags, objectType );
-                    if ( !commonAccessBitsWithObjectTypeExist )
+                    commonAccessBitsWithObjectTypeExist = ((objectFlags & ObjectAceFlags.ObjectAceTypePresent) == 0) ||
+                                                                                    objectAce.ObjectTypesMatch(objectFlags, objectType);
+                    if (!commonAccessBitsWithObjectTypeExist)
                     {
                         accessMask &= ~ObjectAce.AccessMaskWithObjectType;
                     }
                 }
-                else if (( objectFlags & ObjectAceFlags.ObjectAceTypePresent ) != 0 )
+                else if ((objectFlags & ObjectAceFlags.ObjectAceTypePresent) != 0)
                 {
                     // the existing ace is a common ace and the one we're removing
                     // refers to a specific object type so this is invalid
@@ -1438,9 +1426,9 @@ nameof(binaryForm));
 
         }
 
-        private bool GetInheritanceFlagsForRemoval( QualifiedAce ace, ObjectAceFlags objectFlags, Guid inheritedObjectType, ref AceFlags aceFlags )
+        private bool GetInheritanceFlagsForRemoval(QualifiedAce ace, ObjectAceFlags objectFlags, Guid inheritedObjectType, ref AceFlags aceFlags)
         {
-            if ((( ace.AceFlags & AceFlags.ContainerInherit ) != 0 )  && (( aceFlags & AceFlags.ContainerInherit ) != 0 ))
+            if (((ace.AceFlags & AceFlags.ContainerInherit) != 0) && ((aceFlags & AceFlags.ContainerInherit) != 0))
             {
 
                 //
@@ -1456,7 +1444,7 @@ nameof(binaryForm));
                 //
 
 
-                if ( ace is ObjectAce )
+                if (ace is ObjectAce)
                 {
                     bool commonInheritanceFlagsExist = true;
                     ObjectAce objectAce = ace as ObjectAce;
@@ -1465,8 +1453,8 @@ nameof(binaryForm));
                     // if what we are trying to remove has an inherited object type
                     // but the existing ace does not then this is an invalid case
                     //
-                    if ((( objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent ) != 0 ) &&
-                        (( objectAce.ObjectAceFlags & ObjectAceFlags.InheritedObjectAceTypePresent ) == 0 ))
+                    if (((objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent) != 0) &&
+                        ((objectAce.ObjectAceFlags & ObjectAceFlags.InheritedObjectAceTypePresent) == 0))
                     {
                         return false;
                     }
@@ -1475,14 +1463,14 @@ nameof(binaryForm));
                     // if what we are trying to remove has no inherited object type or
                     // if inherited object types match then we have common inheritance flags
                     //
-                    commonInheritanceFlagsExist = (( objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent ) == 0 ) ||
-                                                                       objectAce.InheritedObjectTypesMatch( objectFlags, inheritedObjectType );
-                    if ( !commonInheritanceFlagsExist )
+                    commonInheritanceFlagsExist = ((objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent) == 0) ||
+                                                                       objectAce.InheritedObjectTypesMatch(objectFlags, inheritedObjectType);
+                    if (!commonInheritanceFlagsExist)
                     {
                         aceFlags &= ~AceFlags.InheritanceFlags;
                     }
                 }
-                else if (( objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent ) != 0 )
+                else if ((objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent) != 0)
                 {
                     // the existing ace is a common ace and the one we're removing
                     // refers to a specific child type so this is invalid
@@ -1494,24 +1482,24 @@ nameof(binaryForm));
 
         }
 
-        private static bool AceOpaquesMatch( QualifiedAce ace, QualifiedAce newAce )
+        private static bool AceOpaquesMatch(QualifiedAce ace, QualifiedAce newAce)
         {
             byte[] aceOpaque = ace.GetOpaque();
             byte[] newAceOpaque = newAce.GetOpaque();
 
-            if ( aceOpaque == null || newAceOpaque == null )
+            if (aceOpaque == null || newAceOpaque == null)
             {
                 return aceOpaque == newAceOpaque;
             }
 
-            if ( aceOpaque.Length != newAceOpaque.Length )
+            if (aceOpaque.Length != newAceOpaque.Length)
             {
                 return false;
             }
 
-            for ( int i = 0; i < aceOpaque.Length; ++i )
+            for (int i = 0; i < aceOpaque.Length; ++i)
             {
-                if ( aceOpaque[i] != newAceOpaque[i] )
+                if (aceOpaque[i] != newAceOpaque[i])
                 {
                     return false;
                 }
@@ -1520,13 +1508,13 @@ nameof(binaryForm));
             return true;
         }
 
-        private static bool AcesAreMergeable( QualifiedAce ace, QualifiedAce newAce )
+        private static bool AcesAreMergeable(QualifiedAce ace, QualifiedAce newAce)
         {
             //
             // Only interested in ACEs with the specified type
             //
 
-            if ( ace.AceType != newAce.AceType )
+            if (ace.AceType != newAce.AceType)
             {
                 return false;
             }
@@ -1535,12 +1523,12 @@ nameof(binaryForm));
             // Only interested in explicit (non-inherited) ACEs
             //
 
-            if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
+            if ((ace.AceFlags & AceFlags.Inherited) != 0)
             {
                 return false;
             }
 
-            if (( newAce.AceFlags & AceFlags.Inherited ) != 0 )
+            if ((newAce.AceFlags & AceFlags.Inherited) != 0)
             {
                 return false;
             }
@@ -1549,7 +1537,7 @@ nameof(binaryForm));
             // Only interested in ACEs with the specified qualifier
             //
 
-            if ( ace.AceQualifier != newAce.AceQualifier )
+            if (ace.AceQualifier != newAce.AceQualifier)
             {
                 return false;
             }
@@ -1558,7 +1546,7 @@ nameof(binaryForm));
             // Only interested in ACEs with the specified SID
             //
 
-            if ( ace.SecurityIdentifier != newAce.SecurityIdentifier )
+            if (ace.SecurityIdentifier != newAce.SecurityIdentifier)
             {
                 return false;
             }
@@ -1567,7 +1555,7 @@ nameof(binaryForm));
             // Only interested in ACEs with the specified callback data
             //
 
-            if ( !AceOpaquesMatch( ace, newAce ))
+            if (!AceOpaquesMatch(ace, newAce))
             {
                 return false;
             }
@@ -1579,13 +1567,13 @@ nameof(binaryForm));
         // Merge routine for qualified ACEs
         //
 
-        private bool MergeAces( ref QualifiedAce ace, QualifiedAce newAce )
+        private bool MergeAces(ref QualifiedAce ace, QualifiedAce newAce)
         {
             //
             // Check whether the ACEs are potentially mergeable
             //
 
-            if ( !AcesAreMergeable( ace, newAce ))
+            if (!AcesAreMergeable(ace, newAce))
             {
                 return false;
             }
@@ -1596,15 +1584,15 @@ nameof(binaryForm));
             // Stage 1: if flags match, add to the access mask
             //
 
-            if ( ace.AceFlags == newAce.AceFlags )
+            if (ace.AceFlags == newAce.AceFlags)
             {
-                if ( ace is ObjectAce  || newAce is ObjectAce )
+                if (ace is ObjectAce || newAce is ObjectAce)
                 {
                     // for object aces we need to match the inherited object types (for ace flags equality)
-                    if ( InheritedObjectTypesMatch( ace, newAce ))
+                    if (InheritedObjectTypesMatch(ace, newAce))
                     {
                         // also since access mask bits are further qualified by object type, they cannot always be added on
-                        if ( AccessMasksAreMergeable( ace, newAce ))
+                        if (AccessMasksAreMergeable(ace, newAce))
                         {
                             ace.AccessMask |= newAce.AccessMask;
                             return true;
@@ -1625,22 +1613,22 @@ nameof(binaryForm));
             //          flags (both access mask and inheritance) match
             //
 
-            if ((( ace.AceFlags & AceFlags.InheritanceFlags ) == ( newAce.AceFlags & AceFlags.InheritanceFlags )) &&
-                ( ace.AccessMask == newAce.AccessMask ))
+            if (((ace.AceFlags & AceFlags.InheritanceFlags) == (newAce.AceFlags & AceFlags.InheritanceFlags)) &&
+                (ace.AccessMask == newAce.AccessMask))
             {
-                if (( ace is ObjectAce ) || ( newAce is ObjectAce ))
+                if ((ace is ObjectAce) || (newAce is ObjectAce))
                 {
                     // for object aces we need to match the inherited object types (for inheritance flags equality) and object type (for access mask equality) as well
-                    if ( InheritedObjectTypesMatch( ace, newAce ) &&
-                        ( ObjectTypesMatch( ace, newAce )))
+                    if (InheritedObjectTypesMatch(ace, newAce) &&
+                        (ObjectTypesMatch(ace, newAce)))
                     {
-                        ace.AceFlags |= ( newAce.AceFlags & AceFlags.AuditFlags );
+                        ace.AceFlags |= (newAce.AceFlags & AceFlags.AuditFlags);
                         return true;
                     }
                 }
                 else
                 {
-                    ace.AceFlags |= ( newAce.AceFlags & AceFlags.AuditFlags );
+                    ace.AceFlags |= (newAce.AceFlags & AceFlags.AuditFlags);
                     return true;
                 }
 
@@ -1651,8 +1639,8 @@ nameof(binaryForm));
             //          provided access mask and audit bits are the same
             //
 
-            if ((( ace.AceFlags & AceFlags.AuditFlags ) == ( newAce.AceFlags & AceFlags.AuditFlags )) &&
-                ( ace.AccessMask == newAce.AccessMask ))
+            if (((ace.AceFlags & AceFlags.AuditFlags) == (newAce.AceFlags & AceFlags.AuditFlags)) &&
+                (ace.AccessMask == newAce.AccessMask))
             {
                 AceFlags merged;
 
@@ -1660,25 +1648,25 @@ nameof(binaryForm));
                 // See whether the inheritance bits can be merged
                 //
 
-                if (( ace is ObjectAce ) || ( newAce is ObjectAce ))
+                if ((ace is ObjectAce) || (newAce is ObjectAce))
                 {
                     // object types need to match (for access mask equality) and inheritance flags need additional DS specific logic
                     // to check whether they can be merged
-                    if (( ObjectTypesMatch( ace, newAce )) &&
-                         ( AceFlagsAreMergeable( ace, newAce )))
+                    if ((ObjectTypesMatch(ace, newAce)) &&
+                         (AceFlagsAreMergeable(ace, newAce)))
                     {
-                        if ( true == MergeInheritanceBits( ace.AceFlags, newAce.AceFlags, IsDS, out merged ))
+                        if (true == MergeInheritanceBits(ace.AceFlags, newAce.AceFlags, IsDS, out merged))
                         {
-                            ace.AceFlags = ( merged | ( ace.AceFlags & AceFlags.AuditFlags ));
+                            ace.AceFlags = (merged | (ace.AceFlags & AceFlags.AuditFlags));
                             return true;
                         }
                     }
                 }
                 else
                 {
-                    if ( true == MergeInheritanceBits( ace.AceFlags, newAce.AceFlags, IsDS, out merged ))
+                    if (true == MergeInheritanceBits(ace.AceFlags, newAce.AceFlags, IsDS, out merged))
                     {
-                        ace.AceFlags = ( merged | ( ace.AceFlags & AceFlags.AuditFlags ));
+                        ace.AceFlags = (merged | (ace.AceFlags & AceFlags.AuditFlags));
                         return true;
                     }
                 }
@@ -1692,9 +1680,9 @@ nameof(binaryForm));
         // Returns 'true' if the ACL is in canonical order; 'false' otherwise
         //
 
-        private bool CanonicalCheck( bool isDacl )
+        private bool CanonicalCheck(bool isDacl)
         {
-            if ( isDacl )
+            if (isDacl)
             {
                 //
                 // DACL canonical order:
@@ -1713,13 +1701,13 @@ nameof(binaryForm));
                 // of this check!
                 //
 
-                for ( int i = 0; i < _acl.Count; i++ )
+                for (int i = 0; i < _acl.Count; i++)
                 {
                     int aceStage;
 
                     GenericAce ace = _acl[i];
 
-                    if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
+                    if ((ace.AceFlags & AceFlags.Inherited) != 0)
                     {
                         aceStage = Inherited;
                     }
@@ -1727,7 +1715,7 @@ nameof(binaryForm));
                     {
                         QualifiedAce qualifiedAce = ace as QualifiedAce;
 
-                        if ( qualifiedAce == null )
+                        if (qualifiedAce == null)
                         {
                             //
                             // Explicit ACE is not recognized - this is not a canonical ACL
@@ -1736,11 +1724,11 @@ nameof(binaryForm));
                             return false;
                         }
 
-                        if ( qualifiedAce.AceQualifier == AceQualifier.AccessAllowed )
+                        if (qualifiedAce.AceQualifier == AceQualifier.AccessAllowed)
                         {
                             aceStage = AccessAllowed;
                         }
-                        else if ( qualifiedAce.AceQualifier == AceQualifier.AccessDenied )
+                        else if (qualifiedAce.AceQualifier == AceQualifier.AccessDenied)
                         {
                             aceStage = AccessDenied;
                         }
@@ -1750,16 +1738,16 @@ nameof(binaryForm));
                             // Only allow and deny ACEs are allowed here
                             //
 
-                            Debug.Assert( false, "Audit and alarm ACEs must have been stripped by remove-meaningless logic" );
+                            Debug.Assert(false, "Audit and alarm ACEs must have been stripped by remove-meaningless logic");
                             return false;
                         }
                     }
 
-                    if ( aceStage > currentStage )
+                    if (aceStage > currentStage)
                     {
                         currentStage = aceStage;
                     }
-                    else if ( aceStage < currentStage )
+                    else if (aceStage < currentStage)
                     {
                         return false;
                     }
@@ -1783,24 +1771,24 @@ nameof(binaryForm));
                 // of this check!
                 //
 
-                for ( int i = 0; i < _acl.Count; i++ )
+                for (int i = 0; i < _acl.Count; i++)
                 {
                     int aceStage;
 
                     GenericAce ace = _acl[i];
 
-                    if ( ace == null )
+                    if (ace == null)
                     {
                         //
                         // <markpu-9/19/2004> Afraid to yank this statement now
                         // for fear of destabilization, so adding an assert instead
                         //
 
-                        Debug.Assert( ace != null, "How did a null ACE end up in a SACL?" );
+                        Debug.Assert(ace != null, "How did a null ACE end up in a SACL?");
                         continue;
                     }
 
-                    if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
+                    if ((ace.AceFlags & AceFlags.Inherited) != 0)
                     {
                         aceStage = Inherited;
                     }
@@ -1808,7 +1796,7 @@ nameof(binaryForm));
                     {
                         QualifiedAce qualifiedAce = ace as QualifiedAce;
 
-                        if ( qualifiedAce == null )
+                        if (qualifiedAce == null)
                         {
                             //
                             // Explicit ACE is not recognized - this is not a canonical ACL
@@ -1817,8 +1805,8 @@ nameof(binaryForm));
                             return false;
                         }
 
-                        if ( qualifiedAce.AceQualifier == AceQualifier.SystemAudit ||
-                            qualifiedAce.AceQualifier == AceQualifier.SystemAlarm )
+                        if (qualifiedAce.AceQualifier == AceQualifier.SystemAudit ||
+                            qualifiedAce.AceQualifier == AceQualifier.SystemAlarm)
                         {
                             aceStage = Explicit;
                         }
@@ -1828,16 +1816,16 @@ nameof(binaryForm));
                             // Only audit and alarm ACEs are allowed here
                             //
 
-                            Debug.Assert( false, "Allow and deny ACEs must have been stripped by remove-meaningless logic" );
+                            Debug.Assert(false, "Allow and deny ACEs must have been stripped by remove-meaningless logic");
                             return false;
                         }
                     }
 
-                    if ( aceStage > currentStage )
+                    if (aceStage > currentStage)
                     {
                         currentStage = aceStage;
                     }
-                    else if ( aceStage < currentStage )
+                    else if (aceStage < currentStage)
                     {
                         return false;
                     }
@@ -1849,9 +1837,9 @@ nameof(binaryForm));
 
         private void ThrowIfNotCanonical()
         {
-            if ( !_isCanonical )
+            if (!_isCanonical)
             {
-                throw new InvalidOperationException( SR.InvalidOperation_ModificationOfNonCanonicalAcl );
+                throw new InvalidOperationException(SR.InvalidOperation_ModificationOfNonCanonicalAcl);
             }
         }
 
@@ -1863,12 +1851,12 @@ nameof(binaryForm));
         // Creates an empty ACL
         //
 
-        internal CommonAcl( bool isContainer, bool isDS, byte revision, int capacity )
+        internal CommonAcl(bool isContainer, bool isDS, byte revision, int capacity)
             : base()
         {
             _isContainer = isContainer;
             _isDS = isDS;
-            _acl = new RawAcl( revision, capacity );
+            _acl = new RawAcl(revision, capacity);
             _isCanonical = true; // since it is empty
         }
 
@@ -1880,12 +1868,12 @@ nameof(binaryForm));
         //   copy of the ACL passed in
         //
 
-        internal CommonAcl( bool isContainer, bool isDS, RawAcl rawAcl, bool trusted, bool isDacl )
+        internal CommonAcl(bool isContainer, bool isDS, RawAcl rawAcl, bool trusted, bool isDacl)
             : base()
         {
-            if ( rawAcl == null )
+            if (rawAcl == null)
             {
-                throw new ArgumentNullException( nameof(rawAcl));
+                throw new ArgumentNullException(nameof(rawAcl));
             }
 
             _isContainer = isContainer;
@@ -1899,7 +1887,7 @@ nameof(binaryForm));
 
                 _acl = rawAcl;
 
-                RemoveMeaninglessAcesAndFlags( isDacl );
+                RemoveMeaninglessAcesAndFlags(isDacl);
             }
             else
             {
@@ -1907,9 +1895,9 @@ nameof(binaryForm));
                 // In the untrusted case, we create our own raw ACL to keep the ACEs in
                 //
 
-                _acl = new RawAcl( rawAcl.Revision, rawAcl.Count );
+                _acl = new RawAcl(rawAcl.Revision, rawAcl.Count);
 
-                for ( int i = 0; i < rawAcl.Count; i++ )
+                for (int i = 0; i < rawAcl.Count; i++)
                 {
                     //
                     // Clone each ACE prior to putting it in
@@ -1921,9 +1909,9 @@ nameof(binaryForm));
                     // Avoid inserting meaningless ACEs
                     //
 
-                    if ( true == InspectAce( ref ace, isDacl ))
+                    if (true == InspectAce(ref ace, isDacl))
                     {
-                        _acl.InsertAce( _acl.Count, ace );
+                        _acl.InsertAce(_acl.Count, ace);
                     }
                 }
             }
@@ -1932,13 +1920,13 @@ nameof(binaryForm));
             // See whether the ACL is canonical to begin with
             //
 
-            if ( true == CanonicalCheck( isDacl ))
+            if (true == CanonicalCheck(isDacl))
             {
                 //
                 // Sort and compact the array
                 //
 
-                Canonicalize( true, isDacl );
+                Canonicalize(true, isDacl);
 
                 _isCanonical = true;
             }
@@ -1961,40 +1949,40 @@ nameof(binaryForm));
 
         #region Protected Methods
 
-        internal void CheckAccessType( AccessControlType accessType )
+        internal void CheckAccessType(AccessControlType accessType)
         {
-            if ( accessType != AccessControlType.Allow &&
-                accessType != AccessControlType.Deny )
+            if (accessType != AccessControlType.Allow &&
+                accessType != AccessControlType.Deny)
             {
                 throw new ArgumentOutOfRangeException(
 nameof(accessType),
-                    SR.ArgumentOutOfRange_Enum );
+                    SR.ArgumentOutOfRange_Enum);
             }
         }
 
-        internal void CheckFlags( InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags )
+        internal void CheckFlags(InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
         {
-            if ( IsContainer )
+            if (IsContainer)
             {
                 //
                 // Supplying propagation flags without inheritance flags is illegal
                 //
 
-                if ( inheritanceFlags == InheritanceFlags.None &&
-                    propagationFlags != PropagationFlags.None )
+                if (inheritanceFlags == InheritanceFlags.None &&
+                    propagationFlags != PropagationFlags.None)
                 {
                     throw new ArgumentException(
                         SR.Argument_InvalidAnyFlag,
 nameof(propagationFlags));
                 }
             }
-            else if ( inheritanceFlags != InheritanceFlags.None )
+            else if (inheritanceFlags != InheritanceFlags.None)
             {
                 throw new ArgumentException(
                     SR.Argument_InvalidAnyFlag,
 nameof(inheritanceFlags));
             }
-            else if ( propagationFlags != PropagationFlags.None )
+            else if (propagationFlags != PropagationFlags.None)
             {
                 throw new ArgumentException(
                     SR.Argument_InvalidAnyFlag,
@@ -2008,26 +1996,26 @@ nameof(propagationFlags));
         // Helper function behind all the AddXXX methods for qualified aces
         //
 
-        internal void AddQualifiedAce( SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType )
+        internal void AddQualifiedAce(SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
         {
-            if ( sid == null )
+            if (sid == null)
             {
-                throw new ArgumentNullException( nameof(sid));
+                throw new ArgumentNullException(nameof(sid));
             }
 
             ThrowIfNotCanonical();
 
             bool aceMerged = false; // if still false after all attempts to merge, create new entry
 
-            if ( qualifier == AceQualifier.SystemAudit &&
-                (( flags & AceFlags.AuditFlags ) == 0 ))
+            if (qualifier == AceQualifier.SystemAudit &&
+                ((flags & AceFlags.AuditFlags) == 0))
             {
                 throw new ArgumentException(
                     SR.Arg_EnumAtLeastOneFlag,
 nameof(flags));
             }
 
-            if ( accessMask == 0 )
+            if (accessMask == 0)
             {
                 throw new ArgumentException(
                     SR.Argument_ArgumentZero,
@@ -2036,20 +2024,20 @@ nameof(accessMask));
 
             GenericAce newAce;
 
-            if (( !IsDS ) || ( objectFlags == ObjectAceFlags.None ))
+            if ((!IsDS) || (objectFlags == ObjectAceFlags.None))
             {
-                newAce = new CommonAce( flags, qualifier, accessMask, sid, false, null );
+                newAce = new CommonAce(flags, qualifier, accessMask, sid, false, null);
             }
             else
             {
-                newAce = new ObjectAce( flags, qualifier, accessMask, sid, objectFlags, objectType, inheritedObjectType, false, null );
+                newAce = new ObjectAce(flags, qualifier, accessMask, sid, objectFlags, objectType, inheritedObjectType, false, null);
             }
 
             //
             // Make sure the new ACE wouldn't be meaningless before proceeding
             //
 
-            if ( false == InspectAce( ref newAce, ( this is DiscretionaryAcl )))
+            if (false == InspectAce(ref newAce, (this is DiscretionaryAcl)))
             {
                 return;
             }
@@ -2058,16 +2046,16 @@ nameof(accessMask));
             // See if the new ACE can be merged with any of the existing ones
             //
 
-            for ( int i = 0; i < Count; i++ )
+            for (int i = 0; i < Count; i++)
             {
                 QualifiedAce ace = _acl[i] as QualifiedAce;
 
-                if ( ace == null )
+                if (ace == null)
                 {
                     continue;
                 }
 
-                if ( true == MergeAces( ref ace, newAce as QualifiedAce ))
+                if (true == MergeAces(ref ace, newAce as QualifiedAce))
                 {
                     aceMerged = true;
                     break;
@@ -2078,9 +2066,9 @@ nameof(accessMask));
             // Couldn't modify any existing entry, so add a new one
             //
 
-            if ( !aceMerged )
+            if (!aceMerged)
             {
-                _acl.InsertAce( _acl.Count, newAce );
+                _acl.InsertAce(_acl.Count, newAce);
 
                 _isDirty = true;
             }
@@ -2091,22 +2079,22 @@ nameof(accessMask));
         // Helper function behind all the SetXXX methods
         //
 
-        internal void SetQualifiedAce( SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType )
+        internal void SetQualifiedAce(SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
         {
-            if ( sid == null )
+            if (sid == null)
             {
-                throw new ArgumentNullException( nameof(sid));
+                throw new ArgumentNullException(nameof(sid));
             }
 
-            if ( qualifier == AceQualifier.SystemAudit &&
-                (( flags & AceFlags.AuditFlags ) == 0 ))
+            if (qualifier == AceQualifier.SystemAudit &&
+                ((flags & AceFlags.AuditFlags) == 0))
             {
                 throw new ArgumentException(
                     SR.Arg_EnumAtLeastOneFlag,
 nameof(flags));
             }
 
-            if ( accessMask == 0 )
+            if (accessMask == 0)
             {
                 throw new ArgumentException(
                     SR.Argument_ArgumentZero,
@@ -2117,25 +2105,25 @@ nameof(accessMask));
 
             GenericAce newAce;
 
-            if (( !IsDS ) || ( objectFlags == ObjectAceFlags.None ))
+            if ((!IsDS) || (objectFlags == ObjectAceFlags.None))
             {
-                newAce = new CommonAce( flags, qualifier, accessMask, sid, false, null );
+                newAce = new CommonAce(flags, qualifier, accessMask, sid, false, null);
             }
             else
             {
-                newAce = new ObjectAce( flags, qualifier, accessMask, sid, objectFlags, objectType, inheritedObjectType, false, null );
+                newAce = new ObjectAce(flags, qualifier, accessMask, sid, objectFlags, objectType, inheritedObjectType, false, null);
             }
 
             //
             // Make sure the new ACE wouldn't be meaningless before proceeding
             //
 
-            if ( false == InspectAce( ref newAce, ( this is DiscretionaryAcl )))
+            if (false == InspectAce(ref newAce, (this is DiscretionaryAcl)))
             {
                 return;
             }
 
-            for ( int i = 0; i < Count; i++ )
+            for (int i = 0; i < Count; i++)
             {
                 QualifiedAce ace = _acl[i] as QualifiedAce;
 
@@ -2143,7 +2131,7 @@ nameof(accessMask));
                 // Not a qualified ACE - keep going
                 //
 
-                if ( ace == null )
+                if (ace == null)
                 {
                     continue;
                 }
@@ -2152,7 +2140,7 @@ nameof(accessMask));
                 // Only interested in explicit (non-inherited) ACEs
                 //
 
-                if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
+                if ((ace.AceFlags & AceFlags.Inherited) != 0)
                 {
                     continue;
                 }
@@ -2161,7 +2149,7 @@ nameof(accessMask));
                 // Only interested in ACEs with the specified qualifier
                 //
 
-                if ( ace.AceQualifier != qualifier )
+                if (ace.AceQualifier != qualifier)
                 {
                     continue;
                 }
@@ -2170,7 +2158,7 @@ nameof(accessMask));
                 // Only interested in ACEs with the specified SID
                 //
 
-                if ( ace.SecurityIdentifier != sid )
+                if (ace.SecurityIdentifier != sid)
                 {
                     continue;
                 }
@@ -2179,7 +2167,7 @@ nameof(accessMask));
                 // This ACE corresponds to the SID and qualifier in question - remove it
                 //
 
-                _acl.RemoveAce( i );
+                _acl.RemoveAce(i);
                 i--;
             }
 
@@ -2188,7 +2176,7 @@ nameof(accessMask));
             // Add it at the end - we'll re-canonicalize later.
             //
 
-            _acl.InsertAce( _acl.Count, newAce );
+            _acl.InsertAce(_acl.Count, newAce);
 
             //
             // To aid the efficiency of batch operations, recanonicalize this later
@@ -2202,26 +2190,26 @@ nameof(accessMask));
         // Helper function behind all the RemoveXXX methods
         //
 
-        internal bool RemoveQualifiedAces( SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, bool saclSemantics, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType )
+        internal bool RemoveQualifiedAces(SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, bool saclSemantics, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
         {
-            if ( accessMask == 0 )
+            if (accessMask == 0)
             {
                 throw new ArgumentException(
                     SR.Argument_ArgumentZero,
 nameof(accessMask));
             }
 
-            if ( qualifier == AceQualifier.SystemAudit &&
-                (( flags & AceFlags.AuditFlags ) == 0 ))
+            if (qualifier == AceQualifier.SystemAudit &&
+                ((flags & AceFlags.AuditFlags) == 0))
             {
                 throw new ArgumentException(
                     SR.Arg_EnumAtLeastOneFlag,
 nameof(flags));
             }
 
-            if ( sid == null )
+            if (sid == null)
             {
-                throw new ArgumentNullException( nameof(sid));
+                throw new ArgumentNullException(nameof(sid));
             }
 
             ThrowIfNotCanonical();
@@ -2252,13 +2240,13 @@ nameof(flags));
             //
 
             byte[] recovery = new byte[BinaryLength];
-            GetBinaryForm( recovery, 0 );
+            GetBinaryForm(recovery, 0);
 
         MakeAnotherPass:
 
             try
             {
-                for ( int i = 0; i < Count; i++ )
+                for (int i = 0; i < Count; i++)
                 {
                     QualifiedAce ace = _acl[i] as QualifiedAce;
 
@@ -2266,7 +2254,7 @@ nameof(flags));
                     // Not a qualified ACE - keep going
                     //
 
-                    if ( ace == null )
+                    if (ace == null)
                     {
                         continue;
                     }
@@ -2275,7 +2263,7 @@ nameof(flags));
                     // Only interested in explicit (non-inherited) ACEs
                     //
 
-                    if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
+                    if ((ace.AceFlags & AceFlags.Inherited) != 0)
                     {
                         continue;
                     }
@@ -2284,7 +2272,7 @@ nameof(flags));
                     // Only interested in ACEs with the specified qualifier
                     //
 
-                    if ( ace.AceQualifier != qualifier )
+                    if (ace.AceQualifier != qualifier)
                     {
                         continue;
                     }
@@ -2293,7 +2281,7 @@ nameof(flags));
                     // Only interested in ACEs with the specified SID
                     //
 
-                    if ( ace.SecurityIdentifier != sid )
+                    if (ace.SecurityIdentifier != sid)
                     {
                         continue;
                     }
@@ -2302,7 +2290,7 @@ nameof(flags));
                     // If access masks have nothing in common, skip the whole exercise
                     //
 
-                    if ( IsDS )
+                    if (IsDS)
                     {
                         //
                         // incase of directory aces, if the access mask of the
@@ -2314,10 +2302,10 @@ nameof(flags));
                         // the object types are different in which case they are really not common bits.
                         //
                         accessMask = originalAccessMask;
-                        bool objectTypesConflict = !GetAccessMaskForRemoval( ace, objectFlags, objectType, ref accessMask );
+                        bool objectTypesConflict = !GetAccessMaskForRemoval(ace, objectFlags, objectType, ref accessMask);
 
                         // if the access masks have nothing in common, skip
-                        if (( ace.AccessMask & accessMask ) == 0 )
+                        if ((ace.AccessMask & accessMask) == 0)
                         {
                             continue;
                         }
@@ -2331,10 +2319,10 @@ nameof(flags));
                         // the inherited object types are different the inheritance may not be common.
                         //
                         flags = originalFlags;
-                        bool inheritedObjectTypesConflict = !GetInheritanceFlagsForRemoval( ace, objectFlags, inheritedObjectType, ref flags );
+                        bool inheritedObjectTypesConflict = !GetInheritanceFlagsForRemoval(ace, objectFlags, inheritedObjectType, ref flags);
 
-                        if (((( ace.AceFlags & AceFlags.ContainerInherit ) == 0 ) && (( flags & AceFlags.ContainerInherit ) != 0 )  && (( flags & AceFlags.InheritOnly ) != 0 )) ||
-                             ((( flags & AceFlags.ContainerInherit ) == 0 ) && (( ace.AceFlags & AceFlags.ContainerInherit ) != 0 )  && (( ace.AceFlags & AceFlags.InheritOnly ) != 0)))
+                        if ((((ace.AceFlags & AceFlags.ContainerInherit) == 0) && ((flags & AceFlags.ContainerInherit) != 0) && ((flags & AceFlags.InheritOnly) != 0)) ||
+                             (((flags & AceFlags.ContainerInherit) == 0) && ((ace.AceFlags & AceFlags.ContainerInherit) != 0) && ((ace.AceFlags & AceFlags.InheritOnly) != 0)))
                         {
                             // if one ace applies only to self and the other only to children/descendents we have nothing in common
                             continue;
@@ -2344,12 +2332,12 @@ nameof(flags));
                         // if the ace being removed referred only to child types and child types among existing ace and
                         // ace being removed are not common then there is nothing in common between these aces (skip)
                         //
-                        if ((( originalFlags & AceFlags.ContainerInherit ) != 0 ) && (( originalFlags & AceFlags.InheritOnly ) != 0 ) && (( flags & AceFlags.ContainerInherit ) == 0 ))
+                        if (((originalFlags & AceFlags.ContainerInherit) != 0) && ((originalFlags & AceFlags.InheritOnly) != 0) && ((flags & AceFlags.ContainerInherit) == 0))
                         {
                             continue;
                         }
 
-                        if ( objectTypesConflict || inheritedObjectTypesConflict )
+                        if (objectTypesConflict || inheritedObjectTypesConflict)
                         {
                             //
                             // if we reached this stage, then we've found something common between the two aces.
@@ -2361,7 +2349,7 @@ nameof(flags));
                     }
                     else
                     {
-                        if (( ace.AccessMask & accessMask ) == 0 )
+                        if ((ace.AccessMask & accessMask) == 0)
                         {
                             continue;
                         }
@@ -2372,8 +2360,8 @@ nameof(flags));
                     // skip the whole exercise
                     //
 
-                    if ( saclSemantics &&
-                        (( ace.AceFlags & flags & AceFlags.AuditFlags ) == 0 ))
+                    if (saclSemantics &&
+                        ((ace.AceFlags & flags & AceFlags.AuditFlags) == 0))
                     {
                         continue;
                     }
@@ -2452,19 +2440,19 @@ nameof(flags));
                     ps_AceFlags = ace.AceFlags;
                     unchecked { ps_AccessMask = ace.AccessMask & ~accessMask; }
 
-                    if ( ace is ObjectAce )
+                    if (ace is ObjectAce)
                     {
                         //
                         // determine what should be the object/inherited object types on the permission split
                         //
-                        GetObjectTypesForSplit( ace as ObjectAce, ps_AccessMask /* access mask for this split */, ps_AceFlags /* flags remain the same */, out ps_ObjectAceFlags, out ps_ObjectAceType, out ps_InheritedObjectAceType );
+                        GetObjectTypesForSplit(ace as ObjectAce, ps_AccessMask /* access mask for this split */, ps_AceFlags /* flags remain the same */, out ps_ObjectAceFlags, out ps_ObjectAceType, out ps_InheritedObjectAceType);
                     }
 
                     //
                     // Next, for SACLs only, compute the auditing split
                     //
 
-                    if ( saclSemantics )
+                    if (saclSemantics)
                     {
                         //
                         // This operation can set the audit bits region
@@ -2472,21 +2460,21 @@ nameof(flags));
                         // This case will be handled later
                         //
 
-                        unchecked { as_AceFlags = ace.AceFlags & ~( flags & AceFlags.AuditFlags ); }
+                        unchecked { as_AceFlags = ace.AceFlags & ~(flags & AceFlags.AuditFlags); }
 
                         //
                         // The result of this evaluation is guaranteed
                         // not to be zero by now
                         //
 
-                        as_AccessMask = ( ace.AccessMask & accessMask );
+                        as_AccessMask = (ace.AccessMask & accessMask);
 
-                        if ( ace is ObjectAce )
+                        if (ace is ObjectAce)
                         {
                             //
                             // determine what should be the object/inherited object types on the audit split
                             //
-                            GetObjectTypesForSplit( ace as ObjectAce, as_AccessMask /* access mask for this split */, as_AceFlags /* flags remain the same for inheritance */, out as_ObjectAceFlags, out as_ObjectAceType, out as_InheritedObjectAceType );
+                            GetObjectTypesForSplit(ace as ObjectAce, as_AccessMask /* access mask for this split */, as_AceFlags /* flags remain the same for inheritance */, out as_ObjectAceFlags, out as_ObjectAceType, out as_InheritedObjectAceType);
                         }
                     }
 
@@ -2494,8 +2482,8 @@ nameof(flags));
                     // Finally, compute the merge split
                     //
 
-                    ms_AceFlags = ( ace.AceFlags & AceFlags.InheritanceFlags ) | ( flags & ace.AceFlags & AceFlags.AuditFlags );
-                    ms_AccessMask = ( ace.AccessMask & accessMask );
+                    ms_AceFlags = (ace.AceFlags & AceFlags.InheritanceFlags) | (flags & ace.AceFlags & AceFlags.AuditFlags);
+                    ms_AccessMask = (ace.AccessMask & accessMask);
 
 
                     //
@@ -2505,25 +2493,25 @@ nameof(flags));
                     // produced no auditing flags
                     //
 
-                    if ( !saclSemantics ||
-                        (( ms_AceFlags & AceFlags.AuditFlags ) != 0 ))
+                    if (!saclSemantics ||
+                        ((ms_AceFlags & AceFlags.AuditFlags) != 0))
                     {
-                        if ( false == RemoveInheritanceBits( ms_AceFlags, flags, IsDS, out mergeResultFlags, out mergeRemoveTotal ))
+                        if (false == RemoveInheritanceBits(ms_AceFlags, flags, IsDS, out mergeResultFlags, out mergeRemoveTotal))
                         {
                             removePossible = false;
                             break;
                         }
 
-                        if ( !mergeRemoveTotal )
+                        if (!mergeRemoveTotal)
                         {
-                            mergeResultFlags |= ( ms_AceFlags & AceFlags.AuditFlags );
+                            mergeResultFlags |= (ms_AceFlags & AceFlags.AuditFlags);
 
-                            if ( ace is ObjectAce )
+                            if (ace is ObjectAce)
                             {
                                 //
                                 // determine what should be the object/inherited object types on the merge split
                                 //
-                                GetObjectTypesForSplit( ace as ObjectAce, ms_AccessMask /* access mask for this split */, mergeResultFlags /* flags for this split */, out ms_ObjectAceFlags, out ms_ObjectAceType, out ms_InheritedObjectAceType );
+                                GetObjectTypesForSplit(ace as ObjectAce, ms_AccessMask /* access mask for this split */, mergeResultFlags /* flags for this split */, out ms_ObjectAceFlags, out ms_ObjectAceType, out ms_InheritedObjectAceType);
                             }
                         }
                     }
@@ -2532,7 +2520,7 @@ nameof(flags));
                     // If this is no longer an evaluation, go ahead and make the changes
                     //
 
-                    if ( !evaluationPass )
+                    if (!evaluationPass)
                     {
                         QualifiedAce newAce;
 
@@ -2544,24 +2532,24 @@ nameof(flags));
                         // we would be changing the size of this ace
                         //
 
-                        if ( ps_AccessMask != 0 )
+                        if (ps_AccessMask != 0)
                         {
-                            if (( ace is ObjectAce ) &&
-                                (((( ObjectAce) ace ).ObjectAceFlags & ObjectAceFlags.ObjectAceTypePresent ) != 0 ) &&
-                                     (( ps_ObjectAceFlags & ObjectAceFlags.ObjectAceTypePresent ) == 0 ))
+                            if ((ace is ObjectAce) &&
+                                ((((ObjectAce)ace).ObjectAceFlags & ObjectAceFlags.ObjectAceTypePresent) != 0) &&
+                                     ((ps_ObjectAceFlags & ObjectAceFlags.ObjectAceTypePresent) == 0))
                             {
                                 ObjectAce newObjectAce;
 
                                 _acl.RemoveAce(i);
-                                newObjectAce = new ObjectAce( ps_AceFlags, qualifier, ps_AccessMask, ace.SecurityIdentifier, ps_ObjectAceFlags, ps_ObjectAceType, ps_InheritedObjectAceType, false, null );
-                                _acl.InsertAce( i, newObjectAce );
+                                newObjectAce = new ObjectAce(ps_AceFlags, qualifier, ps_AccessMask, ace.SecurityIdentifier, ps_ObjectAceFlags, ps_ObjectAceType, ps_InheritedObjectAceType, false, null);
+                                _acl.InsertAce(i, newObjectAce);
                             }
                             else
                             {
                                 ace.AceFlags = ps_AceFlags;
                                 ace.AccessMask = ps_AccessMask;
 
-                                if ( ace is ObjectAce )
+                                if (ace is ObjectAce)
                                 {
                                     ObjectAce objectAce = ace as ObjectAce;
 
@@ -2581,20 +2569,20 @@ nameof(flags));
                         // On a SACL, the result of the auditing split must be recorded
                         //
 
-                        if ( saclSemantics && (( as_AceFlags & AceFlags.AuditFlags ) != 0 ))
+                        if (saclSemantics && ((as_AceFlags & AceFlags.AuditFlags) != 0))
                         {
-                            if ( ace is CommonAce )
+                            if (ace is CommonAce)
                             {
-                                newAce = new CommonAce( as_AceFlags, qualifier, as_AccessMask, ace.SecurityIdentifier, false, null );
+                                newAce = new CommonAce(as_AceFlags, qualifier, as_AccessMask, ace.SecurityIdentifier, false, null);
                             }
                             else
                             {
                                 // object ace
-                                newAce = new ObjectAce( as_AceFlags, qualifier, as_AccessMask, ace.SecurityIdentifier, as_ObjectAceFlags, as_ObjectAceType, as_InheritedObjectAceType, false, null );
+                                newAce = new ObjectAce(as_AceFlags, qualifier, as_AccessMask, ace.SecurityIdentifier, as_ObjectAceFlags, as_ObjectAceType, as_InheritedObjectAceType, false, null);
                             }
 
                             i++; // so it's not considered again
-                            _acl.InsertAce( i, newAce );
+                            _acl.InsertAce(i, newAce);
                         }
 
                         //
@@ -2602,32 +2590,32 @@ nameof(flags));
                         // as a separate ACE
                         //
 
-                        if ( !mergeRemoveTotal )
+                        if (!mergeRemoveTotal)
                         {
-                            if ( ace is CommonAce )
+                            if (ace is CommonAce)
                             {
-                                newAce = new CommonAce( mergeResultFlags, qualifier, ms_AccessMask, ace.SecurityIdentifier, false, null );
+                                newAce = new CommonAce(mergeResultFlags, qualifier, ms_AccessMask, ace.SecurityIdentifier, false, null);
                             }
                             else
                             {
                                 // object ace
-                                newAce = new ObjectAce( mergeResultFlags, qualifier, ms_AccessMask, ace.SecurityIdentifier, ms_ObjectAceFlags, ms_ObjectAceType, ms_InheritedObjectAceType, false, null );
+                                newAce = new ObjectAce(mergeResultFlags, qualifier, ms_AccessMask, ace.SecurityIdentifier, ms_ObjectAceFlags, ms_ObjectAceType, ms_InheritedObjectAceType, false, null);
                             }
 
                             i++; // so it's not considered again
-                            _acl.InsertAce( i, newAce );
+                            _acl.InsertAce(i, newAce);
                         }
                     }
                 }
             }
-            catch ( OverflowException )
+            catch (OverflowException)
             {
                 //
                 // Oops, overflow means that the ACL became too big.
                 // Inform the caller that the remove was not possible.
                 //
 
-                _acl.SetBinaryForm( recovery, 0 );
+                _acl.SetBinaryForm(recovery, 0);
                 return false;
             }
 
@@ -2636,7 +2624,7 @@ nameof(flags));
             // If it looks like it's doable, go ahead and do it.
             //
 
-            if ( evaluationPass && removePossible )
+            if (evaluationPass && removePossible)
             {
                 evaluationPass = false;
                 goto MakeAnotherPass;
@@ -2647,31 +2635,31 @@ nameof(flags));
             return removePossible;
         }
 
-        internal void RemoveQualifiedAcesSpecific( SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType )
+        internal void RemoveQualifiedAcesSpecific(SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
         {
-            if ( accessMask == 0 )
+            if (accessMask == 0)
             {
                 throw new ArgumentException(
                     SR.Argument_ArgumentZero,
 nameof(accessMask));
             }
 
-            if ( qualifier == AceQualifier.SystemAudit &&
-                (( flags & AceFlags.AuditFlags ) == 0 ))
+            if (qualifier == AceQualifier.SystemAudit &&
+                ((flags & AceFlags.AuditFlags) == 0))
             {
                 throw new ArgumentException(
                     SR.Arg_EnumAtLeastOneFlag,
 nameof(flags));
             }
 
-            if ( sid == null )
+            if (sid == null)
             {
-                throw new ArgumentNullException( nameof(sid));
+                throw new ArgumentNullException(nameof(sid));
             }
 
             ThrowIfNotCanonical();
 
-            for ( int i = 0; i < Count; i++ )
+            for (int i = 0; i < Count; i++)
             {
                 QualifiedAce ace = _acl[i] as QualifiedAce;
 
@@ -2679,7 +2667,7 @@ nameof(flags));
                 // Not a qualified ACE - keep going
                 //
 
-                if ( ace == null )
+                if (ace == null)
                 {
                     continue;
                 }
@@ -2688,7 +2676,7 @@ nameof(flags));
                 // Only interested in explicit (non-inherited) ACEs
                 //
 
-                if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
+                if ((ace.AceFlags & AceFlags.Inherited) != 0)
                 {
                     continue;
                 }
@@ -2697,7 +2685,7 @@ nameof(flags));
                 // Only interested in ACEs with the specified qualifier
                 //
 
-                if ( ace.AceQualifier != qualifier )
+                if (ace.AceQualifier != qualifier)
                 {
                     continue;
                 }
@@ -2706,7 +2694,7 @@ nameof(flags));
                 // Only interested in ACEs with the specified SID
                 //
 
-                if ( ace.SecurityIdentifier != sid )
+                if (ace.SecurityIdentifier != sid)
                 {
                     continue;
                 }
@@ -2715,7 +2703,7 @@ nameof(flags));
                 // Only interested in exact ACE flag matches
                 //
 
-                if ( ace.AceFlags != flags )
+                if (ace.AceFlags != flags)
                 {
                     continue;
                 }
@@ -2724,32 +2712,32 @@ nameof(flags));
                 // Only interested in exact access mask matches
                 //
 
-                if ( ace.AccessMask != accessMask )
+                if (ace.AccessMask != accessMask)
                 {
                     continue;
                 }
 
-                if ( IsDS )
+                if (IsDS)
                 {
                     //
                     // Incase of object aces, only interested in ACEs which match in their
                     // objectType and inheritedObjectType
                     //
 
-                    if (( ace is ObjectAce ) && ( objectFlags != ObjectAceFlags.None ))
+                    if ((ace is ObjectAce) && (objectFlags != ObjectAceFlags.None))
                     {
                         //
                         // both are object aces, so must match in object type and inherited object type
                         //
                         ObjectAce objectAce = ace as ObjectAce;
 
-                        if (( !objectAce.ObjectTypesMatch( objectFlags, objectType ))
-                            || ( !objectAce.InheritedObjectTypesMatch( objectFlags, inheritedObjectType )))
+                        if ((!objectAce.ObjectTypesMatch(objectFlags, objectType))
+                            || (!objectAce.InheritedObjectTypesMatch(objectFlags, inheritedObjectType)))
                         {
                             continue;
                         }
                     }
-                    else if (( ace is ObjectAce ) || ( objectFlags != ObjectAceFlags.None ))
+                    else if ((ace is ObjectAce) || (objectFlags != ObjectAceFlags.None))
                     {
                         // one is object ace and the other is not, so no match
                         continue;
@@ -2835,10 +2823,10 @@ nameof(flags));
         // Returns the binary representation of the ACL
         //
 
-        public sealed override void GetBinaryForm( byte[] binaryForm, int offset )
+        public sealed override void GetBinaryForm(byte[] binaryForm, int offset)
         {
             CanonicalizeIfNecessary();
-            _acl.GetBinaryForm( binaryForm, offset );
+            _acl.GetBinaryForm(binaryForm, offset);
         }
 
         //
@@ -2857,7 +2845,7 @@ nameof(flags));
 
             set
             {
-                throw new NotSupportedException( SR.NotSupported_SetMethod );
+                throw new NotSupportedException(SR.NotSupported_SetMethod);
             }
         }
 
@@ -2870,28 +2858,28 @@ nameof(flags));
             // are usually in the back of the ACL
             //
 
-            for ( int i = _acl.Count - 1; i >= 0; i-- )
+            for (int i = _acl.Count - 1; i >= 0; i--)
             {
                 GenericAce ace = _acl[i];
 
-                if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
+                if ((ace.AceFlags & AceFlags.Inherited) != 0)
                 {
-                    _acl.RemoveAce( i );
+                    _acl.RemoveAce(i);
                 }
             }
             OnAclModificationTried();
         }
 
-        public void Purge( SecurityIdentifier sid )
+        public void Purge(SecurityIdentifier sid)
         {
-            if ( sid == null )
+            if (sid == null)
             {
-                throw new ArgumentNullException( nameof(sid));
+                throw new ArgumentNullException(nameof(sid));
             }
 
             ThrowIfNotCanonical();
 
-            for ( int i = Count - 1; i >= 0; i-- )
+            for (int i = Count - 1; i >= 0; i--)
             {
                 KnownAce ace = _acl[i] as KnownAce;
 
@@ -2899,7 +2887,7 @@ nameof(flags));
                 // Skip over unknown ACEs
                 //
 
-                if ( ace == null )
+                if (ace == null)
                 {
                     continue;
                 }
@@ -2908,7 +2896,7 @@ nameof(flags));
                 // Skip over inherited ACEs
                 //
 
-                if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
+                if ((ace.AceFlags & AceFlags.Inherited) != 0)
                 {
                     continue;
                 }
@@ -2917,9 +2905,9 @@ nameof(flags));
                 // SID matches - ACE is out
                 //
 
-                if ( ace.SecurityIdentifier == sid )
+                if (ace.SecurityIdentifier == sid)
                 {
-                    _acl.RemoveAce( i );
+                    _acl.RemoveAce(i);
                 }
             }
             OnAclModificationTried();
@@ -2937,13 +2925,13 @@ nameof(flags));
         // Creates an emtpy ACL
         //
 
-        public SystemAcl( bool isContainer, bool isDS, int capacity )
-            : this( isContainer, isDS, isDS ? AclRevisionDS : AclRevision, capacity )
+        public SystemAcl(bool isContainer, bool isDS, int capacity)
+            : this(isContainer, isDS, isDS ? AclRevisionDS : AclRevision, capacity)
         {
         }
 
-        public SystemAcl( bool isContainer, bool isDS, byte revision, int capacity )
-            : base( isContainer, isDS, revision, capacity )
+        public SystemAcl(bool isContainer, bool isDS, byte revision, int capacity)
+            : base(isContainer, isDS, revision, capacity)
         {
         }
 
@@ -2952,8 +2940,8 @@ nameof(flags));
         // after canonicalizing it
         //
 
-        public SystemAcl( bool isContainer, bool isDS, RawAcl rawAcl )
-            : this( isContainer, isDS, rawAcl, false )
+        public SystemAcl(bool isContainer, bool isDS, RawAcl rawAcl)
+            : this(isContainer, isDS, rawAcl, false)
         {
         }
 
@@ -2962,8 +2950,8 @@ nameof(flags));
         // takes ownership of the given raw ACL
         //
 
-        internal SystemAcl( bool isContainer, bool isDS, RawAcl rawAcl, bool trusted )
-            : base( isContainer, isDS, rawAcl, trusted, false )
+        internal SystemAcl(bool isContainer, bool isDS, RawAcl rawAcl, bool trusted)
+            : base(isContainer, isDS, rawAcl, trusted, false)
         {
         }
 
@@ -2971,26 +2959,26 @@ nameof(flags));
 
         #region Public Methods
 
-        public void AddAudit( AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags )
+        public void AddAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
         {
-            CheckFlags( inheritanceFlags, propagationFlags );
-            AddQualifiedAce( sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags( auditFlags ) | GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), ObjectAceFlags.None, Guid.Empty, Guid.Empty );
+            CheckFlags(inheritanceFlags, propagationFlags);
+            AddQualifiedAce(sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), ObjectAceFlags.None, Guid.Empty, Guid.Empty);
         }
 
-        public void SetAudit( AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags )
+        public void SetAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
         {
-            CheckFlags( inheritanceFlags, propagationFlags );
-            SetQualifiedAce( sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags( auditFlags ) | GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), ObjectAceFlags.None, Guid.Empty, Guid.Empty );
+            CheckFlags(inheritanceFlags, propagationFlags);
+            SetQualifiedAce(sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), ObjectAceFlags.None, Guid.Empty, Guid.Empty);
         }
 
-        public bool RemoveAudit( AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags )
+        public bool RemoveAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
         {
-            return RemoveQualifiedAces(sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags( auditFlags ) | GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), true, ObjectAceFlags.None, Guid.Empty, Guid.Empty );
+            return RemoveQualifiedAces(sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), true, ObjectAceFlags.None, Guid.Empty, Guid.Empty);
         }
 
-        public void RemoveAuditSpecific( AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags )
+        public void RemoveAuditSpecific(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
         {
-            RemoveQualifiedAcesSpecific( sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags( auditFlags ) | GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), ObjectAceFlags.None, Guid.Empty, Guid.Empty );
+            RemoveQualifiedAcesSpecific(sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), ObjectAceFlags.None, Guid.Empty, Guid.Empty);
         }
 
         public void AddAudit(SecurityIdentifier sid, ObjectAuditRule rule)
@@ -3003,13 +2991,13 @@ nameof(flags));
             //
             // This is valid only for DS Acls
             //
-            if ( !IsDS )
+            if (!IsDS)
             {
                 throw new InvalidOperationException(
-                    SR.InvalidOperation_OnlyValidForDS );
+                    SR.InvalidOperation_OnlyValidForDS);
             }
 
-            CheckFlags( inheritanceFlags, propagationFlags );
+            CheckFlags(inheritanceFlags, propagationFlags);
             AddQualifiedAce(sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), objectFlags, objectType, inheritedObjectType);
         }
 
@@ -3023,13 +3011,13 @@ nameof(flags));
             //
             // This is valid only for DS Acls
             //
-            if ( !IsDS )
+            if (!IsDS)
             {
                 throw new InvalidOperationException(
-                    SR.InvalidOperation_OnlyValidForDS );
+                    SR.InvalidOperation_OnlyValidForDS);
             }
 
-            CheckFlags( inheritanceFlags, propagationFlags );
+            CheckFlags(inheritanceFlags, propagationFlags);
             SetQualifiedAce(sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), objectFlags, objectType, inheritedObjectType);
         }
 
@@ -3043,10 +3031,10 @@ nameof(flags));
             //
             // This is valid only for DS Acls
             //
-            if ( !IsDS )
+            if (!IsDS)
             {
                 throw new InvalidOperationException(
-                    SR.InvalidOperation_OnlyValidForDS );
+                    SR.InvalidOperation_OnlyValidForDS);
             }
 
             return RemoveQualifiedAces(sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), true, objectFlags, objectType, inheritedObjectType);
@@ -3062,10 +3050,10 @@ nameof(flags));
             //
             // This is valid only for DS Acls
             //
-            if ( !IsDS )
+            if (!IsDS)
             {
                 throw new InvalidOperationException(
-                    SR.InvalidOperation_OnlyValidForDS );
+                    SR.InvalidOperation_OnlyValidForDS);
             }
 
             RemoveQualifiedAcesSpecific(sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), objectFlags, objectType, inheritedObjectType);
@@ -3078,7 +3066,7 @@ nameof(flags));
     public sealed class DiscretionaryAcl : CommonAcl
     {
         #region
-        private static readonly SecurityIdentifier _sidEveryone = new SecurityIdentifier( WellKnownSidType.WorldSid, null );
+        private static readonly SecurityIdentifier _sidEveryone = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
         private bool everyOneFullAccessForNullDacl = false;
         #endregion
 
@@ -3088,13 +3076,13 @@ nameof(flags));
         // Creates an emtpy ACL
         //
 
-        public DiscretionaryAcl( bool isContainer, bool isDS, int capacity )
-            : this( isContainer, isDS, isDS ? AclRevisionDS : AclRevision, capacity )
+        public DiscretionaryAcl(bool isContainer, bool isDS, int capacity)
+            : this(isContainer, isDS, isDS ? AclRevisionDS : AclRevision, capacity)
         {
         }
 
-        public DiscretionaryAcl( bool isContainer, bool isDS, byte revision, int capacity )
-            : base( isContainer, isDS, revision, capacity )
+        public DiscretionaryAcl(bool isContainer, bool isDS, byte revision, int capacity)
+            : base(isContainer, isDS, revision, capacity)
         {
         }
 
@@ -3103,8 +3091,8 @@ nameof(flags));
         // after canonicalizing it
         //
 
-        public DiscretionaryAcl( bool isContainer, bool isDS, RawAcl rawAcl )
-            : this( isContainer, isDS, rawAcl, false )
+        public DiscretionaryAcl(bool isContainer, bool isDS, RawAcl rawAcl)
+            : this(isContainer, isDS, rawAcl, false)
         {
         }
 
@@ -3113,8 +3101,8 @@ nameof(flags));
         // takes ownership of the given raw ACL
         //
 
-        internal DiscretionaryAcl( bool isContainer, bool isDS, RawAcl rawAcl, bool trusted )
-            : base( isContainer, isDS, rawAcl == null ? new RawAcl( isDS ? AclRevisionDS : AclRevision, 0 ) : rawAcl, trusted, true )
+        internal DiscretionaryAcl(bool isContainer, bool isDS, RawAcl rawAcl, bool trusted)
+            : base(isContainer, isDS, rawAcl == null ? new RawAcl(isDS ? AclRevisionDS : AclRevision, 0) : rawAcl, trusted, true)
         {
         }
 
@@ -3122,34 +3110,34 @@ nameof(flags));
 
         #region Public Methods
 
-        public void AddAccess( AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags )
+        public void AddAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
         {
-            CheckAccessType( accessType );
-            CheckFlags( inheritanceFlags, propagationFlags );
+            CheckAccessType(accessType);
+            CheckFlags(inheritanceFlags, propagationFlags);
             everyOneFullAccessForNullDacl = false;
-            AddQualifiedAce( sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), ObjectAceFlags.None, Guid.Empty, Guid.Empty );
+            AddQualifiedAce(sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), ObjectAceFlags.None, Guid.Empty, Guid.Empty);
         }
 
-        public void SetAccess( AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags )
+        public void SetAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
         {
-            CheckAccessType( accessType );
-            CheckFlags( inheritanceFlags, propagationFlags );
+            CheckAccessType(accessType);
+            CheckFlags(inheritanceFlags, propagationFlags);
             everyOneFullAccessForNullDacl = false;
-            SetQualifiedAce( sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), ObjectAceFlags.None, Guid.Empty, Guid.Empty );
+            SetQualifiedAce(sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), ObjectAceFlags.None, Guid.Empty, Guid.Empty);
         }
 
-        public bool RemoveAccess( AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags )
+        public bool RemoveAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
         {
-            CheckAccessType( accessType );
+            CheckAccessType(accessType);
             everyOneFullAccessForNullDacl = false;
-            return RemoveQualifiedAces( sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), false, ObjectAceFlags.None, Guid.Empty, Guid.Empty );
+            return RemoveQualifiedAces(sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), false, ObjectAceFlags.None, Guid.Empty, Guid.Empty);
         }
 
-        public void RemoveAccessSpecific( AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags )
+        public void RemoveAccessSpecific(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
         {
-            CheckAccessType( accessType );
+            CheckAccessType(accessType);
             everyOneFullAccessForNullDacl = false;
-            RemoveQualifiedAcesSpecific(sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), ObjectAceFlags.None, Guid.Empty, Guid.Empty );
+            RemoveQualifiedAcesSpecific(sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), ObjectAceFlags.None, Guid.Empty, Guid.Empty);
         }
 
         public void AddAccess(AccessControlType accessType, SecurityIdentifier sid, ObjectAccessRule rule)
@@ -3162,16 +3150,16 @@ nameof(flags));
             //
             // This is valid only for DS Acls
             //
-            if ( !IsDS )
+            if (!IsDS)
             {
                 throw new InvalidOperationException(
-                    SR.InvalidOperation_OnlyValidForDS );
+                    SR.InvalidOperation_OnlyValidForDS);
             }
 
-            CheckAccessType( accessType );
-            CheckFlags( inheritanceFlags, propagationFlags );
+            CheckAccessType(accessType);
+            CheckFlags(inheritanceFlags, propagationFlags);
             everyOneFullAccessForNullDacl = false;
-            AddQualifiedAce( sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), objectFlags, objectType, inheritedObjectType );
+            AddQualifiedAce(sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), objectFlags, objectType, inheritedObjectType);
         }
 
         public void SetAccess(AccessControlType accessType, SecurityIdentifier sid, ObjectAccessRule rule)
@@ -3184,16 +3172,16 @@ nameof(flags));
             //
             // This is valid only for DS Acls
             //
-            if ( !IsDS )
+            if (!IsDS)
             {
                 throw new InvalidOperationException(
-                    SR.InvalidOperation_OnlyValidForDS );
+                    SR.InvalidOperation_OnlyValidForDS);
             }
 
-            CheckAccessType( accessType );
-            CheckFlags( inheritanceFlags, propagationFlags );
+            CheckAccessType(accessType);
+            CheckFlags(inheritanceFlags, propagationFlags);
             everyOneFullAccessForNullDacl = false;
-            SetQualifiedAce( sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), objectFlags, objectType, inheritedObjectType);
+            SetQualifiedAce(sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), objectFlags, objectType, inheritedObjectType);
         }
 
         public bool RemoveAccess(AccessControlType accessType, SecurityIdentifier sid, ObjectAccessRule rule)
@@ -3206,15 +3194,15 @@ nameof(flags));
             //
             // This is valid only for DS Acls
             //
-            if ( !IsDS )
+            if (!IsDS)
             {
                 throw new InvalidOperationException(
-                    SR.InvalidOperation_OnlyValidForDS );
+                    SR.InvalidOperation_OnlyValidForDS);
             }
 
-            CheckAccessType( accessType );
+            CheckAccessType(accessType);
             everyOneFullAccessForNullDacl = false;
-            return RemoveQualifiedAces(sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), false, objectFlags, objectType, inheritedObjectType );
+            return RemoveQualifiedAces(sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), false, objectFlags, objectType, inheritedObjectType);
         }
 
         public void RemoveAccessSpecific(AccessControlType accessType, SecurityIdentifier sid, ObjectAccessRule rule)
@@ -3227,15 +3215,15 @@ nameof(flags));
             //
             // This is valid only for DS Acls
             //
-            if ( !IsDS )
+            if (!IsDS)
             {
                 throw new InvalidOperationException(
-                    SR.InvalidOperation_OnlyValidForDS );
+                    SR.InvalidOperation_OnlyValidForDS);
             }
 
-            CheckAccessType( accessType );
+            CheckAccessType(accessType);
             everyOneFullAccessForNullDacl = false;
-            RemoveQualifiedAcesSpecific( sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags( inheritanceFlags, propagationFlags ), objectFlags, objectType, inheritedObjectType );
+            RemoveQualifiedAcesSpecific(sid, accessType == AccessControlType.Allow ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), objectFlags, objectType, inheritedObjectType);
         }
 
         #endregion
@@ -3273,13 +3261,13 @@ nameof(flags));
         /// single ACE DACL to replace null DACL from CommonSecurityObject.
         internal static DiscretionaryAcl CreateAllowEveryoneFullAccess(bool isDS, bool isContainer)
         {
-            DiscretionaryAcl dcl = new DiscretionaryAcl( isContainer, isDS, 1 );
+            DiscretionaryAcl dcl = new DiscretionaryAcl(isContainer, isDS, 1);
             dcl.AddAccess(
                 AccessControlType.Allow,
                 _sidEveryone,
                 -1,
-                isContainer ? ( InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit ) : InheritanceFlags.None,
-                PropagationFlags.None );
+                isContainer ? (InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit) : InheritanceFlags.None,
+                PropagationFlags.None);
 
             dcl.everyOneFullAccessForNullDacl = true;
             return dcl;
index 528f63e..111b35e 100644 (file)
@@ -20,12 +20,12 @@ namespace System.Security.AccessControl
 
     public enum AccessControlModification
     {
-        Add                    = 0,
-        Set                    = 1,
-        Reset                  = 2,
-        Remove                 = 3,
-        RemoveAll              = 4,
-        RemoveSpecific         = 5,
+        Add = 0,
+        Set = 1,
+        Reset = 2,
+        Remove = 3,
+        RemoveAll = 4,
+        RemoveSpecific = 5,
     }
 
 
@@ -64,51 +64,51 @@ namespace System.Security.AccessControl
         {
         }
 
-        protected ObjectSecurity( bool isContainer, bool isDS )
+        protected ObjectSecurity(bool isContainer, bool isDS)
             : this()
         {
             // we will create an empty DACL, denying anyone any access as the default. 5 is the capacity.
             DiscretionaryAcl dacl = new DiscretionaryAcl(isContainer, isDS, 5);
-             _securityDescriptor = new CommonSecurityDescriptor( isContainer, isDS, ControlFlags.None, null, null, null, dacl );
+            _securityDescriptor = new CommonSecurityDescriptor(isContainer, isDS, ControlFlags.None, null, null, null, dacl);
         }
 
         protected ObjectSecurity(CommonSecurityDescriptor securityDescriptor)
             : this()
         {
-            if ( securityDescriptor == null )
+            if (securityDescriptor == null)
             {
-                throw new ArgumentNullException( nameof(securityDescriptor));
+                throw new ArgumentNullException(nameof(securityDescriptor));
             }
 
-             _securityDescriptor = securityDescriptor;
+            _securityDescriptor = securityDescriptor;
         }
 
         #endregion
 
         #region Private methods
 
-        private void UpdateWithNewSecurityDescriptor( RawSecurityDescriptor newOne, AccessControlSections includeSections )
+        private void UpdateWithNewSecurityDescriptor(RawSecurityDescriptor newOne, AccessControlSections includeSections)
         {
-            Debug.Assert( newOne != null, "Must not supply a null parameter here" );
+            Debug.Assert(newOne != null, "Must not supply a null parameter here");
 
-            if (( includeSections & AccessControlSections.Owner ) != 0 )
+            if ((includeSections & AccessControlSections.Owner) != 0)
             {
                 _ownerModified = true;
                 _securityDescriptor.Owner = newOne.Owner;
             }
 
-            if (( includeSections & AccessControlSections.Group ) != 0 )
+            if ((includeSections & AccessControlSections.Group) != 0)
             {
                 _groupModified = true;
                 _securityDescriptor.Group = newOne.Group;
             }
 
-            if (( includeSections & AccessControlSections.Audit ) != 0 )
+            if ((includeSections & AccessControlSections.Audit) != 0)
             {
                 _saclModified = true;
-                if ( newOne.SystemAcl != null )
+                if (newOne.SystemAcl != null)
                 {
-                    _securityDescriptor.SystemAcl = new SystemAcl( IsContainer, IsDS, newOne.SystemAcl, true );
+                    _securityDescriptor.SystemAcl = new SystemAcl(IsContainer, IsDS, newOne.SystemAcl, true);
                 }
                 else
                 {
@@ -118,12 +118,12 @@ namespace System.Security.AccessControl
                 _securityDescriptor.UpdateControlFlags(SACL_CONTROL_FLAGS, (ControlFlags)(newOne.ControlFlags & SACL_CONTROL_FLAGS));
             }
 
-            if (( includeSections & AccessControlSections.Access ) != 0 )
+            if ((includeSections & AccessControlSections.Access) != 0)
             {
                 _daclModified = true;
-                if ( newOne.DiscretionaryAcl != null )
+                if (newOne.DiscretionaryAcl != null)
                 {
-                    _securityDescriptor.DiscretionaryAcl = new DiscretionaryAcl( IsContainer, IsDS, newOne.DiscretionaryAcl, true );
+                    _securityDescriptor.DiscretionaryAcl = new DiscretionaryAcl(IsContainer, IsDS, newOne.DiscretionaryAcl, true);
                 }
                 else
                 {
@@ -137,7 +137,7 @@ namespace System.Security.AccessControl
                 _securityDescriptor.UpdateControlFlags(DACL_CONTROL_FLAGS,
                     (ControlFlags)((newOne.ControlFlags | daclFlag) & DACL_CONTROL_FLAGS));
             }
-         }
+        }
 
         #endregion
 
@@ -172,9 +172,9 @@ namespace System.Security.AccessControl
         {
             get
             {
-                if (!( _lock.IsReadLockHeld || _lock.IsWriteLockHeld ))
+                if (!(_lock.IsReadLockHeld || _lock.IsWriteLockHeld))
                 {
-                    throw new InvalidOperationException( SR.InvalidOperation_MustLockForReadOrWrite );
+                    throw new InvalidOperationException(SR.InvalidOperation_MustLockForReadOrWrite);
                 }
 
                 return _ownerModified;
@@ -182,9 +182,9 @@ namespace System.Security.AccessControl
 
             set
             {
-                if ( !_lock.IsWriteLockHeld )
+                if (!_lock.IsWriteLockHeld)
                 {
-                    throw new InvalidOperationException( SR.InvalidOperation_MustLockForWrite );
+                    throw new InvalidOperationException(SR.InvalidOperation_MustLockForWrite);
                 }
 
                 _ownerModified = value;
@@ -195,9 +195,9 @@ namespace System.Security.AccessControl
         {
             get
             {
-                if (!( _lock.IsReadLockHeld || _lock.IsWriteLockHeld ))
+                if (!(_lock.IsReadLockHeld || _lock.IsWriteLockHeld))
                 {
-                    throw new InvalidOperationException( SR.InvalidOperation_MustLockForReadOrWrite );
+                    throw new InvalidOperationException(SR.InvalidOperation_MustLockForReadOrWrite);
                 }
 
                 return _groupModified;
@@ -205,9 +205,9 @@ namespace System.Security.AccessControl
 
             set
             {
-                if ( !_lock.IsWriteLockHeld )
+                if (!_lock.IsWriteLockHeld)
                 {
-                    throw new InvalidOperationException( SR.InvalidOperation_MustLockForWrite );
+                    throw new InvalidOperationException(SR.InvalidOperation_MustLockForWrite);
                 }
 
                 _groupModified = value;
@@ -218,9 +218,9 @@ namespace System.Security.AccessControl
         {
             get
             {
-                if (!( _lock.IsReadLockHeld || _lock.IsWriteLockHeld ))
+                if (!(_lock.IsReadLockHeld || _lock.IsWriteLockHeld))
                 {
-                    throw new InvalidOperationException( SR.InvalidOperation_MustLockForReadOrWrite );
+                    throw new InvalidOperationException(SR.InvalidOperation_MustLockForReadOrWrite);
                 }
 
                 return _saclModified;
@@ -228,9 +228,9 @@ namespace System.Security.AccessControl
 
             set
             {
-                if ( !_lock.IsWriteLockHeld )
+                if (!_lock.IsWriteLockHeld)
                 {
-                    throw new InvalidOperationException( SR.InvalidOperation_MustLockForWrite );
+                    throw new InvalidOperationException(SR.InvalidOperation_MustLockForWrite);
                 }
 
                 _saclModified = value;
@@ -241,9 +241,9 @@ namespace System.Security.AccessControl
         {
             get
             {
-                if (!( _lock.IsReadLockHeld || _lock.IsWriteLockHeld ))
+                if (!(_lock.IsReadLockHeld || _lock.IsWriteLockHeld))
                 {
-                    throw new InvalidOperationException( SR.InvalidOperation_MustLockForReadOrWrite );
+                    throw new InvalidOperationException(SR.InvalidOperation_MustLockForReadOrWrite);
                 }
 
                 return _daclModified;
@@ -251,9 +251,9 @@ namespace System.Security.AccessControl
 
             set
             {
-                if ( !_lock.IsWriteLockHeld )
+                if (!_lock.IsWriteLockHeld)
                 {
-                    throw new InvalidOperationException( SR.InvalidOperation_MustLockForWrite );
+                    throw new InvalidOperationException(SR.InvalidOperation_MustLockForWrite);
                 }
 
                 _daclModified = value;
@@ -276,7 +276,7 @@ namespace System.Security.AccessControl
         // This overloaded method takes a name of an existing object
         //
 
-        protected virtual void Persist( string name, AccessControlSections includeSections )
+        protected virtual void Persist(string name, AccessControlSections includeSections)
         {
             throw NotImplemented.ByDesign;
         }
@@ -286,7 +286,7 @@ namespace System.Security.AccessControl
         // privilege while persisting if the enableOwnershipPrivilege is true.
         // Integrators can override it if this is not desired.
         //
-        protected virtual void Persist(bool enableOwnershipPrivilege, string name, AccessControlSections includeSections )
+        protected virtual void Persist(bool enableOwnershipPrivilege, string name, AccessControlSections includeSections)
         {
             Privilege ownerPrivilege = null;
 
@@ -309,7 +309,7 @@ namespace System.Security.AccessControl
             catch
             {
                 // protection against exception filter-based luring attacks
-                if ( ownerPrivilege != null )
+                if (ownerPrivilege != null)
                 {
                     ownerPrivilege.Revert();
                 }
@@ -330,7 +330,7 @@ namespace System.Security.AccessControl
         // This overloaded method takes a handle to an existing object
         //
 
-        protected virtual void Persist( SafeHandle handle, AccessControlSections includeSections )
+        protected virtual void Persist(SafeHandle handle, AccessControlSections includeSections)
         {
             throw NotImplemented.ByDesign;
         }
@@ -343,18 +343,18 @@ namespace System.Security.AccessControl
         // Sets and retrieves the owner of this object
         //
 
-        public IdentityReference GetOwner( System.Type targetType )
+        public IdentityReference GetOwner(System.Type targetType)
         {
             ReadLock();
 
             try
             {
-                if ( _securityDescriptor.Owner == null )
+                if (_securityDescriptor.Owner == null)
                 {
                     return null;
                 }
 
-                return _securityDescriptor.Owner.Translate( targetType );
+                return _securityDescriptor.Owner.Translate(targetType);
             }
             finally
             {
@@ -362,18 +362,18 @@ namespace System.Security.AccessControl
             }
         }
 
-        public void SetOwner( IdentityReference identity )
+        public void SetOwner(IdentityReference identity)
         {
-            if ( identity == null )
+            if (identity == null)
             {
-                throw new ArgumentNullException( nameof(identity));
+                throw new ArgumentNullException(nameof(identity));
             }
 
             WriteLock();
 
             try
             {
-                _securityDescriptor.Owner = identity.Translate( typeof( SecurityIdentifier )) as SecurityIdentifier;
+                _securityDescriptor.Owner = identity.Translate(typeof(SecurityIdentifier)) as SecurityIdentifier;
                 _ownerModified = true;
             }
             finally
@@ -386,18 +386,18 @@ namespace System.Security.AccessControl
         // Sets and retrieves the group of this object
         //
 
-        public IdentityReference GetGroup( System.Type targetType )
+        public IdentityReference GetGroup(System.Type targetType)
         {
             ReadLock();
 
             try
             {
-                if ( _securityDescriptor.Group == null )
+                if (_securityDescriptor.Group == null)
                 {
                     return null;
                 }
 
-                return _securityDescriptor.Group.Translate( targetType );
+                return _securityDescriptor.Group.Translate(targetType);
             }
             finally
             {
@@ -405,18 +405,18 @@ namespace System.Security.AccessControl
             }
         }
 
-        public void SetGroup( IdentityReference identity )
+        public void SetGroup(IdentityReference identity)
         {
-            if ( identity == null )
+            if (identity == null)
             {
-                throw new ArgumentNullException( nameof(identity));
+                throw new ArgumentNullException(nameof(identity));
             }
 
             WriteLock();
 
             try
             {
-                _securityDescriptor.Group = identity.Translate( typeof( SecurityIdentifier )) as SecurityIdentifier;
+                _securityDescriptor.Group = identity.Translate(typeof(SecurityIdentifier)) as SecurityIdentifier;
                 _groupModified = true;
             }
             finally
@@ -425,18 +425,18 @@ namespace System.Security.AccessControl
             }
         }
 
-        public virtual void PurgeAccessRules( IdentityReference identity )
+        public virtual void PurgeAccessRules(IdentityReference identity)
         {
-            if ( identity == null )
+            if (identity == null)
             {
-                throw new ArgumentNullException( nameof(identity));
+                throw new ArgumentNullException(nameof(identity));
             }
 
             WriteLock();
 
             try
             {
-                _securityDescriptor.PurgeAccessControl( identity.Translate( typeof( SecurityIdentifier )) as SecurityIdentifier );
+                _securityDescriptor.PurgeAccessControl(identity.Translate(typeof(SecurityIdentifier)) as SecurityIdentifier);
                 _daclModified = true;
             }
             finally
@@ -447,16 +447,16 @@ namespace System.Security.AccessControl
 
         public virtual void PurgeAuditRules(IdentityReference identity)
         {
-            if ( identity == null )
+            if (identity == null)
             {
-                throw new ArgumentNullException( nameof(identity));
+                throw new ArgumentNullException(nameof(identity));
             }
 
             WriteLock();
 
             try
             {
-                _securityDescriptor.PurgeAudit( identity.Translate( typeof( SecurityIdentifier )) as SecurityIdentifier );
+                _securityDescriptor.PurgeAudit(identity.Translate(typeof(SecurityIdentifier)) as SecurityIdentifier);
                 _saclModified = true;
             }
             finally
@@ -473,7 +473,7 @@ namespace System.Security.AccessControl
 
                 try
                 {
-                    return (( _securityDescriptor.ControlFlags & ControlFlags.DiscretionaryAclProtected ) != 0 );
+                    return ((_securityDescriptor.ControlFlags & ControlFlags.DiscretionaryAclProtected) != 0);
                 }
                 finally
                 {
@@ -482,13 +482,13 @@ namespace System.Security.AccessControl
             }
         }
 
-        public void SetAccessRuleProtection( bool isProtected, bool preserveInheritance )
+        public void SetAccessRuleProtection(bool isProtected, bool preserveInheritance)
         {
             WriteLock();
 
             try
             {
-                _securityDescriptor.SetDiscretionaryAclProtection( isProtected, preserveInheritance );
+                _securityDescriptor.SetDiscretionaryAclProtection(isProtected, preserveInheritance);
                 _daclModified = true;
             }
             finally
@@ -505,7 +505,7 @@ namespace System.Security.AccessControl
 
                 try
                 {
-                    return (( _securityDescriptor.ControlFlags & ControlFlags.SystemAclProtected ) != 0 );
+                    return ((_securityDescriptor.ControlFlags & ControlFlags.SystemAclProtected) != 0);
                 }
                 finally
                 {
@@ -514,13 +514,13 @@ namespace System.Security.AccessControl
             }
         }
 
-        public void SetAuditRuleProtection( bool isProtected, bool preserveInheritance )
+        public void SetAuditRuleProtection(bool isProtected, bool preserveInheritance)
         {
             WriteLock();
 
             try
             {
-                _securityDescriptor.SetSystemAclProtection( isProtected, preserveInheritance );
+                _securityDescriptor.SetSystemAclProtection(isProtected, preserveInheritance);
                 _saclModified = true;
             }
             finally
@@ -568,13 +568,13 @@ namespace System.Security.AccessControl
             return true; // SDDL to binary conversions are supported on Windows 2000 and higher
         }
 
-        public string GetSecurityDescriptorSddlForm( AccessControlSections includeSections )
+        public string GetSecurityDescriptorSddlForm(AccessControlSections includeSections)
         {
             ReadLock();
 
             try
             {
-                return _securityDescriptor.GetSddlForm( includeSections );
+                return _securityDescriptor.GetSddlForm(includeSections);
             }
             finally
             {
@@ -582,19 +582,19 @@ namespace System.Security.AccessControl
             }
         }
 
-        public void SetSecurityDescriptorSddlForm( string sddlForm )
+        public void SetSecurityDescriptorSddlForm(string sddlForm)
         {
-            SetSecurityDescriptorSddlForm( sddlForm, AccessControlSections.All );
+            SetSecurityDescriptorSddlForm(sddlForm, AccessControlSections.All);
         }
 
-        public void SetSecurityDescriptorSddlForm( string sddlForm, AccessControlSections includeSections )
+        public void SetSecurityDescriptorSddlForm(string sddlForm, AccessControlSections includeSections)
         {
-            if ( sddlForm == null )
+            if (sddlForm == null)
             {
-                throw new ArgumentNullException( nameof(sddlForm));
+                throw new ArgumentNullException(nameof(sddlForm));
             }
 
-            if (( includeSections & AccessControlSections.All ) == 0 )
+            if ((includeSections & AccessControlSections.All) == 0)
             {
                 throw new ArgumentException(
                     SR.Arg_EnumAtLeastOneFlag,
@@ -605,7 +605,7 @@ nameof(includeSections));
 
             try
             {
-                UpdateWithNewSecurityDescriptor( new RawSecurityDescriptor( sddlForm ), includeSections );
+                UpdateWithNewSecurityDescriptor(new RawSecurityDescriptor(sddlForm), includeSections);
             }
             finally
             {
@@ -621,7 +621,7 @@ nameof(includeSections));
             {
                 byte[] result = new byte[_securityDescriptor.BinaryLength];
 
-                _securityDescriptor.GetBinaryForm( result, 0 );
+                _securityDescriptor.GetBinaryForm(result, 0);
 
                 return result;
             }
@@ -631,19 +631,19 @@ nameof(includeSections));
             }
         }
 
-        public void SetSecurityDescriptorBinaryForm( byte[] binaryForm )
+        public void SetSecurityDescriptorBinaryForm(byte[] binaryForm)
         {
-            SetSecurityDescriptorBinaryForm( binaryForm, AccessControlSections.All );
+            SetSecurityDescriptorBinaryForm(binaryForm, AccessControlSections.All);
         }
 
-        public void SetSecurityDescriptorBinaryForm( byte[] binaryForm, AccessControlSections includeSections )
+        public void SetSecurityDescriptorBinaryForm(byte[] binaryForm, AccessControlSections includeSections)
         {
-            if ( binaryForm == null )
+            if (binaryForm == null)
             {
-                throw new ArgumentNullException( nameof(binaryForm));
+                throw new ArgumentNullException(nameof(binaryForm));
             }
 
-            if (( includeSections & AccessControlSections.All ) == 0 )
+            if ((includeSections & AccessControlSections.All) == 0)
             {
                 throw new ArgumentException(
                     SR.Arg_EnumAtLeastOneFlag,
@@ -654,7 +654,7 @@ nameof(includeSections));
 
             try
             {
-                UpdateWithNewSecurityDescriptor( new RawSecurityDescriptor( binaryForm, 0 ), includeSections );
+                UpdateWithNewSecurityDescriptor(new RawSecurityDescriptor(binaryForm, 0), includeSections);
             }
             finally
             {
@@ -666,17 +666,17 @@ nameof(includeSections));
         public abstract Type AccessRuleType { get; }
         public abstract Type AuditRuleType { get; }
 
-        protected abstract bool ModifyAccess( AccessControlModification modification, AccessRule rule, out bool modified);
-        protected abstract bool ModifyAudit( AccessControlModification modification, AuditRule rule, out bool modified );
+        protected abstract bool ModifyAccess(AccessControlModification modification, AccessRule rule, out bool modified);
+        protected abstract bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified);
 
         public virtual bool ModifyAccessRule(AccessControlModification modification, AccessRule rule, out bool modified)
         {
-            if ( rule == null )
+            if (rule == null)
             {
-                throw new ArgumentNullException( nameof(rule));
+                throw new ArgumentNullException(nameof(rule));
             }
 
-            if ( !this.AccessRuleType.GetTypeInfo().IsAssignableFrom(rule.GetType().GetTypeInfo()) )
+            if (!this.AccessRuleType.GetTypeInfo().IsAssignableFrom(rule.GetType().GetTypeInfo()))
             {
                 throw new ArgumentException(
                     SR.AccessControl_InvalidAccessRuleType,
@@ -697,12 +697,12 @@ nameof(rule));
 
         public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified)
         {
-            if ( rule == null )
+            if (rule == null)
             {
-                throw new ArgumentNullException( nameof(rule));
+                throw new ArgumentNullException(nameof(rule));
             }
 
-            if ( !this.AuditRuleType.GetTypeInfo().IsAssignableFrom(rule.GetType().GetTypeInfo()) )
+            if (!this.AuditRuleType.GetTypeInfo().IsAssignableFrom(rule.GetType().GetTypeInfo()))
             {
                 throw new ArgumentException(
                     SR.AccessControl_InvalidAuditRuleType,
@@ -721,9 +721,9 @@ nameof(rule));
             }
         }
 
-        public abstract AccessRule AccessRuleFactory( IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type );
+        public abstract AccessRule AccessRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type);
 
-        public abstract AuditRule AuditRuleFactory( IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags );
+        public abstract AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags);
         #endregion
     }
 }
index 75bbc9f..4d3b8fd 100644 (file)
@@ -12,8 +12,8 @@ namespace System.Security.AccessControl
 
     public enum AccessControlType
     {
-        Allow          = 0,
-        Deny           = 1,
+        Allow = 0,
+        Deny = 1,
     }
 
 
@@ -36,32 +36,28 @@ namespace System.Security.AccessControl
             int accessMask,
             bool isInherited,
             InheritanceFlags inheritanceFlags,
-            PropagationFlags propagationFlags )
+            PropagationFlags propagationFlags)
         {
-            if ( identity == null )
+            if (identity == null)
             {
-                throw new ArgumentNullException( nameof(identity));
+                throw new ArgumentNullException(nameof(identity));
             }
 
-            if ( accessMask == 0 )
+            if (accessMask == 0)
             {
-                throw new ArgumentException(
-                    SR.Argument_ArgumentZero,
-nameof(accessMask));
+                throw new ArgumentException(SR.Argument_ArgumentZero, nameof(accessMask));
             }
 
-            if ( inheritanceFlags < InheritanceFlags.None || inheritanceFlags > (InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit) )
+            if (inheritanceFlags < InheritanceFlags.None || inheritanceFlags > (InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit))
             {
                 throw new ArgumentOutOfRangeException(
-nameof(inheritanceFlags),
-                    SR.Format( SR.Argument_InvalidEnumValue, inheritanceFlags, "InheritanceFlags" ));
+                    nameof(inheritanceFlags), SR.Format(SR.Argument_InvalidEnumValue, inheritanceFlags, "InheritanceFlags"));
             }
 
-            if ( propagationFlags < PropagationFlags.None || propagationFlags > (PropagationFlags.NoPropagateInherit | PropagationFlags.InheritOnly) )
+            if (propagationFlags < PropagationFlags.None || propagationFlags > (PropagationFlags.NoPropagateInherit | PropagationFlags.InheritOnly))
             {
                 throw new ArgumentOutOfRangeException(
-nameof(propagationFlags),
-                    SR.Format(SR.Argument_InvalidEnumValue, inheritanceFlags, "PropagationFlags"));
+                    nameof(propagationFlags), SR.Format(SR.Argument_InvalidEnumValue, inheritanceFlags, "PropagationFlags"));
             }
 
             if (identity.IsValidTargetType(typeof(SecurityIdentifier)) == false)
@@ -76,7 +72,7 @@ nameof(identity));
             _isInherited = isInherited;
             _inheritanceFlags = inheritanceFlags;
 
-            if ( inheritanceFlags != 0 )
+            if (inheritanceFlags != 0)
             {
                 _propagationFlags = propagationFlags;
             }
@@ -135,29 +131,25 @@ nameof(identity));
             bool isInherited,
             InheritanceFlags inheritanceFlags,
             PropagationFlags propagationFlags,
-            AccessControlType type )
-            : base( identity, accessMask, isInherited, inheritanceFlags, propagationFlags )
+            AccessControlType type)
+            : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags)
         {
-            if ( type != AccessControlType.Allow &&
-                type != AccessControlType.Deny )
+            if (type != AccessControlType.Allow &&
+                type != AccessControlType.Deny)
             {
-                throw new ArgumentOutOfRangeException(
-nameof(type),
-                     SR.ArgumentOutOfRange_Enum );
+                throw new ArgumentOutOfRangeException(nameof(type), SR.ArgumentOutOfRange_Enum);
             }
 
-            if ( inheritanceFlags < InheritanceFlags.None || inheritanceFlags > (InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit) )
+            if (inheritanceFlags < InheritanceFlags.None || inheritanceFlags > (InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit))
             {
                 throw new ArgumentOutOfRangeException(
-nameof(inheritanceFlags),
-                    SR.Format(SR.Argument_InvalidEnumValue, inheritanceFlags, "InheritanceFlags"));
+                    nameof(inheritanceFlags), SR.Format(SR.Argument_InvalidEnumValue, inheritanceFlags, "InheritanceFlags"));
             }
 
-            if ( propagationFlags < PropagationFlags.None || propagationFlags > (PropagationFlags.NoPropagateInherit | PropagationFlags.InheritOnly) )
+            if (propagationFlags < PropagationFlags.None || propagationFlags > (PropagationFlags.NoPropagateInherit | PropagationFlags.InheritOnly))
             {
                 throw new ArgumentOutOfRangeException(
-nameof(propagationFlags),
-                    SR.Format(SR.Argument_InvalidEnumValue, inheritanceFlags, "PropagationFlags"));
+                    nameof(propagationFlags), SR.Format(SR.Argument_InvalidEnumValue, inheritanceFlags, "PropagationFlags"));
             }
 
             _type = type;
@@ -176,7 +168,7 @@ nameof(propagationFlags),
     }
 
 
-    public abstract class ObjectAccessRule: AccessRule
+    public abstract class ObjectAccessRule : AccessRule
     {
         #region Private Members
 
@@ -188,10 +180,10 @@ nameof(propagationFlags),
 
         #region Constructors
 
-        protected ObjectAccessRule( IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid objectType, Guid inheritedObjectType, AccessControlType type )
-            : base( identity, accessMask, isInherited, inheritanceFlags, propagationFlags, type )
+        protected ObjectAccessRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid objectType, Guid inheritedObjectType, AccessControlType type)
+            : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, type)
         {
-            if (( !objectType.Equals( Guid.Empty )) && (( accessMask & ObjectAce.AccessMaskWithObjectType ) != 0 ))
+            if ((!objectType.Equals(Guid.Empty)) && ((accessMask & ObjectAce.AccessMaskWithObjectType) != 0))
             {
                 _objectType = objectType;
                 _objectFlags |= ObjectAceFlags.ObjectAceTypePresent;
@@ -201,7 +193,7 @@ nameof(propagationFlags),
                 _objectType = Guid.Empty;
             }
 
-            if (( !inheritedObjectType.Equals( Guid.Empty )) && ((inheritanceFlags & InheritanceFlags.ContainerInherit ) != 0 ))
+            if ((!inheritedObjectType.Equals(Guid.Empty)) && ((inheritanceFlags & InheritanceFlags.ContainerInherit) != 0))
             {
                 _inheritedObjectType = inheritedObjectType;
                 _objectFlags |= ObjectAceFlags.InheritedObjectAceTypePresent;
@@ -251,16 +243,16 @@ nameof(propagationFlags),
             bool isInherited,
             InheritanceFlags inheritanceFlags,
             PropagationFlags propagationFlags,
-            AuditFlags auditFlags )
-            : base( identity, accessMask, isInherited, inheritanceFlags, propagationFlags )
+            AuditFlags auditFlags)
+            : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags)
         {
-            if ( auditFlags == AuditFlags.None )
+            if (auditFlags == AuditFlags.None)
             {
                 throw new ArgumentException(SR.Arg_EnumAtLeastOneFlag, nameof(auditFlags));
             }
-            else if (( auditFlags & ~( AuditFlags.Success | AuditFlags.Failure )) != 0 )
+            else if ((auditFlags & ~(AuditFlags.Success | AuditFlags.Failure)) != 0)
             {
-                throw new ArgumentOutOfRangeException(nameof(auditFlags), SR.ArgumentOutOfRange_Enum );
+                throw new ArgumentOutOfRangeException(nameof(auditFlags), SR.ArgumentOutOfRange_Enum);
             }
 
             _flags = auditFlags;
@@ -279,7 +271,7 @@ nameof(propagationFlags),
     }
 
 
-    public abstract class ObjectAuditRule: AuditRule
+    public abstract class ObjectAuditRule : AuditRule
     {
         #region Private Members
 
@@ -291,11 +283,11 @@ nameof(propagationFlags),
 
         #region Constructors
 
-        protected ObjectAuditRule( IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid objectType, Guid inheritedObjectType, AuditFlags auditFlags )
-            : base( identity, accessMask, isInherited, inheritanceFlags, propagationFlags, auditFlags )
+        protected ObjectAuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid objectType, Guid inheritedObjectType, AuditFlags auditFlags)
+            : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, auditFlags)
         {
 
-            if (( !objectType.Equals( Guid.Empty )) && (( accessMask & ObjectAce.AccessMaskWithObjectType ) != 0 ))
+            if ((!objectType.Equals(Guid.Empty)) && ((accessMask & ObjectAce.AccessMaskWithObjectType) != 0))
             {
                 _objectType = objectType;
                 _objectFlags |= ObjectAceFlags.ObjectAceTypePresent;
@@ -305,7 +297,7 @@ nameof(propagationFlags),
                 _objectType = Guid.Empty;
             }
 
-            if (( !inheritedObjectType.Equals( Guid.Empty )) && ((inheritanceFlags & InheritanceFlags.ContainerInherit ) != 0 ))
+            if ((!inheritedObjectType.Equals(Guid.Empty)) && ((inheritanceFlags & InheritanceFlags.ContainerInherit) != 0))
             {
                 _inheritedObjectType = inheritedObjectType;
                 _objectFlags |= ObjectAceFlags.InheritedObjectAceTypePresent;
@@ -355,16 +347,16 @@ nameof(propagationFlags),
 
         public void AddRule(AuthorizationRule rule)
         {
-            InnerList.Add( rule );
+            InnerList.Add(rule);
         }
 
         #endregion
 
         #region ICollection Members
 
-        public void CopyTo( AuthorizationRule[] rules, int index )
+        public void CopyTo(AuthorizationRule[] rules, int index)
         {
-            (( ICollection )this ).CopyTo( rules, index );
+            ((ICollection)this).CopyTo(rules, index);
         }
 
         #endregion
index 9a544f1..da3dfac 100644 (file)
@@ -6,8 +6,8 @@ namespace System.Security.Cryptography
 {
     public abstract class AsymmetricKeyExchangeDeformatter
     {
-        protected AsymmetricKeyExchangeDeformatter() {}
-        public abstract string Parameters {get; set; }
+        protected AsymmetricKeyExchangeDeformatter() { }
+        public abstract string Parameters { get; set; }
         public abstract void SetKey(AsymmetricAlgorithm key);
         public abstract byte[] DecryptKeyExchange(byte[] rgb);
     }
index 4c5bfbb..42b37ce 100644 (file)
@@ -6,9 +6,9 @@ namespace System.Security.Cryptography
 {
     public abstract class AsymmetricKeyExchangeFormatter
     {
-        protected AsymmetricKeyExchangeFormatter() {}
+        protected AsymmetricKeyExchangeFormatter() { }
 
-        public abstract string Parameters {get; }
+        public abstract string Parameters { get; }
 
         public abstract void SetKey(AsymmetricAlgorithm key);
         public abstract byte[] CreateKeyExchange(byte[] data);
index 014ce94..91feca9 100644 (file)
@@ -8,7 +8,7 @@ namespace System.Security.Cryptography
 {
     public abstract class AsymmetricSignatureDeformatter
     {
-        protected AsymmetricSignatureDeformatter() {}
+        protected AsymmetricSignatureDeformatter() { }
 
         public abstract void SetKey(AsymmetricAlgorithm key);
         public abstract void SetHashAlgorithm(string strName);
index 24fdad5..ec2bcbd 100644 (file)
@@ -8,7 +8,7 @@ namespace System.Security.Cryptography
 {
     public abstract class AsymmetricSignatureFormatter
     {
-        protected AsymmetricSignatureFormatter() {}
+        protected AsymmetricSignatureFormatter() { }
 
         public abstract void SetKey(AsymmetricAlgorithm key);
         public abstract void SetHashAlgorithm(string strName);
index ca0f876..df67717 100644 (file)
@@ -45,10 +45,11 @@ namespace System.Security.Cryptography
 
         public override string Parameters
         {
-            get {return null; }
+            get { return null; }
         }
 
-        public RandomNumberGenerator Rng {
+        public RandomNumberGenerator Rng
+        {
             get { return RngValue; }
             set { RngValue = value; }
         }
index 38785e0..d69b14c 100644 (file)
@@ -19,14 +19,15 @@ namespace System.Security.Cryptography
             _rsaKey = (RSA)key;
         }
 
-        public RandomNumberGenerator RNG {
+        public RandomNumberGenerator RNG
+        {
             get { return RngValue; }
             set { RngValue = value; }
         }
 
         public override string Parameters
         {
-            get {return null; }
+            get { return null; }
             set { }
         }
 
index 2353f87..37f541e 100644 (file)
@@ -27,7 +27,8 @@ namespace System.Security.Cryptography
             }
         }
 
-        public RandomNumberGenerator Rng {
+        public RandomNumberGenerator Rng
+        {
             get { return RngValue; }
             set { RngValue = value; }
         }
index f21b8d1..74c9f74 100644 (file)
@@ -13,7 +13,7 @@ namespace System.Security.Cryptography
     {
         protected TripleDES()
         {
-            KeySizeValue = 3*64;
+            KeySizeValue = 3 * 64;
             BlockSizeValue = 64;
             FeedbackSizeValue = BlockSizeValue;
             LegalBlockSizesValue = s_legalBlockSizes.CloneKeySizesArray();
@@ -48,7 +48,7 @@ namespace System.Security.Cryptography
                 if (value == null)
                     throw new ArgumentNullException(nameof(value));
 
-                if (!(value.Length*8).IsLegalSize(s_legalKeySizes))
+                if (!(value.Length * 8).IsLegalSize(s_legalKeySizes))
                     throw new ArgumentException(SR.Cryptography_InvalidKeySize);
 
                 if (IsWeakKey(value))
@@ -63,7 +63,7 @@ namespace System.Security.Cryptography
             if (rgbKey == null)
                 throw new CryptographicException(SR.Cryptography_InvalidKeySize);  // Desktop compat: Strange exception for a null value, but this is what we threw in classic CLR.
 
-            if (!(rgbKey.Length*8).IsLegalSize(s_legalKeySizes))
+            if (!(rgbKey.Length * 8).IsLegalSize(s_legalKeySizes))
                 throw new CryptographicException(SR.Cryptography_InvalidKeySize);
 
             byte[] rgbOddParityKey = rgbKey.FixupKeyParity();
index 1f87e6d..783e807 100644 (file)
@@ -56,7 +56,8 @@ namespace System.Security.Cryptography
                     CngKey key = _core.GetOrGenerateKey(curve);
                     ForceSetKeySize(key.KeySize);
                 }
-                else {
+                else
+                {
                     int keySize = 0;
                     // Get the proper KeySize from algorithm name
                     if (alg == CngAlgorithm.ECDsaP256)
index 59b8efc..1fa90d5 100644 (file)
@@ -196,7 +196,7 @@ namespace System.Security.Cryptography
         /// <summary>
         /// Read a parameter from the current key using CRYPT_SILENT, to avoid any potential UI prompts.
         /// </summary>
-        private object ReadKeyParameterSilent(int keyParam, bool throwOnNotFound=true)
+        private object ReadKeyParameterSilent(int keyParam, bool throwOnNotFound = true)
         {
             const uint SilentFlags = (uint)Interop.Advapi32.CryptAcquireContextFlags.CRYPT_SILENT;
 
index f1da5bf..d8af32d 100644 (file)
@@ -11,7 +11,7 @@ namespace System.Security.Cryptography
     {
         private readonly RandomNumberGenerator _impl;
 
-        public RNGCryptoServiceProvider() : this((CspParameters) null) { }
+        public RNGCryptoServiceProvider() : this((CspParameters)null) { }
         public RNGCryptoServiceProvider(string str) : this((CspParameters)null) { }
         public RNGCryptoServiceProvider(byte[] rgb) : this((CspParameters)null) { }
 
index b7bbc36..1596457 100644 (file)
@@ -93,7 +93,7 @@ namespace System.Security.Cryptography
             if (index < 0 || index >= array.Length)
                 throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
 
-             _list.CopyTo(array, index);
+            _list.CopyTo(array, index);
         }
 
         public bool IsSynchronized
index 1d6221f..37e4a5d 100644 (file)
@@ -139,7 +139,8 @@ namespace Internal.Cryptography.Pal.AnyOS
                     break;
             }
 
-            return new AlgorithmIdentifier(new Oid(asn.Algorithm), keyLength) {
+            return new AlgorithmIdentifier(new Oid(asn.Algorithm), keyLength)
+            {
                 Parameters = parameters
             };
         }
index 334007b..e5a1541 100644 (file)
@@ -15,7 +15,7 @@ using X509IssuerSerial = System.Security.Cryptography.Xml.X509IssuerSerial;
 
 using Microsoft.Win32.SafeHandles;
 
-using CryptProvParam=Interop.Advapi32.CryptProvParam;
+using CryptProvParam = Interop.Advapi32.CryptProvParam;
 using static Interop.Crypt32;
 
 namespace Internal.Cryptography.Pal.Windows
index 84b073c..1cedc0d 100644 (file)
@@ -120,7 +120,7 @@ namespace Internal.Cryptography
 
         public static AttributeAsn[] NormalizeAttributeSet(
             AttributeAsn[] setItems,
-            Action<byte[]> encodedValueProcessor=null)
+            Action<byte[]> encodedValueProcessor = null)
         {
             byte[] normalizedValue;
 
index 6bb5cb3..69bfefb 100644 (file)
@@ -17,9 +17,9 @@ namespace System.Security.Cryptography.Pkcs
         }
 
 #if netstandard
-internal
+        internal
 #else
-public
+        public
 #endif
         CmsRecipient(X509Certificate2 certificate, RSAEncryptionPadding rsaEncryptionPadding)
             : this(certificate)
@@ -29,9 +29,9 @@ public
         }
 
 #if netstandard
-internal
+        internal
 #else
-public
+        public
 #endif
         CmsRecipient(SubjectIdentifierType recipientIdentifierType, X509Certificate2 certificate, RSAEncryptionPadding rsaEncryptionPadding)
             : this(recipientIdentifierType, certificate)
@@ -63,9 +63,9 @@ public
         }
 
 #if netstandard
-internal
+        internal
 #else
-public
+        public
 #endif
         RSAEncryptionPadding? RSAEncryptionPadding { get; }
         public SubjectIdentifierType RecipientIdentifierType { get; }
index 0c0972b..aa1c250 100644 (file)
@@ -6,7 +6,7 @@ namespace System.Security.Cryptography.Pkcs
 {
     public sealed class Pkcs12KeyBag : Pkcs12SafeBag
     {
-        public Pkcs12KeyBag(ReadOnlyMemory<byte> pkcs8PrivateKey, bool skipCopy=false)
+        public Pkcs12KeyBag(ReadOnlyMemory<byte> pkcs8PrivateKey, bool skipCopy = false)
             : base(Oids.Pkcs12KeyBag, pkcs8PrivateKey, skipCopy)
         {
         }
index 7d3b7ed..1d2c719 100644 (file)
@@ -35,7 +35,7 @@ namespace System.Security.Cryptography.Pkcs
             }
         }
 
-        protected Pkcs12SafeBag(string bagIdValue, ReadOnlyMemory<byte> encodedBagValue, bool skipCopy=false)
+        protected Pkcs12SafeBag(string bagIdValue, ReadOnlyMemory<byte> encodedBagValue, bool skipCopy = false)
         {
             if (string.IsNullOrEmpty(bagIdValue))
                 throw new ArgumentNullException(nameof(bagIdValue));
index e359939..db72f37 100644 (file)
@@ -6,7 +6,7 @@ namespace System.Security.Cryptography.Pkcs
 {
     public sealed class Pkcs12ShroudedKeyBag : Pkcs12SafeBag
     {
-        public Pkcs12ShroudedKeyBag(ReadOnlyMemory<byte> encryptedPkcs8PrivateKey, bool skipCopy=false)
+        public Pkcs12ShroudedKeyBag(ReadOnlyMemory<byte> encryptedPkcs8PrivateKey, bool skipCopy = false)
             : base(Oids.Pkcs12ShroudedKeyBag, encryptedPkcs8PrivateKey, skipCopy)
         {
         }
index e1c6cd5..2b59fee 100644 (file)
@@ -15,8 +15,8 @@ namespace System.Security.Cryptography
     {
         CBC = 1,
         ECB = 2,
-        [EditorBrowsable(EditorBrowsableState.Never)]OFB = 3,
-        [EditorBrowsable(EditorBrowsableState.Never)]CFB = 4,
+        [EditorBrowsable(EditorBrowsableState.Never)] OFB = 3,
+        [EditorBrowsable(EditorBrowsableState.Never)] CFB = 4,
         CTS = 5
     }
 }
index b0a3c56..2e8f7bc 100644 (file)
@@ -55,7 +55,7 @@ namespace System.Security.Cryptography
                 throw new ObjectDisposedException(null);
             }
 
-            if (destination.Length < HashSizeValue/8)
+            if (destination.Length < HashSizeValue / 8)
             {
                 bytesWritten = 0;
                 return false;
index 803491b..6d1b4bc 100644 (file)
@@ -76,7 +76,7 @@ namespace Internal.Cryptography.Pal
 
                 byte[] thumbprint = new byte[cbData];
                 if (!Interop.crypt32.CertGetCertificateContextProperty(_certContext, CertContextPropId.CERT_SHA1_HASH_PROP_ID, thumbprint, ref cbData))
-                    throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                    throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
                 return thumbprint;
             }
         }
@@ -151,14 +151,14 @@ namespace Internal.Cryptography.Pal
                         CERT_CHAIN_PARA chainPara = new CERT_CHAIN_PARA();
                         chainPara.cbSize = sizeof(CERT_CHAIN_PARA);
                         if (!Interop.crypt32.CertGetCertificateChain(ChainEngine.HCCE_CURRENT_USER, _certContext, (FILETIME*)null, SafeCertStoreHandle.InvalidHandle, ref chainPara, CertChainFlags.None, IntPtr.Zero, out certChainContext))
-                            throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                            throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
                         if (!Interop.crypt32.CertGetCertificateContextProperty(_certContext, CertContextPropId.CERT_PUBKEY_ALG_PARA_PROP_ID, null, ref cbData))
-                            throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                            throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
                     }
 
                     byte[] keyAlgorithmParameters = new byte[cbData];
                     if (!Interop.crypt32.CertGetCertificateContextProperty(_certContext, CertContextPropId.CERT_PUBKEY_ALG_PARA_PROP_ID, keyAlgorithmParameters, ref cbData))
-                        throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                        throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
 
                     return keyAlgorithmParameters;
                 }
@@ -546,7 +546,7 @@ namespace Internal.Cryptography.Pal
         {
             using (IExportPal storePal = StorePal.FromCertificate(this))
             {
-                return storePal.Export (contentType, password);
+                return storePal.Export(contentType, password);
             }
         }
     }
index 0adbadf..a03e97e 100644 (file)
@@ -66,7 +66,7 @@ namespace Internal.Cryptography.Pal
         public void FindBySubjectDistinguishedName(string subjectDistinguishedName)
         {
             FindCore(
-                delegate(SafeCertContextHandle pCertContext)
+                delegate (SafeCertContextHandle pCertContext)
                 {
                     string actual = GetCertNameInfo(pCertContext, CertNameType.CERT_NAME_RDN_TYPE, CertNameFlags.None);
                     return subjectDistinguishedName.Equals(actual, StringComparison.OrdinalIgnoreCase);
@@ -84,7 +84,7 @@ namespace Internal.Cryptography.Pal
         public void FindByIssuerDistinguishedName(string issuerDistinguishedName)
         {
             FindCore(
-                delegate(SafeCertContextHandle pCertContext)
+                delegate (SafeCertContextHandle pCertContext)
                 {
                     string actual = GetCertNameInfo(pCertContext, CertNameType.CERT_NAME_RDN_TYPE, CertNameFlags.CERT_NAME_ISSUER_FLAG);
                     return issuerDistinguishedName.Equals(actual, StringComparison.OrdinalIgnoreCase);
@@ -94,7 +94,7 @@ namespace Internal.Cryptography.Pal
         public unsafe void FindBySerialNumber(BigInteger hexValue, BigInteger decimalValue)
         {
             FindCore(
-                delegate(SafeCertContextHandle pCertContext)
+                delegate (SafeCertContextHandle pCertContext)
                 {
                     byte[] actual = pCertContext.CertContext->pCertInfo->SerialNumber.ToByteArray();
                     GC.KeepAlive(pCertContext);
@@ -126,7 +126,7 @@ namespace Internal.Cryptography.Pal
             FILETIME fileTime = FILETIME.FromDateTime(dateTime);
 
             FindCore(
-                delegate(SafeCertContextHandle pCertContext)
+                delegate (SafeCertContextHandle pCertContext)
                 {
                     int comparison = Interop.crypt32.CertVerifyTimeValidity(ref fileTime,
                         pCertContext.CertContext->pCertInfo);
@@ -138,7 +138,7 @@ namespace Internal.Cryptography.Pal
         public unsafe void FindByTemplateName(string templateName)
         {
             FindCore(
-                delegate(SafeCertContextHandle pCertContext)
+                delegate (SafeCertContextHandle pCertContext)
                 {
                     // The template name can have 2 different formats: V1 format (<= Win2K) is just a string
                     // V2 format (XP only) can be a friendly name or an OID.
@@ -154,7 +154,7 @@ namespace Internal.Cryptography.Pal
                             byte[] extensionRawData = pV1Template->Value.ToByteArray();
                             if (!extensionRawData.DecodeObjectNoThrow(
                                 CryptDecodeObjectStructType.X509_UNICODE_ANY_STRING,
-                                delegate(void* pvDecoded, int cbDecoded)
+                                delegate (void* pvDecoded, int cbDecoded)
                                 {
                                     Debug.Assert(cbDecoded >= sizeof(CERT_NAME_VALUE));
                                     CERT_NAME_VALUE* pNameValue = (CERT_NAME_VALUE*)pvDecoded;
@@ -177,7 +177,7 @@ namespace Internal.Cryptography.Pal
                             byte[] extensionRawData = pV2Template->Value.ToByteArray();
                             if (!extensionRawData.DecodeObjectNoThrow(
                                 CryptDecodeObjectStructType.X509_CERTIFICATE_TEMPLATE,
-                                delegate(void* pvDecoded, int cbDecoded)
+                                delegate (void* pvDecoded, int cbDecoded)
                                 {
                                     Debug.Assert(cbDecoded >= sizeof(CERT_TEMPLATE_EXT));
                                     CERT_TEMPLATE_EXT* pTemplateExt = (CERT_TEMPLATE_EXT*)pvDecoded;
@@ -235,7 +235,7 @@ namespace Internal.Cryptography.Pal
         public unsafe void FindByCertificatePolicy(string oidValue)
         {
             FindCore(
-                delegate(SafeCertContextHandle pCertContext)
+                delegate (SafeCertContextHandle pCertContext)
                 {
                     CERT_INFO* pCertInfo = pCertContext.CertContext->pCertInfo;
                     CERT_EXTENSION* pCertExtension = Interop.crypt32.CertFindExtension(Oids.CertPolicies,
@@ -247,7 +247,7 @@ namespace Internal.Cryptography.Pal
                     byte[] extensionRawData = pCertExtension->Value.ToByteArray();
                     if (!extensionRawData.DecodeObjectNoThrow(
                         CryptDecodeObjectStructType.X509_CERT_POLICIES,
-                        delegate(void* pvDecoded, int cbDecoded)
+                        delegate (void* pvDecoded, int cbDecoded)
                         {
                             Debug.Assert(cbDecoded >= sizeof(CERT_POLICIES_INFO));
                             CERT_POLICIES_INFO* pCertPoliciesInfo = (CERT_POLICIES_INFO*)pvDecoded;
index e58698b..c85ee8f 100644 (file)
@@ -58,11 +58,11 @@ namespace Internal.Cryptography.Pal
                         {
                             int cbEncoded = 0;
                             if (!Interop.crypt32.CertSerializeCertificateStoreElement(pCertContext, 0, null, ref cbEncoded))
-                                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
 
                             byte[] pbEncoded = new byte[cbEncoded];
                             if (!Interop.crypt32.CertSerializeCertificateStoreElement(pCertContext, 0, pbEncoded, ref cbEncoded))
-                                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
 
                             return pbEncoded;
                         }
@@ -79,14 +79,14 @@ namespace Internal.Cryptography.Pal
                             CRYPTOAPI_BLOB dataBlob = new CRYPTOAPI_BLOB(0, (byte*)null);
 
                             if (!Interop.crypt32.PFXExportCertStore(_certStore, ref dataBlob, password, PFXExportFlags.EXPORT_PRIVATE_KEYS | PFXExportFlags.REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY))
-                                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
 
                             byte[] pbEncoded = new byte[dataBlob.cbData];
                             fixed (byte* ppbEncoded = pbEncoded)
                             {
                                 dataBlob.pbData = ppbEncoded;
                                 if (!Interop.crypt32.PFXExportCertStore(_certStore, ref dataBlob, password, PFXExportFlags.EXPORT_PRIVATE_KEYS | PFXExportFlags.REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY))
-                                    throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                                    throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
                             }
 
                             return pbEncoded;
index 69c9425..59dd24d 100644 (file)
@@ -111,9 +111,9 @@ namespace Internal.Cryptography.Pal
                 CertStoreFlags.CERT_STORE_ENUM_ARCHIVED_FLAG | CertStoreFlags.CERT_STORE_CREATE_NEW_FLAG | CertStoreFlags.CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG,
                 null);
             if (certStore.IsInvalid)
-                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
             if (!Interop.crypt32.CertAddCertificateLinkToStore(certStore, certificatePal.CertContext, CertStoreAddDisposition.CERT_STORE_ADD_ALWAYS, IntPtr.Zero))
-                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
             return new StorePal(certStore);
         }
 
@@ -133,7 +133,7 @@ namespace Internal.Cryptography.Pal
                 CertStoreFlags.CERT_STORE_ENUM_ARCHIVED_FLAG | CertStoreFlags.CERT_STORE_CREATE_NEW_FLAG,
                 null);
             if (certStore.IsInvalid)
-                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
 
             //
             // We use CertAddCertificateLinkToStore to keep a link to the original store, so any property changes get
index 1fc1910..8d5bd7f 100644 (file)
@@ -79,7 +79,7 @@ namespace Internal.Cryptography.Pal
 
         internal SafeCertStoreHandle SafeCertStoreHandle
         {
-            get {return _certStore; }
+            get { return _certStore; }
         }
 
         SafeHandle IStorePal.SafeHandle
index a59f5e5..1395164 100644 (file)
@@ -250,7 +250,7 @@ namespace Internal.Cryptography.Pal
                             int cb = 20;
                             byte[] buffer = new byte[cb];
                             if (!Interop.crypt32.CryptHashPublicKeyInfo(IntPtr.Zero, AlgId.CALG_SHA1, 0, CertEncodingType.All, ref publicKeyInfo, buffer, ref cb))
-                                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();;
+                                throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
                             if (cb < buffer.Length)
                             {
                                 byte[] newBuffer = new byte[cb];
index b105981..8796d30 100644 (file)
@@ -71,7 +71,7 @@ namespace System.Security.Cryptography.X509Certificates
             AddGeneralName(new GeneralNameAsn { OtherName = otherName });
         }
 
-        public X509Extension Build(bool critical=false)
+        public X509Extension Build(bool critical = false)
         {
             using (AsnWriter writer = new AsnWriter(AsnEncodingRules.DER))
             {
index 893a1ef..8587854 100644 (file)
@@ -113,7 +113,7 @@ namespace System.Security.Cryptography.X509Certificates
             base.OnValidate(value);
 
             if (!(value is X509Certificate))
-              throw new ArgumentException(SR.Arg_InvalidType, nameof(value));
+                throw new ArgumentException(SR.Arg_InvalidType, nameof(value));
         }
     }
 }
index 9030990..bda82f3 100644 (file)
@@ -31,7 +31,8 @@ namespace System.Security.Cryptography.X509Certificates
             _chainElements = new X509ChainElementCollection(_pal.ChainElements);
         }
 
-        public static X509Chain Create() {
+        public static X509Chain Create()
+        {
             return new X509Chain();
         }
 
index 850fc11..5d50f48 100644 (file)
@@ -65,7 +65,7 @@ namespace System.Security.Cryptography.Xml
         private XmlResolver _xmlResolver;
         // hash table defining the key name mapping
         private const int _capacity = 4; // 4 is a reasonable capacity for
-                                          // the key name mapping hash table
+                                         // the key name mapping hash table
         private readonly Hashtable _keyNameMapping;
         private PaddingMode _padding;
         private CipherMode _mode;
index 67a4b87..0d4ef3b 100644 (file)
@@ -66,7 +66,7 @@ namespace System.Security.Cryptography.Xml
                         throw new CryptographicException(SR.Cryptography_Partial_Chain);
                     }
 
-                elements = (X509ChainElementCollection)chain.ChainElements;
+                    elements = (X509ChainElementCollection)chain.ChainElements;
                     for (int index = 0; index < (Utils.IsSelfSigned(chain) ? 1 : elements.Count - 1); index++)
                     {
                         AddCertificate(elements[index].Certificate);
index b4e896c..5b49602 100644 (file)
@@ -727,7 +727,7 @@ namespace System.Security.Cryptography.Xml
             return collection;
         }
 
-        private static readonly char[] s_hexValues = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+        private static readonly char[] s_hexValues = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
         internal static string EncodeHexString(byte[] sArray)
         {
             return EncodeHexString(sArray, 0, (uint)sArray.Length);
index 676be60..9cc2777 100644 (file)
@@ -603,7 +603,7 @@ namespace System.ServiceModel.Syndication
             {
                 foreach (XmlQualifiedName attr in attrs.Keys)
                 {
-                    Debug.Assert(!FeedUtils.IsXmlns(attr.Name, attr.Namespace), "XML namespace attributes should not be added to the list." );
+                    Debug.Assert(!FeedUtils.IsXmlns(attr.Name, attr.Namespace), "XML namespace attributes should not be added to the list.");
                     result.AttributeExtensions.Add(attr, attrs[attr]);
                 }
             }
index 9b5e0c3..f5eada8 100644 (file)
@@ -143,7 +143,7 @@ namespace System.ServiceModel.Syndication
 
         public IEnumerable<SyndicationItem> Items
         {
-            get =>_items ?? (_items = new NullNotAllowedCollection<SyndicationItem>());
+            get => _items ?? (_items = new NullNotAllowedCollection<SyndicationItem>());
             set => _items = value ?? throw new ArgumentNullException(nameof(value));
         }
 
@@ -171,7 +171,7 @@ namespace System.ServiceModel.Syndication
 
         public Collection<SyndicationLink> Links
         {
-            get =>_links ?? (_links = new NullNotAllowedCollection<SyndicationLink>());
+            get => _links ?? (_links = new NullNotAllowedCollection<SyndicationLink>());
         }
 
         public TextSyndicationContent Title { get; set; }
index a000430..b9c7367 100644 (file)
@@ -237,7 +237,7 @@ namespace System.ServiceProcess
         /// <devdoc>
         /// can be used to write notification of service command calls, such as Start and Stop, to the Application event log. This property is read-only.
         /// </devdoc>
-        [Browsable (false), DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
         public virtual EventLog EventLog
         {
             get
index ba5f5be..ba1fc9a 100644 (file)
@@ -96,7 +96,7 @@ namespace System.Text
                 throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array);
 
             if (index < 0 || count < 0)
-                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index): nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (bytes.Length - index < count)
                 throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer);
@@ -138,10 +138,10 @@ namespace System.Text
         {
             // Validate Parameters
             if (bytes == null || chars == null)
-                throw new ArgumentNullException(bytes == null ? nameof(bytes): nameof(chars), SR.ArgumentNull_Array);
+                throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), SR.ArgumentNull_Array);
 
             if (byteIndex < 0 || byteCount < 0)
-                throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex): nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (bytes.Length - byteIndex < byteCount)
                 throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer);
@@ -159,10 +159,9 @@ namespace System.Text
 
             // Just call pointer version
             fixed (byte* pBytes = &bytes[0])
-                fixed (char* pChars = &chars[0])
-                    // Remember that charCount is # to decode, not size of array
-                    return GetChars(pBytes + byteIndex, byteCount,
-                                    pChars + charIndex, charCount, flush);
+            fixed (char* pChars = &chars[0])
+                // Remember that charCount is # to decode, not size of array
+                return GetChars(pBytes + byteIndex, byteCount, pChars + charIndex, charCount, flush);
         }
 
         public override unsafe int GetChars(byte* bytes, int byteCount,
@@ -170,10 +169,10 @@ namespace System.Text
         {
             // Validate parameters
             if (chars == null || bytes == null)
-                throw new ArgumentNullException((chars == null ? nameof(chars): nameof(bytes)), SR.ArgumentNull_Array);
+                throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), SR.ArgumentNull_Array);
 
             if (byteCount < 0 || charCount < 0)
-                throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount): nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             // Remember our flush
             m_mustFlush = flush;
@@ -191,13 +190,13 @@ namespace System.Text
         {
             // Validate parameters
             if (bytes == null || chars == null)
-                throw new ArgumentNullException((bytes == null ? nameof(bytes): nameof(chars)), SR.ArgumentNull_Array);
+                throw new ArgumentNullException((bytes == null ? nameof(bytes) : nameof(chars)), SR.ArgumentNull_Array);
 
             if (byteIndex < 0 || byteCount < 0)
-                throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex): nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (charIndex < 0 || charCount < 0)
-                throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex): nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (bytes.Length - byteIndex < byteCount)
                 throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer);
@@ -230,10 +229,10 @@ namespace System.Text
         {
             // Validate input parameters
             if (chars == null || bytes == null)
-                throw new ArgumentNullException(chars == null ? nameof(chars): nameof(bytes), SR.ArgumentNull_Array);
+                throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes), SR.ArgumentNull_Array);
 
             if (byteCount < 0 || charCount < 0)
-                throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount): nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             // We don't want to throw
             m_mustFlush = flush;
index 01af288..b894ace 100644 (file)
@@ -94,7 +94,7 @@ namespace System.Text
                 throw new ArgumentNullException(nameof(chars), SR.ArgumentNull_Array);
 
             if (index < 0 || count < 0)
-                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index): nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (chars.Length - index < count)
                 throw new ArgumentOutOfRangeException(nameof(chars), SR.ArgumentOutOfRange_IndexCountBuffer);
@@ -131,10 +131,10 @@ namespace System.Text
         {
             // Validate parameters
             if (chars == null || bytes == null)
-                throw new ArgumentNullException((chars == null ? nameof(chars): nameof(bytes)), SR.ArgumentNull_Array);
+                throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), SR.ArgumentNull_Array);
 
             if (charIndex < 0 || charCount < 0)
-                throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex): nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (chars.Length - charIndex < charCount)
                 throw new ArgumentOutOfRangeException(nameof(chars), SR.ArgumentOutOfRange_IndexCountBuffer);
@@ -151,21 +151,19 @@ namespace System.Text
 
             // Just call pointer version
             fixed (char* pChars = &chars[0])
-                fixed (byte* pBytes = &bytes[0])
-
-                    // Remember that charCount is # to decode, not size of array.
-                    return GetBytes(pChars + charIndex, charCount,
-                                    pBytes + byteIndex, byteCount, flush);
+            fixed (byte* pBytes = &bytes[0])
+                // Remember that charCount is # to decode, not size of array.
+                return GetBytes(pChars + charIndex, charCount, pBytes + byteIndex, byteCount, flush);
         }
 
         public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush)
         {
             // Validate parameters
             if (chars == null || bytes == null)
-                throw new ArgumentNullException((chars == null ? nameof(chars): nameof(bytes)), SR.ArgumentNull_Array);
+                throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), SR.ArgumentNull_Array);
 
             if (byteCount < 0 || charCount < 0)
-                throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount): nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             m_mustFlush = flush;
             m_throwOnOverflow = true;
@@ -180,13 +178,13 @@ namespace System.Text
         {
             // Validate parameters
             if (chars == null || bytes == null)
-                throw new ArgumentNullException((chars == null ? nameof(chars): nameof(bytes)), SR.ArgumentNull_Array);
+                throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), SR.ArgumentNull_Array);
 
             if (charIndex < 0 || charCount < 0)
-                throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex): nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (byteIndex < 0 || byteCount < 0)
-                throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex): nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (chars.Length - charIndex < charCount)
                 throw new ArgumentOutOfRangeException(nameof(chars), SR.ArgumentOutOfRange_IndexCountBuffer);
@@ -219,10 +217,10 @@ namespace System.Text
         {
             // Validate input parameters
             if (bytes == null || chars == null)
-                throw new ArgumentNullException(bytes == null ? nameof(bytes): nameof(chars), SR.ArgumentNull_Array);
+                throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), SR.ArgumentNull_Array);
 
             if (charCount < 0 || byteCount < 0)
-                throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount): nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             // We don't want to throw
             m_mustFlush = flush;
index bc45f09..18a6ead 100644 (file)
@@ -52,7 +52,7 @@ namespace System.Text
                 throw new ArgumentNullException(nameof(chars), SR.ArgumentNull_Array);
 
             if (index < 0 || count < 0)
-                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index): nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (chars.Length - index < count)
                 throw new ArgumentOutOfRangeException(nameof(chars), SR.ArgumentOutOfRange_IndexCountBuffer);
@@ -102,10 +102,10 @@ namespace System.Text
                                               byte[] bytes, int byteIndex)
         {
             if (s == null || bytes == null)
-                throw new ArgumentNullException((s == null ? nameof(s): nameof(bytes)), SR.ArgumentNull_Array);
+                throw new ArgumentNullException((s == null ? nameof(s) : nameof(bytes)), SR.ArgumentNull_Array);
 
             if (charIndex < 0 || charCount < 0)
-                throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex): nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (s.Length - charIndex < charCount)
                 throw new ArgumentOutOfRangeException(nameof(s), SR.ArgumentOutOfRange_IndexCount);
@@ -120,9 +120,9 @@ namespace System.Text
                 bytes = new byte[1];
 
             fixed (char* pChars = s)
-                fixed (byte* pBytes = &bytes[0])
-                    return GetBytes(pChars + charIndex, charCount,
-                                    pBytes + byteIndex, byteCount, null);
+            fixed (byte* pBytes = &bytes[0])
+                return GetBytes(pChars + charIndex, charCount,
+                                pBytes + byteIndex, byteCount, null);
         }
 
         // Encodes a range of characters in a character array into a range of bytes
@@ -142,10 +142,10 @@ namespace System.Text
         {
             // Validate parameters
             if (chars == null || bytes == null)
-                throw new ArgumentNullException((chars == null ? nameof(chars): nameof(bytes)), SR.ArgumentNull_Array);
+                throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), SR.ArgumentNull_Array);
 
             if (charIndex < 0 || charCount < 0)
-                throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex): nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (chars.Length - charIndex < charCount)
                 throw new ArgumentOutOfRangeException(nameof(chars), SR.ArgumentOutOfRange_IndexCountBuffer);
@@ -165,10 +165,10 @@ namespace System.Text
                 bytes = new byte[1];
 
             fixed (char* pChars = &chars[0])
-                fixed (byte* pBytes = &bytes[0])
-                    // Remember that byteCount is # to decode, not size of array.
-                    return GetBytes(pChars + charIndex, charCount,
-                                    pBytes + byteIndex, byteCount, null);
+            fixed (byte* pBytes = &bytes[0])
+                // Remember that byteCount is # to decode, not size of array.
+                return GetBytes(pChars + charIndex, charCount,
+                                pBytes + byteIndex, byteCount, null);
         }
 
         // All of our public Encodings that don't use EncodingNLS must have this (including EncodingNLS)
@@ -177,10 +177,10 @@ namespace System.Text
         {
             // Validate Parameters
             if (bytes == null || chars == null)
-                throw new ArgumentNullException(bytes == null ? nameof(bytes): nameof(chars), SR.ArgumentNull_Array);
+                throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), SR.ArgumentNull_Array);
 
             if (charCount < 0 || byteCount < 0)
-                throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount): nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             return GetBytes(chars, charCount, bytes, byteCount, null);
         }
@@ -198,7 +198,7 @@ namespace System.Text
                 throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array);
 
             if (index < 0 || count < 0)
-                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index): nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (bytes.Length - index < count)
                 throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer);
@@ -234,10 +234,10 @@ namespace System.Text
         {
             // Validate Parameters
             if (bytes == null || chars == null)
-                throw new ArgumentNullException(bytes == null ? nameof(bytes): nameof(chars), SR.ArgumentNull_Array);
+                throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), SR.ArgumentNull_Array);
 
             if (byteIndex < 0 || byteCount < 0)
-                throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex): nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (bytes.Length - byteIndex < byteCount)
                 throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer);
@@ -257,10 +257,10 @@ namespace System.Text
                 chars = new char[1];
 
             fixed (byte* pBytes = &bytes[0])
-                fixed (char* pChars = &chars[0])
-                    // Remember that charCount is # to decode, not size of array
-                    return GetChars(pBytes + byteIndex, byteCount,
-                                    pChars + charIndex, charCount, null);
+            fixed (char* pChars = &chars[0])
+                // Remember that charCount is # to decode, not size of array
+                return GetChars(pBytes + byteIndex, byteCount,
+                                pChars + charIndex, charCount, null);
         }
 
         // All of our public Encodings that don't use EncodingNLS must have this (including EncodingNLS)
@@ -269,10 +269,10 @@ namespace System.Text
         {
             // Validate Parameters
             if (bytes == null || chars == null)
-                throw new ArgumentNullException(bytes == null ? nameof(bytes): nameof(chars), SR.ArgumentNull_Array);
+                throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), SR.ArgumentNull_Array);
 
             if (charCount < 0 || byteCount < 0)
-                throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount): nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             return GetChars(bytes, byteCount, chars, charCount, null);
         }
@@ -290,7 +290,7 @@ namespace System.Text
                 throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array);
 
             if (index < 0 || count < 0)
-                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index): nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
+                throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
 
             if (bytes.Length - index < count)
                 throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer);
index 5218f60..26c5c17 100644 (file)
@@ -27,7 +27,7 @@ namespace System.Text.Json
         /// </remarks>
         public JsonCommentHandling CommentHandling
         {
-            readonly get =>  _commentHandling;
+            readonly get => _commentHandling;
             set
             {
                 Debug.Assert(value >= 0);
index d0a9067..2fa33d9 100644 (file)
@@ -10,7 +10,7 @@ namespace System.Text.Json
     [Serializable]
     internal sealed class JsonReaderException : JsonException
     {
-        public JsonReaderException(string message, long lineNumber, long bytePositionInLine) : base(message, path : null, lineNumber, bytePositionInLine)
+        public JsonReaderException(string message, long lineNumber, long bytePositionInLine) : base(message, path: null, lineNumber, bytePositionInLine)
         {
         }
 
index 9a12bcb..89ce2d1 100644 (file)
@@ -10,11 +10,11 @@ namespace System.Text.Json.Serialization.Converters
         /// <summary>
         /// Allow string values.
         /// </summary>
-        AllowStrings    = 0b0001,
+        AllowStrings = 0b0001,
 
         /// <summary>
         /// Allow number values.
         /// </summary>
-        AllowNumbers    = 0b0010
+        AllowNumbers = 0b0010
     }
 }
index 027e3df..d7ab4e1 100644 (file)
@@ -26,7 +26,7 @@ namespace System.Text.Json.Serialization.Converters
         }
 
         public JsonConverterEnum(EnumConverterOptions options)
-            : this (options, namingPolicy: null)
+            : this(options, namingPolicy: null)
         {
         }
 
index e11e8c8..c34ccfc 100644 (file)
@@ -18,9 +18,9 @@ namespace System.Text.Json
             // dictionaries. Typically it would represent a CLR type such as System.String.
             PolicyProperty = AddProperty(
                 propertyType,
-                propertyInfo : null,        // Not a real property so this is null.
-                classType : typeof(object), // A dummy type (not used).
-                options : options);
+                propertyInfo: null,        // Not a real property so this is null.
+                classType: typeof(object), // A dummy type (not used).
+                options: options);
         }
 
         private JsonPropertyInfo AddProperty(Type propertyType, PropertyInfo propertyInfo, Type classType, JsonSerializerOptions options)
index 977273e..2fa525b 100644 (file)
@@ -170,7 +170,7 @@ namespace System.Text.Json
                 case ClassType.Dictionary:
                     {
                         // Add a single property that maps to the class type so we can have policies applied.
-                         AddPolicyProperty(type, options);
+                        AddPolicyProperty(type, options);
 
                         Type objectType;
                         if (IsNativelySupportedCollection(type))
index a9b5ab2..39f2420 100644 (file)
@@ -67,7 +67,7 @@ namespace System.Text.Json
 
             if (!jsonPropertyInfo.IgnoreNullValues)
             {
-                state.Current.JsonPropertyInfo.SetValueAsObject(state.Current.ReturnValue, value : null);
+                state.Current.JsonPropertyInfo.SetValueAsObject(state.Current.ReturnValue, value: null);
             }
 
             return false;
index 19b1d17..9d4be84 100644 (file)
@@ -18,7 +18,7 @@ namespace System.Text.RegularExpressions
         // the cache of code and factories that are currently loaded:
         // Dictionary for large cache
         private static readonly Dictionary<CachedCodeEntryKey, CachedCodeEntry> s_cache = new Dictionary<CachedCodeEntryKey, CachedCodeEntry>(s_cacheSize);
-         // linked list for LRU and for small cache
+        // linked list for LRU and for small cache
         private static int s_cacheCount = 0;
         private static CachedCodeEntry s_cacheFirst;
         private static CachedCodeEntry s_cacheLast;
index 7cae75a..b4bda3a 100644 (file)
@@ -26,7 +26,7 @@ namespace System.Text.RegularExpressions
     {
         // The following primitive operations come directly from the parser
 
-                                                    // lef/back operands        description
+                                                  // lef/back operands        description
         public const int Onerep = 0;              // lef,back char,min,max    a {n}
         public const int Notonerep = 1;           // lef,back char,min,max    .{n}
         public const int Setrep = 2;              // lef,back set,min,max     [\d]{n}
index bdf830f..f81e097 100644 (file)
@@ -266,14 +266,16 @@ namespace System.Text.RegularExpressions
         /*
          * True if we need to do the backtrack logic for the current operation
          */
-        private bool IsBack() {
+        private bool IsBack()
+        {
             return (_regexopcode & RegexCode.Back) != 0;
         }
 
         /*
          * True if we need to do the second-backtrack logic for the current operation
          */
-        private bool IsBack2() {
+        private bool IsBack2()
+        {
             return (_regexopcode & RegexCode.Back2) != 0;
         }
 #endif
@@ -953,8 +955,8 @@ namespace System.Text.RegularExpressions
 
         private void CallToLower()
         {
-             Ldloc(_cultureV);
-             Call(s_chartolowerM);
+            Ldloc(_cultureV);
+            Call(s_chartolowerM);
         }
 
         /*
@@ -1608,12 +1610,13 @@ namespace System.Text.RegularExpressions
         /*
          * Some simple debugging stuff
          */
-        private static readonly MethodInfo s_debugWriteLine = typeof(Debug).GetMethod("WriteLine", new Type[] {typeof(string)});
+        private static readonly MethodInfo s_debugWriteLine = typeof(Debug).GetMethod("WriteLine", new Type[] { typeof(string) });
 
         /*
          * Debug only: emit code to print out a message
          */
-        private void Message(string str) {
+        private void Message(string str)
+        {
             Ldstr(str);
             Call(s_debugWriteLine);
         }
@@ -1635,7 +1638,8 @@ namespace System.Text.RegularExpressions
         private void GenerateOneCode()
         {
 #if DEBUG
-            if ((_options & RegexOptions.Debug) != 0) {
+            if ((_options & RegexOptions.Debug) != 0)
+            {
                 Mvlocfld(_textposV, s_textposF);
                 Mvlocfld(_trackposV, s_trackposF);
                 Mvlocfld(_stackposV, s_stackposF);
index 283ec6f..e1baf0e 100644 (file)
@@ -103,11 +103,11 @@ namespace System.Text.RegularExpressions
                         // In release, cutoff at a length to which we can still reasonably construct a string
                         // In debug, use a smaller cutoff to exercise the cutoff path in tests
                         const int Cutoff =
-                        #if DEBUG
+#if DEBUG
                             50;
-                        #else
+#else
                             1_000_000;
-                        #endif
+#endif
 
                         if (curNode.M > 0 && curNode.M < Cutoff)
                         {
index 1c6f126..d0b3708 100644 (file)
@@ -140,7 +140,7 @@ namespace System.Text.RegularExpressions
             }
         }
 
-       /// <summary>
+        /// <summary>
         /// Given a Match, emits into the ValueStringBuilder the evaluated
         /// Right-to-Left substitution pattern.
         /// </summary>
index 11c86a0..f3f7f13 100644 (file)
@@ -30,28 +30,28 @@ namespace System.Text.RegularExpressions
 
         protected internal int[] runtrack;         // The backtracking stack.  Opcodes use this to store data regarding
         protected internal int runtrackpos;        // what they have matched and where to backtrack to.  Each "frame" on
-                                           // the stack takes the form of [CodePosition Data1 Data2...], where
-                                           // CodePosition is the position of the current opcode and
-                                           // the data values are all optional.  The CodePosition can be negative, and
-                                           // these values (also called "back2") are used by the BranchMark family of opcodes
-                                           // to indicate whether they are backtracking after a successful or failed
-                                           // match.
-                                           // When we backtrack, we pop the CodePosition off the stack, set the current
-                                           // instruction pointer to that code position, and mark the opcode
-                                           // with a backtracking flag ("Back").  Each opcode then knows how to
-                                           // handle its own data.
+                                                   // the stack takes the form of [CodePosition Data1 Data2...], where
+                                                   // CodePosition is the position of the current opcode and
+                                                   // the data values are all optional.  The CodePosition can be negative, and
+                                                   // these values (also called "back2") are used by the BranchMark family of opcodes
+                                                   // to indicate whether they are backtracking after a successful or failed
+                                                   // match.
+                                                   // When we backtrack, we pop the CodePosition off the stack, set the current
+                                                   // instruction pointer to that code position, and mark the opcode
+                                                   // with a backtracking flag ("Back").  Each opcode then knows how to
+                                                   // handle its own data.
 
         protected internal int[] runstack;         // This stack is used to track text positions across different opcodes.
         protected internal int runstackpos;        // For example, in /(a*b)+/, the parentheses result in a SetMark/CaptureMark
-                                           // pair. SetMark records the text position before we match a*b.  Then
-                                           // CaptureMark uses that position to figure out where the capture starts.
-                                           // Opcodes which push onto this stack are always paired with other opcodes
-                                           // which will pop the value from it later.  A successful match should mean
-                                           // that this stack is empty.
+                                                   // pair. SetMark records the text position before we match a*b.  Then
+                                                   // CaptureMark uses that position to figure out where the capture starts.
+                                                   // Opcodes which push onto this stack are always paired with other opcodes
+                                                   // which will pop the value from it later.  A successful match should mean
+                                                   // that this stack is empty.
 
         protected internal int[] runcrawl;         // The crawl stack is used to keep track of captures.  Every time a group
         protected internal int runcrawlpos;        // has a capture, we push its group number onto the runcrawl stack.  In
-                                           // the case of a balanced match, we push BOTH groups onto the stack.
+                                                   // the case of a balanced match, we push BOTH groups onto the stack.
 
         protected internal int runtrackcount;      // count of states that may do backtracking
 
index 160228d..68d8eb6 100644 (file)
@@ -6,7 +6,7 @@ using System.Threading;
 
 namespace System.Transactions
 {
-    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2229", Justification="Serialization not yet supported and will be done using DistributedTransaction")]
+    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2229", Justification = "Serialization not yet supported and will be done using DistributedTransaction")]
     public sealed class CommittableTransaction : Transaction, IAsyncResult
     {
         internal bool _completedSynchronously = false;
index c6fbbba..469a1a2 100644 (file)
@@ -24,7 +24,7 @@ namespace System.Transactions
             TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
             if (etwLog.IsEnabled())
             {
-                etwLog.TransactionExceptionTrace(TransactionExceptionType.TransactionException, message, innerException==null?string.Empty:innerException.ToString());
+                etwLog.TransactionExceptionTrace(TransactionExceptionType.TransactionException, message, innerException == null ? string.Empty : innerException.ToString());
             }
 
             return new TransactionException(message, innerException);
@@ -35,7 +35,7 @@ namespace System.Transactions
             TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
             if (etwLog.IsEnabled())
             {
-                etwLog.TransactionExceptionTrace(TransactionExceptionType.TransactionException, message, innerException==null?string.Empty:innerException.ToString());
+                etwLog.TransactionExceptionTrace(TransactionExceptionType.TransactionException, message, innerException == null ? string.Empty : innerException.ToString());
             }
 
             return new TransactionException(message, innerException);
@@ -54,7 +54,7 @@ namespace System.Transactions
             TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
             if (etwLog.IsEnabled())
             {
-                etwLog.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, messagewithTxId, innerException==null?string.Empty:innerException.ToString());
+                etwLog.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, messagewithTxId, innerException == null ? string.Empty : innerException.ToString());
             }
             return new InvalidOperationException(messagewithTxId, innerException);
         }
@@ -64,7 +64,7 @@ namespace System.Transactions
             TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
             if (etwLog.IsEnabled())
             {
-                etwLog.TransactionExceptionTrace(traceSource, TransactionExceptionType.InvalidOperationException, message, innerException==null?string.Empty:innerException.ToString());
+                etwLog.TransactionExceptionTrace(traceSource, TransactionExceptionType.InvalidOperationException, message, innerException == null ? string.Empty : innerException.ToString());
             }
 
             return new InvalidOperationException(message, innerException);
@@ -191,7 +191,7 @@ namespace System.Transactions
             TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
             if (etwLog.IsEnabled())
             {
-                etwLog.TransactionExceptionTrace(TransactionExceptionType.TransactionAbortedException, message, innerException==null?string.Empty:innerException.ToString());
+                etwLog.TransactionExceptionTrace(TransactionExceptionType.TransactionAbortedException, message, innerException == null ? string.Empty : innerException.ToString());
             }
 
             return new TransactionAbortedException(message, innerException);
@@ -266,7 +266,7 @@ namespace System.Transactions
             TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
             if (etwLog.IsEnabled())
             {
-                etwLog.TransactionExceptionTrace(traceSource, TransactionExceptionType.TransactionInDoubtException, message, innerException==null?string.Empty:innerException.ToString());
+                etwLog.TransactionExceptionTrace(traceSource, TransactionExceptionType.TransactionInDoubtException, message, innerException == null ? string.Empty : innerException.ToString());
             }
 
             return new TransactionInDoubtException(message, innerException);
@@ -318,7 +318,7 @@ namespace System.Transactions
             TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
             if (etwLog.IsEnabled())
             {
-                etwLog.TransactionExceptionTrace(TransactionExceptionType.TransactionManagerCommunicationException, message, innerException==null?string.Empty:innerException.ToString());
+                etwLog.TransactionExceptionTrace(TransactionExceptionType.TransactionManagerCommunicationException, message, innerException == null ? string.Empty : innerException.ToString());
             }
 
             return new TransactionManagerCommunicationException(message, innerException);
index 96370f9..6674e95 100644 (file)
@@ -125,7 +125,7 @@ namespace System.Drawing
 
                 // pHeader.signature will always be 0x1c15.
                 // "PBrush" should be the 6 chars after position 12 as well.
-                if ( rawData.Length <= pHeader.headersize + 18 ||
+                if (rawData.Length <= pHeader.headersize + 18 ||
                     !rawData.Slice(pHeader.headersize + 12, 6).SequenceEqual(PBrush))
                 {
                     return null;
index 51c6dc8..80d550e 100644 (file)
@@ -27,7 +27,7 @@ namespace System.Security.Cryptography.X509Certificates
 
     internal abstract class SafePointerHandle<T> : SafeHandle where T : SafeHandle, new()
     {
-        protected SafePointerHandle(): base(IntPtr.Zero, true)
+        protected SafePointerHandle() : base(IntPtr.Zero, true)
         {
         }