--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <UsingTask TaskName="GenerateResourcesCode" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
+
+ <PropertyGroup>
+ <GenerateResourceMSBuildRuntime>CurrentRuntime</GenerateResourceMSBuildRuntime>
+ <GenerateResourceMSBuildArchitecture>CurrentArchitecture</GenerateResourceMSBuildArchitecture>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <ResourcesSourceOutputDirectory Condition="'$(ResourcesSourceOutputDirectory)' == ''">$(MSBuildProjectDirectory)/Resources/</ResourcesSourceOutputDirectory>
+ <StringResourcesPath Condition="'$(StringResourcesPath)'=='' And Exists('$(ResourcesSourceOutputDirectory)Strings.resx')">$(ResourcesSourceOutputDirectory)/Strings.resx</StringResourcesPath>
+ <IntermediateResOutputFileFullPath Condition="'$(MSBuildProjectExtension)' == '.csproj'">$(IntermediateOutputPath)SR.cs</IntermediateResOutputFileFullPath>
+ <IntermediateResOutputFileFullPath Condition="'$(MSBuildProjectExtension)' == '.vbproj'">$(IntermediateOutputPath)SR.vb</IntermediateResOutputFileFullPath>
+ <DefineConstants Condition="'$(ConfigurationGroup)' == 'Debug'">$(DefineConstants);DEBUGRESOURCES</DefineConstants>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(StringResourcesPath)'!=''">
+ <CompileDependsOn>
+ GenerateResourcesSource;
+ $(CompileDependsOn);
+ </CompileDependsOn>
+ </PropertyGroup>
+
+ <Target Name="GenerateResourcesSource"
+ Condition="'$(StringResourcesPath)'!='' AND '$(OmitResources)'!='true'"
+ Inputs="$(StringResourcesPath)"
+ Outputs="$(IntermediateResOutputFileFullPath)">
+
+
+
+ <GenerateResourcesCode
+ ResxFilePath="$(StringResourcesPath)"
+ OutputSourceFilePath="$(IntermediateResOutputFileFullPath)"
+ AssemblyName="$(AssemblyName)" />
+
+ <ItemGroup>
+ <!-- The following Compile element has to be included dynamically inside the Target otherwise intellisense will not work -->
+ <Compile Include="$(IntermediateResOutputFileFullPath)" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <FileWrites Include="$(IntermediateResOutputFileFullPath)" />
+ </ItemGroup>
+ </Target>
+
+ <ItemGroup Condition="'$(StringResourcesPath)'!='' AND '$(OmitResources)'!='true'">
+ <EmbeddedResource Include="$(StringResourcesPath)">
+ <Visible>true</Visible>
+ <LogicalName>FxResources.$(AssemblyName).SR.resources</LogicalName>
+ </EmbeddedResource>
+ </ItemGroup>
+
+ <Choose>
+ <When Condition="Exists('$(StringResourcesPath)') And '$(SkipCommonResourcesIncludes)'=='' AND '$(OmitResources)'!='true'">
+ <Choose>
+ <When Condition="'$(MSBuildProjectExtension)' == '.csproj'">
+ <ItemGroup>
+ <Compile Include="$(CommonPath)/System/SR.cs">
+ <Visible>true</Visible>
+ <Link>Resources/Common/SR.cs</Link>
+ </Compile>
+ </ItemGroup>
+ </When>
+ <When Condition="'$(MSBuildProjectExtension)' == '.vbproj'">
+ <ItemGroup>
+ <Compile Include="$(CommonPath)/System/SR.vb">
+ <Visible>true</Visible>
+ <Link>Resources/Common/SR.vb</Link>
+ </Compile>
+ </ItemGroup>
+ </When>
+ </Choose>
+ </When>
+ </Choose>
+</Project>
$working_tree_root/init-tools.sh
# Always copy over the Tools-Override
-cp $__scriptpath/Tools-Override/* $__scriptpath/Tools > /dev/null
+cp $working_tree_root/Tools-Override/* $working_tree_root/Tools > /dev/null
toolRuntime=$working_tree_root/Tools
dotnet=$toolRuntime/dotnetcli/dotnet
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// 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.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Threading;
+
+namespace System
+{
+ internal static partial class SR
+ {
+ private static ResourceManager ResourceManager
+ {
+ get;
+ set;
+ }
+
+ // This method is used to decide if we need to append the exception message parameters to the message when calling SR.Format.
+ // by default it returns false.
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static bool UsingResourceKeys()
+ {
+ return false;
+ }
+
+ // Needed for debugger integration
+ internal static string GetResourceString(string resourceKey)
+ {
+ return GetResourceString(resourceKey, String.Empty);
+ }
+
+ internal static string GetResourceString(string resourceKey, string defaultString)
+ {
+ string resourceString = null;
+ try { resourceString = InternalGetResourceString(resourceKey); }
+ catch (MissingManifestResourceException) { }
+
+ if (defaultString != null && resourceKey.Equals(resourceString, StringComparison.Ordinal))
+ {
+ return defaultString;
+ }
+
+ return resourceString;
+ }
+
+ private static object _lock = new object();
+ private static List<string> _currentlyLoading;
+ private static int _infinitelyRecursingCount;
+ private static bool _resourceManagerInited = false;
+
+ private static string InternalGetResourceString(string key)
+ {
+ if (key == null || key.Length == 0)
+ {
+ Debug.Assert(false, "SR::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?");
+ return key;
+ }
+
+ // We have a somewhat common potential for infinite
+ // loops with mscorlib's ResourceManager. If "potentially dangerous"
+ // code throws an exception, we will get into an infinite loop
+ // inside the ResourceManager and this "potentially dangerous" code.
+ // Potentially dangerous code includes the IO package, CultureInfo,
+ // parts of the loader, some parts of Reflection, Security (including
+ // custom user-written permissions that may parse an XML file at
+ // class load time), assembly load event handlers, etc. Essentially,
+ // this is not a bounded set of code, and we need to fix the problem.
+ // Fortunately, this is limited to mscorlib's error lookups and is NOT
+ // a general problem for all user code using the ResourceManager.
+
+ // The solution is to make sure only one thread at a time can call
+ // GetResourceString. Also, since resource lookups can be
+ // reentrant, if the same thread comes into GetResourceString
+ // twice looking for the exact same resource name before
+ // returning, we're going into an infinite loop and we should
+ // return a bogus string.
+
+ bool lockTaken = false;
+ try
+ {
+ Monitor.Enter(_lock, ref lockTaken);
+
+ // Are we recursively looking up the same resource? Note - our backout code will set
+ // the ResourceHelper's currentlyLoading stack to null if an exception occurs.
+ if (_currentlyLoading != null && _currentlyLoading.Count > 0 && _currentlyLoading.LastIndexOf(key) != -1)
+ {
+ // We can start infinitely recursing for one resource lookup,
+ // then during our failure reporting, start infinitely recursing again.
+ // avoid that.
+ if (_infinitelyRecursingCount > 0)
+ {
+ return key;
+ }
+ _infinitelyRecursingCount++;
+
+ // Note: our infrastructure for reporting this exception will again cause resource lookup.
+ // This is the most direct way of dealing with that problem.
+ string message = $"Infinite recursion during resource lookup within {System.CoreLib.Name}. This may be a bug in {System.CoreLib.Name}, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: {key}";
+ Assert.Fail("[Recursive resource lookup bug]", message, Assert.COR_E_FAILFAST, System.Diagnostics.StackTrace.TraceFormat.NoResourceLookup);
+ Environment.FailFast(message);
+ }
+ if (_currentlyLoading == null)
+ _currentlyLoading = new List<string>();
+
+ // Call class constructors preemptively, so that we cannot get into an infinite
+ // loop constructing a TypeInitializationException. If this were omitted,
+ // we could get the Infinite recursion assert above by failing type initialization
+ // between the Push and Pop calls below.
+ if (!_resourceManagerInited)
+ {
+ RuntimeHelpers.RunClassConstructor(typeof(ResourceManager).TypeHandle);
+ RuntimeHelpers.RunClassConstructor(typeof(ResourceReader).TypeHandle);
+ RuntimeHelpers.RunClassConstructor(typeof(RuntimeResourceSet).TypeHandle);
+ RuntimeHelpers.RunClassConstructor(typeof(BinaryReader).TypeHandle);
+ _resourceManagerInited = true;
+ }
+
+ _currentlyLoading.Add(key); // Push
+
+ if (ResourceManager == null)
+ {
+ ResourceManager = new ResourceManager(SR.ResourceType);
+ }
+ string s = ResourceManager.GetString(key, null);
+ _currentlyLoading.RemoveAt(_currentlyLoading.Count - 1); // Pop
+
+ Debug.Assert(s != null, "Managed resource string lookup failed. Was your resource name misspelled? Did you rebuild mscorlib after adding a resource to resources.txt? Debug this w/ cordbg and bug whoever owns the code that called SR.GetResourceString. Resource name was: \"" + key + "\"");
+ return s ?? key;
+ }
+ catch
+ {
+ if (lockTaken)
+ {
+ // Backout code - throw away potentially corrupt state
+ ResourceManager = null;
+ _currentlyLoading = null;
+ }
+ throw;
+ }
+ finally
+ {
+ if (lockTaken)
+ {
+ Monitor.Exit(_lock);
+ }
+ }
+ }
+
+ internal static string Format(string resourceFormat, params object[] args)
+ {
+ if (args != null)
+ {
+ if (UsingResourceKeys())
+ {
+ return resourceFormat + String.Join(", ", args);
+ }
+
+ return String.Format(resourceFormat, args);
+ }
+
+ return resourceFormat;
+ }
+
+ internal static string Format(string resourceFormat, object p1)
+ {
+ if (UsingResourceKeys())
+ {
+ return String.Join(", ", resourceFormat, p1);
+ }
+
+ return String.Format(resourceFormat, p1);
+ }
+
+ internal static string Format(string resourceFormat, object p1, object p2)
+ {
+ if (UsingResourceKeys())
+ {
+ return String.Join(", ", resourceFormat, p1, p2);
+ }
+
+ return String.Format(resourceFormat, p1, p2);
+ }
+
+ internal static string Format(string resourceFormat, object p1, object p2, object p3)
+ {
+ if (UsingResourceKeys())
+ {
+ return String.Join(", ", resourceFormat, p1, p2, p3);
+ }
+ return String.Format(resourceFormat, p1, p2, p3);
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="Acc_CreateAbst" xml:space="preserve">
+ <value>Cannot create an abstract class.</value>
+ </data>
+ <data name="Acc_CreateAbstEx" xml:space="preserve">
+ <value>Cannot create an instance of {0} because it is an abstract class.</value>
+ </data>
+ <data name="Acc_CreateArgIterator" xml:space="preserve">
+ <value>Cannot dynamically create an instance of ArgIterator.</value>
+ </data>
+ <data name="Acc_CreateGeneric" xml:space="preserve">
+ <value>Cannot create a type for which Type.ContainsGenericParameters is true.</value>
+ </data>
+ <data name="Acc_CreateGenericEx" xml:space="preserve">
+ <value>Cannot create an instance of {0} because Type.ContainsGenericParameters is true.</value>
+ </data>
+ <data name="Acc_CreateInterface" xml:space="preserve">
+ <value>Cannot create an instance of an interface.</value>
+ </data>
+ <data name="Acc_CreateInterfaceEx" xml:space="preserve">
+ <value>Cannot create an instance of {0} because it is an interface.</value>
+ </data>
+ <data name="Acc_CreateVoid" xml:space="preserve">
+ <value>Cannot dynamically create an instance of System.Void.</value>
+ </data>
+ <data name="Acc_NotClassInit" xml:space="preserve">
+ <value>Type initializer was not callable.</value>
+ </data>
+ <data name="Acc_ReadOnly" xml:space="preserve">
+ <value>Cannot set a constant field.</value>
+ </data>
+ <data name="Acc_RvaStatic" xml:space="preserve">
+ <value>SkipVerification permission is needed to modify an image-based (RVA) static field.</value>
+ </data>
+ <data name="Access_Void" xml:space="preserve">
+ <value>Cannot create an instance of void.</value>
+ </data>
+ <data name="AggregateException_ctor_DefaultMessage" xml:space="preserve">
+ <value>One or more errors occurred.</value>
+ </data>
+ <data name="AggregateException_ctor_InnerExceptionNull" xml:space="preserve">
+ <value>An element of innerExceptions was null.</value>
+ </data>
+ <data name="AggregateException_DeserializationFailure" xml:space="preserve">
+ <value>The serialization stream contains no inner exceptions.</value>
+ </data>
+ <data name="AggregateException_ToString" xml:space="preserve">
+ <value>{0}{1}---> (Inner Exception #{2}) {3}{4}{5}</value>
+ </data>
+ <data name="All_ToString" xml:space="preserve">
+ <value>All code</value>
+ </data>
+ <data name="AllocatedFrom" xml:space="preserve">
+ <value>Allocated from:</value>
+ </data>
+ <data name="AppDomain_AppBaseNotSet" xml:space="preserve">
+ <value>The ApplicationBase must be set before retrieving this property.</value>
+ </data>
+ <data name="AppDomain_BindingModelIsLocked" xml:space="preserve">
+ <value>Binding model is already locked for the AppDomain and cannot be reset.</value>
+ </data>
+ <data name="AppDomain_RequireApplicationName" xml:space="preserve">
+ <value>ApplicationName must be set before the DynamicBase can be set.</value>
+ </data>
+ <data name="ApplicationDirectory_ToString" xml:space="preserve">
+ <value>ApplicationDirectory</value>
+ </data>
+ <data name="Arg_AccessException" xml:space="preserve">
+ <value>Cannot access member.</value>
+ </data>
+ <data name="Arg_AccessViolationException" xml:space="preserve">
+ <value>Attempted to read or write protected memory. This is often an indication that other memory is corrupt.</value>
+ </data>
+ <data name="Arg_AmbiguousMatchException" xml:space="preserve">
+ <value>Ambiguous match found.</value>
+ </data>
+ <data name="Arg_AppDomainUnloadedException" xml:space="preserve">
+ <value>Attempted to access an unloaded AppDomain.</value>
+ </data>
+ <data name="Arg_ApplicationException" xml:space="preserve">
+ <value>Error in the application.</value>
+ </data>
+ <data name="Arg_ArgumentException" xml:space="preserve">
+ <value>Value does not fall within the expected range.</value>
+ </data>
+ <data name="Arg_ArgumentOutOfRangeException" xml:space="preserve">
+ <value>Specified argument was out of the range of valid values.</value>
+ </data>
+ <data name="Arg_ArithmeticException" xml:space="preserve">
+ <value>Overflow or underflow in the arithmetic operation.</value>
+ </data>
+ <data name="Arg_ArrayLengthsDiffer" xml:space="preserve">
+ <value>Array lengths must be the same.</value>
+ </data>
+ <data name="Arg_ArrayPlusOffTooSmall" xml:space="preserve">
+ <value>Destination array is not long enough to copy all the items in the collection. Check array index and length.</value>
+ </data>
+ <data name="Arg_ArrayTypeMismatchException" xml:space="preserve">
+ <value>Attempted to access an element as a type incompatible with the array.</value>
+ </data>
+ <data name="Arg_ArrayZeroError" xml:space="preserve">
+ <value>Array must not be of length zero.</value>
+ </data>
+ <data name="Arg_AssemblyNullModule" xml:space="preserve">
+ <value>The manifest module of the assembly cannot be null.</value>
+ </data>
+ <data name="Arg_BadDecimal" xml:space="preserve">
+ <value>Read an invalid decimal value from the buffer.</value>
+ </data>
+ <data name="Arg_BadImageFormatException" xml:space="preserve">
+ <value>Format of the executable (.exe) or library (.dll) is invalid.</value>
+ </data>
+ <data name="Arg_BadLiteralFormat" xml:space="preserve">
+ <value>Encountered an invalid type for a default value.</value>
+ </data>
+ <data name="Arg_BitArrayTypeUnsupported" xml:space="preserve">
+ <value>Only supported array types for CopyTo on BitArrays are Boolean[], Int32[] and Byte[].</value>
+ </data>
+ <data name="Arg_BogusIComparer" xml:space="preserve">
+ <value>Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: '{0}'.</value>
+ </data>
+ <data name="Arg_BufferTooSmall" xml:space="preserve">
+ <value>Not enough space available in the buffer.</value>
+ </data>
+ <data name="Arg_CannotBeNaN" xml:space="preserve">
+ <value>TimeSpan does not accept floating point Not-a-Number values.</value>
+ </data>
+ <data name="Arg_CannotHaveNegativeValue" xml:space="preserve">
+ <value>String cannot contain a minus sign if the base is not 10.</value>
+ </data>
+ <data name="Arg_CannotMixComparisonInfrastructure" xml:space="preserve">
+ <value>The usage of IKeyComparer and IHashCodeProvider/IComparer interfaces cannot be mixed; use one or the other.</value>
+ </data>
+ <data name="Arg_CannotUnloadAppDomainException" xml:space="preserve">
+ <value>Attempt to unload the AppDomain failed.</value>
+ </data>
+ <data name="Arg_CATypeResolutionFailed" xml:space="preserve">
+ <value>Failed to resolve type from string "{0}" which was embedded in custom attribute blob.</value>
+ </data>
+ <data name="Arg_COMAccess" xml:space="preserve">
+ <value>Must specify property Set or Get or method call for a COM Object.</value>
+ </data>
+ <data name="Arg_COMException" xml:space="preserve">
+ <value>Error HRESULT E_FAIL has been returned from a call to a COM component.</value>
+ </data>
+ <data name="Arg_COMPropSetPut" xml:space="preserve">
+ <value>Only one of the following binding flags can be set: BindingFlags.SetProperty, BindingFlags.PutDispProperty, BindingFlags.PutRefDispProperty.</value>
+ </data>
+ <data name="Arg_ContextMarshalException" xml:space="preserve">
+ <value>Attempted to marshal an object across a context boundary.</value>
+ </data>
+ <data name="Arg_CorruptedCustomCultureFile" xml:space="preserve">
+ <value>The file of the custom culture {0} is corrupt. Try to unregister this culture.</value>
+ </data>
+ <data name="Arg_CreatInstAccess" xml:space="preserve">
+ <value>Cannot specify both CreateInstance and another access type.</value>
+ </data>
+ <data name="Arg_CryptographyException" xml:space="preserve">
+ <value>Error occurred during a cryptographic operation.</value>
+ </data>
+ <data name="Arg_CustomAttributeFormatException" xml:space="preserve">
+ <value>Binary format of the specified custom attribute was invalid.</value>
+ </data>
+ <data name="Arg_DataMisalignedException" xml:space="preserve">
+ <value>A datatype misalignment was detected in a load or store instruction.</value>
+ </data>
+ <data name="Arg_DateTimeRange" xml:space="preserve">
+ <value>Combination of arguments to the DateTime constructor is out of the legal range.</value>
+ </data>
+ <data name="Arg_DecBitCtor" xml:space="preserve">
+ <value>Decimal byte array constructor requires an array of length four containing valid decimal bytes.</value>
+ </data>
+ <data name="Arg_DevicesNotSupported" xml:space="preserve">
+ <value>FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\\\.\\" in the path.</value>
+ </data>
+ <data name="Arg_DirectoryNotFoundException" xml:space="preserve">
+ <value>Attempted to access a path that is not on the disk.</value>
+ </data>
+ <data name="Arg_DivideByZero" xml:space="preserve">
+ <value>Attempted to divide by zero.</value>
+ </data>
+ <data name="Arg_DlgtNullInst" xml:space="preserve">
+ <value>Delegate to an instance method cannot have null 'this'.</value>
+ </data>
+ <data name="Arg_DlgtTargMeth" xml:space="preserve">
+ <value>Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type.</value>
+ </data>
+ <data name="Arg_DlgtTypeMis" xml:space="preserve">
+ <value>Delegates must be of the same type.</value>
+ </data>
+ <data name="Arg_DllInitFailure" xml:space="preserve">
+ <value>One machine may not have remote administration enabled, or both machines may not be running the remote registry service.</value>
+ </data>
+ <data name="Arg_DllNotFoundException" xml:space="preserve">
+ <value>Dll was not found.</value>
+ </data>
+ <data name="Arg_DriveNotFoundException" xml:space="preserve">
+ <value>Attempted to access a drive that is not available.</value>
+ </data>
+ <data name="Arg_DuplicateWaitObjectException" xml:space="preserve">
+ <value>Duplicate objects in argument.</value>
+ </data>
+ <data name="Arg_EHClauseNotClause" xml:space="preserve">
+ <value>This ExceptionHandlingClause is not a clause.</value>
+ </data>
+ <data name="Arg_EHClauseNotFilter" xml:space="preserve">
+ <value>This ExceptionHandlingClause is not a filter.</value>
+ </data>
+ <data name="Arg_EmptyArray" xml:space="preserve">
+ <value>Array may not be empty.</value>
+ </data>
+ <data name="Arg_EmptyCollection" xml:space="preserve">
+ <value>Collection must not be empty.</value>
+ </data>
+ <data name="Arg_EmptyOrNullArray" xml:space="preserve">
+ <value>Array may not be empty or null.</value>
+ </data>
+ <data name="Arg_EmptyOrNullString" xml:space="preserve">
+ <value>String may not be empty or null.</value>
+ </data>
+ <data name="Arg_EndOfStreamException" xml:space="preserve">
+ <value>Attempted to read past the end of the stream.</value>
+ </data>
+ <data name="Arg_EntryPointNotFoundException" xml:space="preserve">
+ <value>Entry point was not found.</value>
+ </data>
+ <data name="Arg_EnumAndObjectMustBeSameType" xml:space="preserve">
+ <value>Object must be the same type as the enum. The type passed in was '{0}'; the enum type was '{1}'.</value>
+ </data>
+ <data name="Arg_EnumAtLeastOneFlag" xml:space="preserve">
+ <value>Must set at least one flag.</value>
+ </data>
+ <data name="Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType" xml:space="preserve">
+ <value>Enum underlying type and the object must be same type or object. Type passed in was '{0}'; the enum underlying type was '{1}'.</value>
+ </data>
+ <data name="Arg_EnumIllegalVal" xml:space="preserve">
+ <value>Illegal enum value: {0}.</value>
+ </data>
+ <data name="Arg_EnumLitValueNotFound" xml:space="preserve">
+ <value>Literal value was not found.</value>
+ </data>
+ <data name="Arg_EnumMustHaveUnderlyingValueField" xml:space="preserve">
+ <value>All enums must have an underlying value__ field.</value>
+ </data>
+ <data name="Arg_EnumNotSingleFlag" xml:space="preserve">
+ <value>Must set exactly one flag.</value>
+ </data>
+ <data name="Arg_EnumUnderlyingTypeAndObjectMustBeSameType" xml:space="preserve">
+ <value>Enum underlying type and the object must be same type or object must be a String. Type passed in was '{0}'; the enum underlying type was '{1}'.</value>
+ </data>
+ <data name="Arg_EnumValueNotFound" xml:space="preserve">
+ <value>Requested value '{0}' was not found.</value>
+ </data>
+ <data name="Arg_ExecutionEngineException" xml:space="preserve">
+ <value>Internal error in the runtime.</value>
+ </data>
+ <data name="Arg_ExternalException" xml:space="preserve">
+ <value>External component has thrown an exception.</value>
+ </data>
+ <data name="Arg_FieldAccessException" xml:space="preserve">
+ <value>Attempted to access a field that is not accessible by the caller.</value>
+ </data>
+ <data name="Arg_FieldDeclTarget" xml:space="preserve">
+ <value>Field '{0}' defined on type '{1}' is not a field on the target object which is of type '{2}'.</value>
+ </data>
+ <data name="Arg_FileIsDirectory_Name" xml:space="preserve">
+ <value>The target file "{0}" is a directory, not a file.</value>
+ </data>
+ <data name="Arg_FldGetArgErr" xml:space="preserve">
+ <value>No arguments can be provided to Get a field value.</value>
+ </data>
+ <data name="Arg_FldGetPropSet" xml:space="preserve">
+ <value>Cannot specify both GetField and SetProperty.</value>
+ </data>
+ <data name="Arg_FldSetArgErr" xml:space="preserve">
+ <value>Only the field value can be specified to set a field value.</value>
+ </data>
+ <data name="Arg_FldSetGet" xml:space="preserve">
+ <value>Cannot specify both Get and Set on a field.</value>
+ </data>
+ <data name="Arg_FldSetInvoke" xml:space="preserve">
+ <value>Cannot specify Set on a Field and Invoke on a method.</value>
+ </data>
+ <data name="Arg_FldSetPropGet" xml:space="preserve">
+ <value>Cannot specify both SetField and GetProperty.</value>
+ </data>
+ <data name="Arg_FormatException" xml:space="preserve">
+ <value>One of the identified items was in an invalid format.</value>
+ </data>
+ <data name="Arg_GenericParameter" xml:space="preserve">
+ <value>Method must be called on a Type for which Type.IsGenericParameter is false.</value>
+ </data>
+ <data name="Arg_GetMethNotFnd" xml:space="preserve">
+ <value>Property Get method was not found.</value>
+ </data>
+ <data name="Arg_GuidArrayCtor" xml:space="preserve">
+ <value>Byte array for GUID must be exactly {0} bytes long.</value>
+ </data>
+ <data name="Arg_HandleNotAsync" xml:space="preserve">
+ <value>Handle does not support asynchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened synchronously (that is, it was not opened for overlapped I/O).</value>
+ </data>
+ <data name="Arg_HandleNotSync" xml:space="preserve">
+ <value>Handle does not support synchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened asynchronously (that is, it was opened explicitly for overlapped I/O).</value>
+ </data>
+ <data name="Arg_HexStyleNotSupported" xml:space="preserve">
+ <value>The number style AllowHexSpecifier is not supported on floating point data types.</value>
+ </data>
+ <data name="Arg_HTCapacityOverflow" xml:space="preserve">
+ <value>Hashtable's capacity overflowed and went negative. Check load factor, capacity and the current size of the table.</value>
+ </data>
+ <data name="Arg_ImporterLoadFailure" xml:space="preserve">
+ <value>The type library importer encountered an error during type verification. Try importing without class members.</value>
+ </data>
+ <data name="Arg_IndexMustBeInt" xml:space="preserve">
+ <value>All indexes must be of type Int32.</value>
+ </data>
+ <data name="Arg_IndexOutOfRangeException" xml:space="preserve">
+ <value>Index was outside the bounds of the array.</value>
+ </data>
+ <data name="Arg_InsufficientExecutionStackException" xml:space="preserve">
+ <value>Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space.</value>
+ </data>
+ <data name="Arg_InvalidAccessEntry" xml:space="preserve">
+ <value>Specified access entry is invalid because it is unrestricted. The global flags should be specified instead.</value>
+ </data>
+ <data name="Arg_InvalidANSIString" xml:space="preserve">
+ <value>The ANSI string passed in could not be converted from the default ANSI code page to Unicode.</value>
+ </data>
+ <data name="Arg_InvalidBase" xml:space="preserve">
+ <value>Invalid Base.</value>
+ </data>
+ <data name="Arg_InvalidCastException" xml:space="preserve">
+ <value>Specified cast is not valid.</value>
+ </data>
+ <data name="Arg_InvalidComObjectException" xml:space="preserve">
+ <value>Attempt has been made to use a COM object that does not have a backing class factory.</value>
+ </data>
+ <data name="Arg_InvalidConsoleColor" xml:space="preserve">
+ <value>The ConsoleColor enum value was not defined on that enum. Please use a defined color from the enum.</value>
+ </data>
+ <data name="Arg_InvalidFileAttrs" xml:space="preserve">
+ <value>Invalid File or Directory attributes value.</value>
+ </data>
+ <data name="Arg_InvalidFileExtension" xml:space="preserve">
+ <value>Specified file extension was not a valid extension.</value>
+ </data>
+ <data name="Arg_InvalidFileName" xml:space="preserve">
+ <value>Specified file name was invalid.</value>
+ </data>
+ <data name="Arg_InvalidFilterCriteriaException" xml:space="preserve">
+ <value>Specified filter criteria was invalid.</value>
+ </data>
+ <data name="Arg_InvalidHandle" xml:space="preserve">
+ <value>Invalid handle.</value>
+ </data>
+ <data name="Arg_InvalidHexStyle" xml:space="preserve">
+ <value>With the AllowHexSpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be a subset of those in HexNumber.</value>
+ </data>
+ <data name="Arg_InvalidNeutralResourcesLanguage_Asm_Culture" xml:space="preserve">
+ <value>The NeutralResourcesLanguageAttribute on the assembly "{0}" specifies an invalid culture name: "{1}".</value>
+ </data>
+ <data name="Arg_InvalidNeutralResourcesLanguage_FallbackLoc" xml:space="preserve">
+ <value>The NeutralResourcesLanguageAttribute specifies an invalid or unrecognized ultimate resource fallback location: "{0}".</value>
+ </data>
+ <data name="Arg_InvalidOleVariantTypeException" xml:space="preserve">
+ <value>Specified OLE variant was invalid.</value>
+ </data>
+ <data name="Arg_InvalidOperationException" xml:space="preserve">
+ <value>Operation is not valid due to the current state of the object.</value>
+ </data>
+ <data name="Arg_InvalidSatelliteContract_Asm_Ver" xml:space="preserve">
+ <value>Satellite contract version attribute on the assembly '{0}' specifies an invalid version: {1}.</value>
+ </data>
+ <data name="Arg_InvalidSearchPattern" xml:space="preserve">
+ <value>Search pattern cannot contain ".." to move up directories and can be contained only internally in file/directory names, as in "a..b".</value>
+ </data>
+ <data name="Arg_InvalidTypeInRetType" xml:space="preserve">
+ <value>The return Type contains some invalid type (i.e. null, ByRef)</value>
+ </data>
+ <data name="Arg_InvalidTypeInSignature" xml:space="preserve">
+ <value>The signature Type array contains some invalid type (i.e. null, void)</value>
+ </data>
+ <data name="Arg_InvalidUTF8String" xml:space="preserve">
+ <value>The UTF8 string passed in could not be converted to Unicode.</value>
+ </data>
+ <data name="Arg_InvokeMember" xml:space="preserve">
+ <value>InvokeMember can be used only for COM objects.</value>
+ </data>
+ <data name="Arg_IOException" xml:space="preserve">
+ <value>I/O error occurred.</value>
+ </data>
+ <data name="Arg_KeyNotFound" xml:space="preserve">
+ <value>The given key was not present in the dictionary.</value>
+ </data>
+ <data name="Arg_LongerThanDestArray" xml:space="preserve">
+ <value>Destination array was not long enough. Check the destination index, length, and the array's lower bounds.</value>
+ </data>
+ <data name="Arg_LongerThanSrcArray" xml:space="preserve">
+ <value>Source array was not long enough. Check the source index, length, and the array's lower bounds.</value>
+ </data>
+ <data name="Arg_LongerThanSrcString" xml:space="preserve">
+ <value>Source string was not long enough. Check sourceIndex and count.</value>
+ </data>
+ <data name="Arg_LowerBoundsMustMatch" xml:space="preserve">
+ <value>The arrays' lower bounds must be identical.</value>
+ </data>
+ <data name="Arg_MarshalAsAnyRestriction" xml:space="preserve">
+ <value>AsAny cannot be used on return types, ByRef parameters, ArrayWithOffset, or parameters passed from unmanaged to managed.</value>
+ </data>
+ <data name="Arg_MarshalDirectiveException" xml:space="preserve">
+ <value>Marshaling directives are invalid.</value>
+ </data>
+ <data name="Arg_MemberInfoNullModule" xml:space="preserve">
+ <value>The Module object containing the member cannot be null.</value>
+ </data>
+ <data name="Arg_MethodAccessException" xml:space="preserve">
+ <value>Attempt to access the method failed.</value>
+ </data>
+ <data name="Arg_MethodAccessException_WithCaller" xml:space="preserve">
+ <value>Attempt by security transparent method '{0}' to access security critical method '{1}' failed.</value>
+ </data>
+ <data name="Arg_MethodAccessException_WithMethodName" xml:space="preserve">
+ <value>Attempt to access the method "{0}" on type "{1}" failed.</value>
+ </data>
+ <data name="Arg_MissingActivationArguments" xml:space="preserve">
+ <value>The AppDomainSetup must specify the activation arguments for this call.</value>
+ </data>
+ <data name="Arg_MissingFieldException" xml:space="preserve">
+ <value>Attempted to access a non-existing field.</value>
+ </data>
+ <data name="Arg_MissingManifestResourceException" xml:space="preserve">
+ <value>Unable to find manifest resource.</value>
+ </data>
+ <data name="Arg_MissingMemberException" xml:space="preserve">
+ <value>Attempted to access a missing member.</value>
+ </data>
+ <data name="Arg_MissingMethodException" xml:space="preserve">
+ <value>Attempted to access a missing method.</value>
+ </data>
+ <data name="Arg_MulticastNotSupportedException" xml:space="preserve">
+ <value>Attempted to add multiple callbacks to a delegate that does not support multicast.</value>
+ </data>
+ <data name="Arg_MustAllBeRuntimeType" xml:space="preserve">
+ <value>At least one type argument is not a runtime type.</value>
+ </data>
+ <data name="Arg_MustBeBoolean" xml:space="preserve">
+ <value>Object must be of type Boolean.</value>
+ </data>
+ <data name="Arg_MustBeByte" xml:space="preserve">
+ <value>Object must be of type Byte.</value>
+ </data>
+ <data name="Arg_MustBeChar" xml:space="preserve">
+ <value>Object must be of type Char.</value>
+ </data>
+ <data name="Arg_MustBeDateTime" xml:space="preserve">
+ <value>Object must be of type DateTime.</value>
+ </data>
+ <data name="Arg_MustBeDateTimeOffset" xml:space="preserve">
+ <value>Object must be of type DateTimeOffset.</value>
+ </data>
+ <data name="Arg_MustBeDecimal" xml:space="preserve">
+ <value>Object must be of type Decimal.</value>
+ </data>
+ <data name="Arg_MustBeDelegate" xml:space="preserve">
+ <value>Type must derive from Delegate.</value>
+ </data>
+ <data name="Arg_MustBeDouble" xml:space="preserve">
+ <value>Object must be of type Double.</value>
+ </data>
+ <data name="Arg_MustBeDriveLetterOrRootDir" xml:space="preserve">
+ <value>Object must be a root directory ("C:\\") or a drive letter ("C").</value>
+ </data>
+ <data name="Arg_MustBeEnum" xml:space="preserve">
+ <value>Type provided must be an Enum.</value>
+ </data>
+ <data name="Arg_MustBeEnumBaseTypeOrEnum" xml:space="preserve">
+ <value>The value passed in must be an enum base or an underlying type for an enum, such as an Int32.</value>
+ </data>
+ <data name="Arg_MustBeGuid" xml:space="preserve">
+ <value>Object must be of type GUID.</value>
+ </data>
+ <data name="Arg_MustBeIdentityReferenceType" xml:space="preserve">
+ <value>Type must be an IdentityReference, such as NTAccount or SecurityIdentifier.</value>
+ </data>
+ <data name="Arg_MustBeInt16" xml:space="preserve">
+ <value>Object must be of type Int16.</value>
+ </data>
+ <data name="Arg_MustBeInt32" xml:space="preserve">
+ <value>Object must be of type Int32.</value>
+ </data>
+ <data name="Arg_MustBeInt64" xml:space="preserve">
+ <value>Object must be of type Int64.</value>
+ </data>
+ <data name="Arg_MustBeInterface" xml:space="preserve">
+ <value>Type passed must be an interface.</value>
+ </data>
+ <data name="Arg_MustBePointer" xml:space="preserve">
+ <value>Type must be a Pointer.</value>
+ </data>
+ <data name="Arg_MustBePrimArray" xml:space="preserve">
+ <value>Object must be an array of primitives.</value>
+ </data>
+ <data name="Arg_MustBeSByte" xml:space="preserve">
+ <value>Object must be of type SByte.</value>
+ </data>
+ <data name="Arg_MustBeSingle" xml:space="preserve">
+ <value>Object must be of type Single.</value>
+ </data>
+ <data name="Arg_MustBeStatic" xml:space="preserve">
+ <value>Method must be a static method.</value>
+ </data>
+ <data name="Arg_MustBeString" xml:space="preserve">
+ <value>Object must be of type String.</value>
+ </data>
+ <data name="Arg_MustBeStringPtrNotAtom" xml:space="preserve">
+ <value>The pointer passed in as a String must not be in the bottom 64K of the process's address space.</value>
+ </data>
+ <data name="Arg_MustBeTimeSpan" xml:space="preserve">
+ <value>Object must be of type TimeSpan.</value>
+ </data>
+ <data name="Arg_MustBeTrue" xml:space="preserve">
+ <value>Argument must be true.</value>
+ </data>
+ <data name="Arg_MustBeType" xml:space="preserve">
+ <value>Type must be a type provided by the runtime.</value>
+ </data>
+ <data name="Arg_MustBeUInt16" xml:space="preserve">
+ <value>Object must be of type UInt16.</value>
+ </data>
+ <data name="Arg_MustBeUInt32" xml:space="preserve">
+ <value>Object must be of type UInt32.</value>
+ </data>
+ <data name="Arg_MustBeUInt64" xml:space="preserve">
+ <value>Object must be of type UInt64.</value>
+ </data>
+ <data name="Arg_MustBeVersion" xml:space="preserve">
+ <value>Object must be of type Version.</value>
+ </data>
+ <data name="Arg_MustContainEnumInfo" xml:space="preserve">
+ <value>Must specify valid information for parsing in the string.</value>
+ </data>
+ <data name="Arg_NamedParamNull" xml:space="preserve">
+ <value>Named parameter value must not be null.</value>
+ </data>
+ <data name="Arg_NamedParamTooBig" xml:space="preserve">
+ <value>Named parameter array cannot be bigger than argument array.</value>
+ </data>
+ <data name="Arg_NDirectBadObject" xml:space="preserve">
+ <value>No PInvoke conversion exists for value passed to Object-typed parameter.</value>
+ </data>
+ <data name="Arg_Need1DArray" xml:space="preserve">
+ <value>Array was not a one-dimensional array.</value>
+ </data>
+ <data name="Arg_Need2DArray" xml:space="preserve">
+ <value>Array was not a two-dimensional array.</value>
+ </data>
+ <data name="Arg_Need3DArray" xml:space="preserve">
+ <value>Array was not a three-dimensional array.</value>
+ </data>
+ <data name="Arg_NeedAtLeast1Rank" xml:space="preserve">
+ <value>Must provide at least one rank.</value>
+ </data>
+ <data name="Arg_NegativeArgCount" xml:space="preserve">
+ <value>Argument count must not be negative.</value>
+ </data>
+ <data name="Arg_NoAccessSpec" xml:space="preserve">
+ <value>Must specify binding flags describing the invoke operation required (BindingFlags.InvokeMethod CreateInstance GetField SetField GetProperty SetProperty).</value>
+ </data>
+ <data name="Arg_NoDefCTor" xml:space="preserve">
+ <value>No parameterless constructor defined for this object.</value>
+ </data>
+ <data name="Arg_NoImporterCallback" xml:space="preserve">
+ <value>Specified type library importer callback was invalid because it did not support the ITypeLibImporterNotifySink interface.</value>
+ </data>
+ <data name="Arg_NoITypeInfo" xml:space="preserve">
+ <value>Specified TypeInfo was invalid because it did not support the ITypeInfo interface.</value>
+ </data>
+ <data name="Arg_NoITypeLib" xml:space="preserve">
+ <value>Specified TypeLib was invalid because it did not support the ITypeLib interface.</value>
+ </data>
+ <data name="Arg_NonZeroLowerBound" xml:space="preserve">
+ <value>The lower bound of target array must be zero.</value>
+ </data>
+ <data name="Arg_NoStaticVirtual" xml:space="preserve">
+ <value>Method cannot be both static and virtual.</value>
+ </data>
+ <data name="Arg_NotFiniteNumberException" xml:space="preserve">
+ <value>Number encountered was not a finite quantity.</value>
+ </data>
+ <data name="Arg_NotFoundIFace" xml:space="preserve">
+ <value>Interface not found.</value>
+ </data>
+ <data name="Arg_NotGenericMethodDefinition" xml:space="preserve">
+ <value>{0} is not a GenericMethodDefinition. MakeGenericMethod may only be called on a method for which MethodBase.IsGenericMethodDefinition is true.</value>
+ </data>
+ <data name="Arg_NotGenericParameter" xml:space="preserve">
+ <value>Method may only be called on a Type for which Type.IsGenericParameter is true.</value>
+ </data>
+ <data name="Arg_NotGenericTypeDefinition" xml:space="preserve">
+ <value>{0} is not a GenericTypeDefinition. MakeGenericType may only be called on a type for which Type.IsGenericTypeDefinition is true.</value>
+ </data>
+ <data name="Arg_NotImplementedException" xml:space="preserve">
+ <value>The method or operation is not implemented.</value>
+ </data>
+ <data name="Arg_NotSupportedException" xml:space="preserve">
+ <value>Specified method is not supported.</value>
+ </data>
+ <data name="Arg_NullIndex" xml:space="preserve">
+ <value>Arrays indexes must be set to an object instance.</value>
+ </data>
+ <data name="Arg_NullReferenceException" xml:space="preserve">
+ <value>Object reference not set to an instance of an object.</value>
+ </data>
+ <data name="Arg_ObjObj" xml:space="preserve">
+ <value>Object type cannot be converted to target type.</value>
+ </data>
+ <data name="Arg_ObjObjEx" xml:space="preserve">
+ <value>Object of type '{0}' cannot be converted to type '{1}'.</value>
+ </data>
+ <data name="Arg_OleAutDateInvalid" xml:space="preserve">
+ <value>Not a legal OleAut date.</value>
+ </data>
+ <data name="Arg_OleAutDateScale" xml:space="preserve">
+ <value>OleAut date did not convert to a DateTime correctly.</value>
+ </data>
+ <data name="Arg_OverflowException" xml:space="preserve">
+ <value>Arithmetic operation resulted in an overflow.</value>
+ </data>
+ <data name="Arg_ParameterInfoNullMember" xml:space="preserve">
+ <value>The MemberInfo object defining the parameter cannot be null.</value>
+ </data>
+ <data name="Arg_ParameterInfoNullModule" xml:space="preserve">
+ <value>The Module object containing the parameter cannot be null.</value>
+ </data>
+ <data name="Arg_ParamName_Name" xml:space="preserve">
+ <value>Parameter name: {0}</value>
+ </data>
+ <data name="Arg_ParmArraySize" xml:space="preserve">
+ <value>Must specify one or more parameters.</value>
+ </data>
+ <data name="Arg_ParmCnt" xml:space="preserve">
+ <value>Parameter count mismatch.</value>
+ </data>
+ <data name="Arg_Path2IsRooted" xml:space="preserve">
+ <value>Second path fragment must not be a drive or UNC name.</value>
+ </data>
+ <data name="Arg_PathGlobalRoot" xml:space="preserve">
+ <value>Paths that begin with \\\\?\\GlobalRoot are internal to the kernel and should not be opened by managed applications.</value>
+ </data>
+ <data name="Arg_PathIllegal" xml:space="preserve">
+ <value>The path is not of a legal form.</value>
+ </data>
+ <data name="Arg_PathIllegalUNC" xml:space="preserve">
+ <value>The UNC path should be of the form \\\\server\\share.</value>
+ </data>
+ <data name="Arg_PathIsVolume" xml:space="preserve">
+ <value>Path must not be a drive.</value>
+ </data>
+ <data name="Arg_PlatformNotSupported" xml:space="preserve">
+ <value>Operation is not supported on this platform.</value>
+ </data>
+ <data name="Arg_PlatformSecureString" xml:space="preserve">
+ <value>SecureString is only supported on Windows 2000 SP3 and higher platforms.</value>
+ </data>
+ <data name="Arg_PrimWiden" xml:space="preserve">
+ <value>Cannot widen from source type to target type either because the source type is a not a primitive type or the conversion cannot be accomplished.</value>
+ </data>
+ <data name="Arg_PropNotFound" xml:space="preserve">
+ <value>Could not find the specified property.</value>
+ </data>
+ <data name="Arg_PropSetGet" xml:space="preserve">
+ <value>Cannot specify both Get and Set on a property.</value>
+ </data>
+ <data name="Arg_PropSetInvoke" xml:space="preserve">
+ <value>Cannot specify Set on a property and Invoke on a method.</value>
+ </data>
+ <data name="Arg_RankException" xml:space="preserve">
+ <value>Attempted to operate on an array with the incorrect number of dimensions.</value>
+ </data>
+ <data name="Arg_RankIndices" xml:space="preserve">
+ <value>Indices length does not match the array rank.</value>
+ </data>
+ <data name="Arg_RankMultiDimNotSupported" xml:space="preserve">
+ <value>Only single dimensional arrays are supported for the requested action.</value>
+ </data>
+ <data name="Arg_RanksAndBounds" xml:space="preserve">
+ <value>Number of lengths and lowerBounds must match.</value>
+ </data>
+ <data name="Arg_ReflectionOnlyCA" xml:space="preserve">
+ <value>It is illegal to reflect on the custom attributes of a Type loaded via ReflectionOnlyGetType (see Assembly.ReflectionOnly) -- use CustomAttributeData instead.</value>
+ </data>
+ <data name="Arg_ReflectionOnlyField" xml:space="preserve">
+ <value>It is illegal to get or set the value on a field on a Type loaded via ReflectionOnlyGetType.</value>
+ </data>
+ <data name="Arg_ReflectionOnlyInvoke" xml:space="preserve">
+ <value>It is illegal to invoke a method on a Type loaded via ReflectionOnlyGetType.</value>
+ </data>
+ <data name="Arg_RegBadKeyKind" xml:space="preserve">
+ <value>The specified RegistryValueKind is an invalid value.</value>
+ </data>
+ <data name="Arg_RegGetOverflowBug" xml:space="preserve">
+ <value>RegistryKey.GetValue does not allow a String that has a length greater than Int32.MaxValue.</value>
+ </data>
+ <data name="Arg_RegInvalidKeyName" xml:space="preserve">
+ <value>Registry key name must start with a valid base key name.</value>
+ </data>
+ <data name="Arg_RegKeyDelHive" xml:space="preserve">
+ <value>Cannot delete a registry hive's subtree.</value>
+ </data>
+ <data name="Arg_RegKeyNoRemoteConnect" xml:space="preserve">
+ <value>No remote connection to '{0}' while trying to read the registry.</value>
+ </data>
+ <data name="Arg_RegKeyNotFound" xml:space="preserve">
+ <value>The specified registry key does not exist.</value>
+ </data>
+ <data name="Arg_RegKeyOutOfRange" xml:space="preserve">
+ <value>Registry HKEY was out of the legal range.</value>
+ </data>
+ <data name="Arg_RegKeyStrLenBug" xml:space="preserve">
+ <value>Registry key names should not be greater than 255 characters.</value>
+ </data>
+ <data name="Arg_RegSetBadArrType" xml:space="preserve">
+ <value>RegistryKey.SetValue does not support arrays of type '{0}'. Only Byte[] and String[] are supported.</value>
+ </data>
+ <data name="Arg_RegSetMismatchedKind" xml:space="preserve">
+ <value>The type of the value object did not match the specified RegistryValueKind or the object could not be properly converted.</value>
+ </data>
+ <data name="Arg_RegSetStrArrNull" xml:space="preserve">
+ <value>RegistryKey.SetValue does not allow a String[] that contains a null String reference.</value>
+ </data>
+ <data name="Arg_RegSubKeyAbsent" xml:space="preserve">
+ <value>Cannot delete a subkey tree because the subkey does not exist.</value>
+ </data>
+ <data name="Arg_RegSubKeyValueAbsent" xml:space="preserve">
+ <value>No value exists with that name.</value>
+ </data>
+ <data name="Arg_RegValStrLenBug" xml:space="preserve">
+ <value>Registry value names should not be greater than 16,383 characters.</value>
+ </data>
+ <data name="Arg_RemoveArgNotFound" xml:space="preserve">
+ <value>Cannot remove the specified item because it was not found in the specified Collection.</value>
+ </data>
+ <data name="Arg_ResMgrNotResSet" xml:space="preserve">
+ <value>Type parameter must refer to a subclass of ResourceSet.</value>
+ </data>
+ <data name="Arg_ResourceFileUnsupportedVersion" xml:space="preserve">
+ <value>The ResourceReader class does not know how to read this version of .resources files. Expected version: {0} This file: {1}</value>
+ </data>
+ <data name="Arg_ResourceNameNotExist" xml:space="preserve">
+ <value>The specified resource name "{0}" does not exist in the resource file.</value>
+ </data>
+ <data name="Arg_RWLockRestoreException" xml:space="preserve">
+ <value>ReaderWriterLock.RestoreLock was called without releasing all locks acquired since the call to ReleaseLock.</value>
+ </data>
+ <data name="Arg_SafeArrayRankMismatchException" xml:space="preserve">
+ <value>Specified array was not of the expected rank.</value>
+ </data>
+ <data name="Arg_SafeArrayTypeMismatchException" xml:space="preserve">
+ <value>Specified array was not of the expected type.</value>
+ </data>
+ <data name="Arg_SecurityException" xml:space="preserve">
+ <value>Security error.</value>
+ </data>
+ <data name="Arg_SerializationException" xml:space="preserve">
+ <value>Serialization error.</value>
+ </data>
+ <data name="Arg_SetMethNotFnd" xml:space="preserve">
+ <value>Property set method not found.</value>
+ </data>
+ <data name="Arg_StackOverflowException" xml:space="preserve">
+ <value>Operation caused a stack overflow.</value>
+ </data>
+ <data name="Arg_SurrogatesNotAllowedAsSingleChar" xml:space="preserve">
+ <value>Unicode surrogate characters must be written out as pairs together in the same call, not individually. Consider passing in a character array instead.</value>
+ </data>
+ <data name="Arg_SynchronizationLockException" xml:space="preserve">
+ <value>Object synchronization method was called from an unsynchronized block of code.</value>
+ </data>
+ <data name="Arg_SystemException" xml:space="preserve">
+ <value>System error.</value>
+ </data>
+ <data name="Arg_TargetInvocationException" xml:space="preserve">
+ <value>Exception has been thrown by the target of an invocation.</value>
+ </data>
+ <data name="Arg_TargetParameterCountException" xml:space="preserve">
+ <value>Number of parameters specified does not match the expected number.</value>
+ </data>
+ <data name="Arg_ThreadStartException" xml:space="preserve">
+ <value>Thread failed to start.</value>
+ </data>
+ <data name="Arg_ThreadStateException" xml:space="preserve">
+ <value>Thread was in an invalid state for the operation being executed.</value>
+ </data>
+ <data name="Arg_TimeoutException" xml:space="preserve">
+ <value>The operation has timed out.</value>
+ </data>
+ <data name="Arg_TypeAccessException" xml:space="preserve">
+ <value>Attempt to access the type failed.</value>
+ </data>
+ <data name="Arg_TypedReference_Null" xml:space="preserve">
+ <value>The TypedReference must be initialized.</value>
+ </data>
+ <data name="Arg_TypeLoadException" xml:space="preserve">
+ <value>Failure has occurred while loading a type.</value>
+ </data>
+ <data name="Arg_TypeLoadNullStr" xml:space="preserve">
+ <value>A null or zero length string does not represent a valid Type.</value>
+ </data>
+ <data name="Arg_TypeRefPrimitve" xml:space="preserve">
+ <value>TypedReferences cannot be redefined as primitives.</value>
+ </data>
+ <data name="Arg_TypeUnloadedException" xml:space="preserve">
+ <value>Type had been unloaded.</value>
+ </data>
+ <data name="Arg_UnauthorizedAccessException" xml:space="preserve">
+ <value>Attempted to perform an unauthorized operation.</value>
+ </data>
+ <data name="Arg_UnboundGenField" xml:space="preserve">
+ <value>Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true.</value>
+ </data>
+ <data name="Arg_UnboundGenParam" xml:space="preserve">
+ <value>Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.</value>
+ </data>
+ <data name="Arg_UnknownTypeCode" xml:space="preserve">
+ <value>Unknown TypeCode value.</value>
+ </data>
+ <data name="Arg_VarMissNull" xml:space="preserve">
+ <value>Missing parameter does not have a default value.</value>
+ </data>
+ <data name="Arg_VersionString" xml:space="preserve">
+ <value>Version string portion was too short or too long.</value>
+ </data>
+ <data name="Arg_VTableCallsNotSupportedException" xml:space="preserve">
+ <value>Attempted to make an early bound call on a COM dispatch-only interface.</value>
+ </data>
+ <data name="Arg_WrongAsyncResult" xml:space="preserve">
+ <value>IAsyncResult object did not come from the corresponding async method on this type.</value>
+ </data>
+ <data name="Arg_WrongType" xml:space="preserve">
+ <value>The value "{0}" is not of type "{1}" and cannot be used in this generic collection.</value>
+ </data>
+ <data name="Argument_AbsolutePathRequired" xml:space="preserve">
+ <value>Absolute path information is required.</value>
+ </data>
+ <data name="Argument_AddingDuplicate" xml:space="preserve">
+ <value>An item with the same key has already been added.</value>
+ </data>
+ <data name="Argument_AddingDuplicate__" xml:space="preserve">
+ <value>Item has already been added. Key in dictionary: '{0}' Key being added: '{1}'</value>
+ </data>
+ <data name="Argument_AddingDuplicateWithKey" xml:space="preserve">
+ <value>An item with the same key has already been added. Key: {0}</value>
+ </data>
+ <data name="Argument_AdjustmentRulesAmbiguousOverlap" xml:space="preserve">
+ <value>The elements of the AdjustmentRule array must not contain ambiguous time periods that extend beyond the DateStart or DateEnd properties of the element.</value>
+ </data>
+ <data name="Argument_AdjustmentRulesInvalidOverlap" xml:space="preserve">
+ <value>The elements of the AdjustmentRule array must not contain invalid time periods that extend beyond the DateStart or DateEnd properties of the element.</value>
+ </data>
+ <data name="Argument_AdjustmentRulesNoNulls" xml:space="preserve">
+ <value>The AdjustmentRule array cannot contain null elements.</value>
+ </data>
+ <data name="Argument_AdjustmentRulesOutOfOrder" xml:space="preserve">
+ <value>The elements of the AdjustmentRule array must be in chronological order and must not overlap.</value>
+ </data>
+ <data name="Argument_AdjustmentRulesrDaylightSavingTimeOverlap" xml:space="preserve">
+ <value>The elements of the AdjustmentRule array must not contain Daylight Saving Time periods that overlap adjacent elements in such a way as to cause invalid or ambiguous time periods.</value>
+ </data>
+ <data name="Argument_AdjustmentRulesrDaylightSavingTimeOverlapNonRuleRange" xml:space="preserve">
+ <value>The elements of the AdjustmentRule array must not contain Daylight Saving Time periods that overlap the DateStart or DateEnd properties in such a way as to cause invalid or ambiguous time periods.</value>
+ </data>
+ <data name="Argument_AlreadyACCW" xml:space="preserve">
+ <value>The object already has a CCW associated with it.</value>
+ </data>
+ <data name="Argument_AlreadyBoundOrSyncHandle" xml:space="preserve">
+ <value>'handle' has already been bound to the thread pool, or was not opened for asynchronous I/O.</value>
+ </data>
+ <data name="Argument_ALSInvalidCapacity" xml:space="preserve">
+ <value>Specified capacity must not be less than the current capacity.</value>
+ </data>
+ <data name="Argument_ALSInvalidSlot" xml:space="preserve">
+ <value>Specified slot number was invalid.</value>
+ </data>
+ <data name="Argument_ApplicationTrustShouldHaveIdentity" xml:space="preserve">
+ <value>An ApplicationTrust must have an application identity before it can be persisted.</value>
+ </data>
+ <data name="Argument_ArgumentZero" xml:space="preserve">
+ <value>Argument cannot be zero.</value>
+ </data>
+ <data name="Argument_ArrayGetInterfaceMap" xml:space="preserve">
+ <value>Interface maps for generic interfaces on arrays cannot be retrieved.</value>
+ </data>
+ <data name="Argument_ArraysInvalid" xml:space="preserve">
+ <value>Array or pointer types are not valid.</value>
+ </data>
+ <data name="Argument_ArrayTooLarge" xml:space="preserve">
+ <value>The input array length must not exceed Int32.MaxValue / {0}. Otherwise BitArray.Length would exceed Int32.MaxValue.</value>
+ </data>
+ <data name="Argument_AssemblyAlreadyFullTrust" xml:space="preserve">
+ <value>Assembly was already fully trusted.</value>
+ </data>
+ <data name="Argument_AssemblyNotFullTrust" xml:space="preserve">
+ <value>Assembly was not fully trusted.</value>
+ </data>
+ <data name="Argument_AssemblyWinMD" xml:space="preserve">
+ <value>Assembly must not be a Windows Runtime assembly.</value>
+ </data>
+ <data name="Argument_AttributeNamesMustBeUnique" xml:space="preserve">
+ <value>Attribute names must be unique.</value>
+ </data>
+ <data name="Argument_BadAttributeOnInterfaceMethod" xml:space="preserve">
+ <value>Interface method must be abstract and virtual.</value>
+ </data>
+ <data name="Argument_BadCAForUnmngRSC" xml:space="preserve">
+ <value>Bad '{0}' while generating unmanaged resource information.</value>
+ </data>
+ <data name="Argument_BadConstantValue" xml:space="preserve">
+ <value>Bad default value.</value>
+ </data>
+ <data name="Argument_BadConstructor" xml:space="preserve">
+ <value>Cannot have private or static constructor.</value>
+ </data>
+ <data name="Argument_BadConstructorCallConv" xml:space="preserve">
+ <value>Constructor must have standard calling convention.</value>
+ </data>
+ <data name="Argument_BadCurrentLocalVariable" xml:space="preserve">
+ <value>Bad current local variable for setting symbol information.</value>
+ </data>
+ <data name="Argument_BadExceptionCodeGen" xml:space="preserve">
+ <value>Incorrect code generation for exception block.</value>
+ </data>
+ <data name="Argument_BadFieldForConstructorBuilder" xml:space="preserve">
+ <value>Field must be on the same type of the given ConstructorInfo.</value>
+ </data>
+ <data name="Argument_BadFieldSig" xml:space="preserve">
+ <value>Field signatures do not have return types.</value>
+ </data>
+ <data name="Argument_BadFieldType" xml:space="preserve">
+ <value>Bad field type in defining field.</value>
+ </data>
+ <data name="Argument_BadFormatSpecifier" xml:space="preserve">
+ <value>Format specifier was invalid.</value>
+ </data>
+ <data name="Argument_BadImageFormatExceptionResolve" xml:space="preserve">
+ <value>A BadImageFormatException has been thrown while parsing the signature. This is likely due to lack of a generic context. Ensure genericTypeArguments and genericMethodArguments are provided and contain enough context.</value>
+ </data>
+ <data name="Argument_BadLabel" xml:space="preserve">
+ <value>Bad label in ILGenerator.</value>
+ </data>
+ <data name="Argument_BadLabelContent" xml:space="preserve">
+ <value>Bad label content in ILGenerator.</value>
+ </data>
+ <data name="Argument_BadNestedTypeFlags" xml:space="preserve">
+ <value>Visibility of interfaces must be one of the following: NestedAssembly, NestedFamANDAssem, NestedFamily, NestedFamORAssem, NestedPrivate or NestedPublic.</value>
+ </data>
+ <data name="Argument_BadObjRef" xml:space="preserve">
+ <value>Invalid ObjRef provided to '{0}'.</value>
+ </data>
+ <data name="Argument_BadParameterCountsForConstructor" xml:space="preserve">
+ <value>Parameter count does not match passed in argument value count.</value>
+ </data>
+ <data name="Argument_BadParameterTypeForCAB" xml:space="preserve">
+ <value>Cannot emit a CustomAttribute with argument of type {0}.</value>
+ </data>
+ <data name="Argument_BadParameterTypeForConstructor" xml:space="preserve">
+ <value>Passed in argument value at index {0} does not match the parameter type.</value>
+ </data>
+ <data name="Argument_BadPersistableModuleInTransientAssembly" xml:space="preserve">
+ <value>Cannot have a persistable module in a transient assembly.</value>
+ </data>
+ <data name="Argument_BadPInvokeMethod" xml:space="preserve">
+ <value>PInvoke methods must be static and native and cannot be abstract.</value>
+ </data>
+ <data name="Argument_BadPInvokeOnInterface" xml:space="preserve">
+ <value>PInvoke methods cannot exist on interfaces.</value>
+ </data>
+ <data name="Argument_BadPropertyForConstructorBuilder" xml:space="preserve">
+ <value>Property must be on the same type of the given ConstructorInfo.</value>
+ </data>
+ <data name="Argument_BadResourceScopeTypeBits" xml:space="preserve">
+ <value>Unknown value for the ResourceScope: {0} Too many resource type bits may be set.</value>
+ </data>
+ <data name="Argument_BadResourceScopeVisibilityBits" xml:space="preserve">
+ <value>Unknown value for the ResourceScope: {0} Too many resource visibility bits may be set.</value>
+ </data>
+ <data name="Argument_BadSigFormat" xml:space="preserve">
+ <value>Incorrect signature format.</value>
+ </data>
+ <data name="Argument_BadSizeForData" xml:space="preserve">
+ <value>Data size must be > 1 and < 0x3f0000</value>
+ </data>
+ <data name="Argument_BadTypeAttrAbstractNFinal" xml:space="preserve">
+ <value>Bad type attributes. A type cannot be both abstract and final.</value>
+ </data>
+ <data name="Argument_BadTypeAttrInvalidLayout" xml:space="preserve">
+ <value>Bad type attributes. Invalid layout attribute specified.</value>
+ </data>
+ <data name="Argument_BadTypeAttrNestedVisibilityOnNonNestedType" xml:space="preserve">
+ <value>Bad type attributes. Nested visibility flag set on a non-nested type.</value>
+ </data>
+ <data name="Argument_BadTypeAttrNonNestedVisibilityNestedType" xml:space="preserve">
+ <value>Bad type attributes. Non-nested visibility flag set on a nested type.</value>
+ </data>
+ <data name="Argument_BadTypeAttrReservedBitsSet" xml:space="preserve">
+ <value>Bad type attributes. Reserved bits set on the type.</value>
+ </data>
+ <data name="Argument_BadTypeInCustomAttribute" xml:space="preserve">
+ <value>An invalid type was used as a custom attribute constructor argument, field or property.</value>
+ </data>
+ <data name="Argument_CannotCreateTypedReference" xml:space="preserve">
+ <value>Cannot use function evaluation to create a TypedReference object.</value>
+ </data>
+ <data name="Argument_CannotGetTypeTokenForByRef" xml:space="preserve">
+ <value>Cannot get TypeToken for a ByRef type.</value>
+ </data>
+ <data name="Argument_CannotPrepareAbstract" xml:space="preserve">
+ <value>Abstract methods cannot be prepared.</value>
+ </data>
+ <data name="Argument_CannotSetParentToInterface" xml:space="preserve">
+ <value>Cannot set parent to an interface.</value>
+ </data>
+ <data name="Argument_CantCallSecObjFunc" xml:space="preserve">
+ <value>Cannot evaluate a security function.</value>
+ </data>
+ <data name="Argument_CodepageNotSupported" xml:space="preserve">
+ <value>{0} is not a supported code page.</value>
+ </data>
+ <data name="Argument_CompareOptionOrdinal" xml:space="preserve">
+ <value>CompareOption.Ordinal cannot be used with other options.</value>
+ </data>
+ <data name="Argument_ConflictingDateTimeRoundtripStyles" xml:space="preserve">
+ <value>The DateTimeStyles value RoundtripKind cannot be used with the values AssumeLocal, AssumeUniversal or AdjustToUniversal.</value>
+ </data>
+ <data name="Argument_ConflictingDateTimeStyles" xml:space="preserve">
+ <value>The DateTimeStyles values AssumeLocal and AssumeUniversal cannot be used together.</value>
+ </data>
+ <data name="Argument_ConstantDoesntMatch" xml:space="preserve">
+ <value>Constant does not match the defined type.</value>
+ </data>
+ <data name="Argument_ConstantNotSupported" xml:space="preserve">
+ <value>{0} is not a supported constant type.</value>
+ </data>
+ <data name="Argument_ConstantNull" xml:space="preserve">
+ <value>Null is not a valid constant value for this type.</value>
+ </data>
+ <data name="Argument_ConstructorNeedGenericDeclaringType" xml:space="preserve">
+ <value>The specified constructor must be declared on a generic type definition.</value>
+ </data>
+ <data name="Argument_ConversionOverflow" xml:space="preserve">
+ <value>Conversion buffer overflow.</value>
+ </data>
+ <data name="Argument_ConvertMismatch" xml:space="preserve">
+ <value>The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local.</value>
+ </data>
+ <data name="Argument_CORDBBadMethod" xml:space="preserve">
+ <value>Cannot find the method on the object instance.</value>
+ </data>
+ <data name="Argument_CORDBBadVarArgCallConv" xml:space="preserve">
+ <value>Cannot evaluate a VarArgs function.</value>
+ </data>
+ <data name="Argument_CultureIetfNotSupported" xml:space="preserve">
+ <value>Culture IETF Name {0} is not a recognized IETF name.</value>
+ </data>
+ <data name="Argument_CultureInvalidFormat" xml:space="preserve">
+ <value>Culture '{0}' is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture.</value>
+ </data>
+ <data name="Argument_CultureInvalidIdentifier" xml:space="preserve">
+ <value>{0} is an invalid culture identifier.</value>
+ </data>
+ <data name="Argument_CultureIsNeutral" xml:space="preserve">
+ <value>Culture ID {0} (0x{0:X4}) is a neutral culture; a region cannot be created from it.</value>
+ </data>
+ <data name="Argument_CultureNotSupported" xml:space="preserve">
+ <value>Culture is not supported.</value>
+ </data>
+ <data name="Argument_CustomAssemblyLoadContextRequestedNameMismatch" xml:space="preserve">
+ <value>Resolved assembly's simple name should be the same as of the requested assembly.</value>
+ </data>
+ <data name="Argument_CustomCultureCannotBePassedByNumber" xml:space="preserve">
+ <value>Customized cultures cannot be passed by LCID, only by name.</value>
+ </data>
+ <data name="Argument_cvtres_NotFound" xml:space="preserve">
+ <value>Cannot find cvtres.exe</value>
+ </data>
+ <data name="Argument_DataLengthDifferent" xml:space="preserve">
+ <value>Parameters 'members' and 'data' must have the same length.</value>
+ </data>
+ <data name="Argument_DateTimeBadBinaryData" xml:space="preserve">
+ <value>The binary data must result in a DateTime with ticks between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.</value>
+ </data>
+ <data name="Argument_DateTimeHasTicks" xml:space="preserve">
+ <value>The supplied DateTime must have the Year, Month, and Day properties set to 1. The time cannot be specified more precisely than whole milliseconds.</value>
+ </data>
+ <data name="Argument_DateTimeHasTimeOfDay" xml:space="preserve">
+ <value>The supplied DateTime includes a TimeOfDay setting. This is not supported.</value>
+ </data>
+ <data name="Argument_DateTimeIsInvalid" xml:space="preserve">
+ <value>The supplied DateTime represents an invalid time. For example, when the clock is adjusted forward, any time in the period that is skipped is invalid.</value>
+ </data>
+ <data name="Argument_DateTimeIsNotAmbiguous" xml:space="preserve">
+ <value>The supplied DateTime is not in an ambiguous time range.</value>
+ </data>
+ <data name="Argument_DateTimeKindMustBeUnspecified" xml:space="preserve">
+ <value>The supplied DateTime must have the Kind property set to DateTimeKind.Unspecified.</value>
+ </data>
+ <data name="Argument_DateTimeKindMustBeUnspecifiedOrUtc" xml:space="preserve">
+ <value>The supplied DateTime must have the Kind property set to DateTimeKind.Unspecified or DateTimeKind.Utc.</value>
+ </data>
+ <data name="Argument_DateTimeOffsetInvalidDateTimeStyles" xml:space="preserve">
+ <value>The DateTimeStyles value 'NoCurrentDateDefault' is not allowed when parsing DateTimeOffset.</value>
+ </data>
+ <data name="Argument_DateTimeOffsetIsNotAmbiguous" xml:space="preserve">
+ <value>The supplied DateTimeOffset is not in an ambiguous time range.</value>
+ </data>
+ <data name="Argument_DestinationTooShort" xml:space="preserve">
+ <value>Destination is too short.</value>
+ </data>
+ <data name="Argument_DuplicatedFileName" xml:space="preserve">
+ <value>Duplicate file names.</value>
+ </data>
+ <data name="Argument_DuplicateModuleName" xml:space="preserve">
+ <value>Duplicate dynamic module name within an assembly.</value>
+ </data>
+ <data name="Argument_DuplicateName" xml:space="preserve">
+ <value>Tried to add NamedPermissionSet with non-unique name.</value>
+ </data>
+ <data name="Argument_DuplicateResourceName" xml:space="preserve">
+ <value>Duplicate resource name within an assembly.</value>
+ </data>
+ <data name="Argument_DuplicateTypeName" xml:space="preserve">
+ <value>Duplicate type name within an assembly.</value>
+ </data>
+ <data name="Argument_EmitWriteLineType" xml:space="preserve">
+ <value>EmitWriteLine does not support this field or local type.</value>
+ </data>
+ <data name="Argument_EmptyApplicationName" xml:space="preserve">
+ <value>ApplicationId cannot have an empty string for the name.</value>
+ </data>
+ <data name="Argument_EmptyDecString" xml:space="preserve">
+ <value>Decimal separator cannot be the empty string.</value>
+ </data>
+ <data name="Argument_EmptyFileName" xml:space="preserve">
+ <value>Empty file name is not legal.</value>
+ </data>
+ <data name="Argument_EmptyName" xml:space="preserve">
+ <value>Empty name is not legal.</value>
+ </data>
+ <data name="Argument_EmptyPath" xml:space="preserve">
+ <value>Empty path name is not legal.</value>
+ </data>
+ <data name="Argument_EmptyStrongName" xml:space="preserve">
+ <value>StrongName cannot have an empty string for the assembly name.</value>
+ </data>
+ <data name="Argument_EmptyWaithandleArray" xml:space="preserve">
+ <value>Waithandle array may not be empty.</value>
+ </data>
+ <data name="Argument_EncoderFallbackNotEmpty" xml:space="preserve">
+ <value>Must complete Convert() operation or call Encoder.Reset() before calling GetBytes() or GetByteCount(). Encoder '{0}' fallback '{1}'.</value>
+ </data>
+ <data name="Argument_EncodingConversionOverflowBytes" xml:space="preserve">
+ <value>The output byte buffer is too small to contain the encoded data, encoding '{0}' fallback '{1}'.</value>
+ </data>
+ <data name="Argument_EncodingConversionOverflowChars" xml:space="preserve">
+ <value>The output char buffer is too small to contain the decoded characters, encoding '{0}' fallback '{1}'.</value>
+ </data>
+ <data name="Argument_EncodingNotSupported" xml:space="preserve">
+ <value>'{0}' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.</value>
+ </data>
+ <data name="Argument_EnumIsNotIntOrShort" xml:space="preserve">
+ <value>The underlying type of enum argument must be Int32 or Int16.</value>
+ </data>
+ <data name="Argument_EnumTypeDoesNotMatch" xml:space="preserve">
+ <value>The argument type, '{0}', is not the same as the enum type '{1}'.</value>
+ </data>
+ <data name="Argument_FallbackBufferNotEmpty" xml:space="preserve">
+ <value>Cannot change fallback when buffer is not empty. Previous Convert() call left data in the fallback buffer.</value>
+ </data>
+ <data name="Argument_FieldDeclaringTypeGeneric" xml:space="preserve">
+ <value>Cannot resolve field {0} because the declaring type of the field handle {1} is generic. Explicitly provide the declaring type to GetFieldFromHandle.</value>
+ </data>
+ <data name="Argument_FieldNeedGenericDeclaringType" xml:space="preserve">
+ <value>The specified field must be declared on a generic type definition.</value>
+ </data>
+ <data name="Argument_FlagNotSupported" xml:space="preserve">
+ <value>One or more flags are not supported.</value>
+ </data>
+ <data name="Argument_FrameworkNameInvalid" xml:space="preserve">
+ <value>FrameworkName is invalid.</value>
+ </data>
+ <data name="Argument_FrameworkNameMissingVersion" xml:space="preserve">
+ <value>FrameworkName version component is missing.</value>
+ </data>
+ <data name="Argument_FrameworkNameTooShort" xml:space="preserve">
+ <value>FrameworkName cannot have less than two components or more than three components.</value>
+ </data>
+ <data name="Argument_GenConstraintViolation" xml:space="preserve">
+ <value>GenericArguments[{0}], '{1}', on '{2}' violates the constraint of type '{3}'.</value>
+ </data>
+ <data name="Argument_GenericArgsCount" xml:space="preserve">
+ <value>The number of generic arguments provided doesn't equal the arity of the generic type definition.</value>
+ </data>
+ <data name="Argument_GenericsInvalid" xml:space="preserve">
+ <value>Generic types are not valid.</value>
+ </data>
+ <data name="Argument_GlobalFunctionHasToBeStatic" xml:space="preserve">
+ <value>Global members must be static.</value>
+ </data>
+ <data name="Argument_HandleLeak" xml:space="preserve">
+ <value>Cannot pass a GCHandle across AppDomains.</value>
+ </data>
+ <data name="Argument_HasToBeArrayClass" xml:space="preserve">
+ <value>Must be an array type.</value>
+ </data>
+ <data name="Argument_IdnBadBidi" xml:space="preserve">
+ <value>Left to right characters may not be mixed with right to left characters in IDN labels.</value>
+ </data>
+ <data name="Argument_IdnBadLabelSize" xml:space="preserve">
+ <value>IDN labels must be between 1 and 63 characters long.</value>
+ </data>
+ <data name="Argument_IdnBadNameSize" xml:space="preserve">
+ <value>IDN names must be between 1 and {0} characters long.</value>
+ </data>
+ <data name="Argument_IdnBadPunycode" xml:space="preserve">
+ <value>Invalid IDN encoded string.</value>
+ </data>
+ <data name="Argument_IdnBadStd3" xml:space="preserve">
+ <value>Label contains character '{0}' not allowed with UseStd3AsciiRules</value>
+ </data>
+ <data name="Argument_IdnIllegalName" xml:space="preserve">
+ <value>Decoded string is not a valid IDN name.</value>
+ </data>
+ <data name="Argument_IllegalAppBase" xml:space="preserve">
+ <value>The application base specified is not valid.</value>
+ </data>
+ <data name="Argument_IllegalAppId" xml:space="preserve">
+ <value>Application identity does not have same number of components as manifest paths.</value>
+ </data>
+ <data name="Argument_IllegalAppIdMismatch" xml:space="preserve">
+ <value>Application identity does not match identities in manifests.</value>
+ </data>
+ <data name="Argument_IllegalEnvVarName" xml:space="preserve">
+ <value>Environment variable name cannot contain equal character.</value>
+ </data>
+ <data name="Argument_IllegalName" xml:space="preserve">
+ <value>Illegal name.</value>
+ </data>
+ <data name="Argument_IllegalZone" xml:space="preserve">
+ <value>Illegal security permission zone specified.</value>
+ </data>
+ <data name="Argument_ImplementIComparable" xml:space="preserve">
+ <value>At least one object must implement IComparable.</value>
+ </data>
+ <data name="Argument_ImproperType" xml:space="preserve">
+ <value>Improper types in collection.</value>
+ </data>
+ <data name="Argument_IndexOutOfArrayBounds" xml:space="preserve">
+ <value>The specified index is out of bounds of the specified array.</value>
+ </data>
+ <data name="Argument_InsufficientSpaceToCopyCollection" xml:space="preserve">
+ <value>The specified space is not sufficient to copy the elements from this Collection.</value>
+ </data>
+ <data name="Argument_InterfaceMap" xml:space="preserve">
+ <value>'this' type cannot be an interface itself.</value>
+ </data>
+ <data name="Argument_InvalidAnyFlag" xml:space="preserve">
+ <value>No flags can be set.</value>
+ </data>
+ <data name="Argument_InvalidAppendMode" xml:space="preserve">
+ <value>Append access can be requested only in write-only mode.</value>
+ </data>
+ <data name="Argument_InvalidAppId" xml:space="preserve">
+ <value>Invalid identity: no deployment or application identity specified.</value>
+ </data>
+ <data name="Argument_InvalidArgumentForComparison" xml:space="preserve">
+ <value>Type of argument is not compatible with the generic comparer.</value>
+ </data>
+ <data name="Argument_InvalidArrayLength" xml:space="preserve">
+ <value>Length of the array must be {0}.</value>
+ </data>
+ <data name="Argument_InvalidArrayType" xml:space="preserve">
+ <value>Target array type is not compatible with the type of items in the collection.</value>
+ </data>
+ <data name="Argument_InvalidAssemblyName" xml:space="preserve">
+ <value>Assembly names may not begin with whitespace or contain the characters '/', or '\\' or ':'.</value>
+ </data>
+ <data name="Argument_InvalidCalendar" xml:space="preserve">
+ <value>Not a valid calendar for the given culture.</value>
+ </data>
+ <data name="Argument_InvalidCharSequence" xml:space="preserve">
+ <value>Invalid Unicode code point found at index {0}.</value>
+ </data>
+ <data name="Argument_InvalidCharSequenceNoIndex" xml:space="preserve">
+ <value>String contains invalid Unicode code points.</value>
+ </data>
+ <data name="Argument_InvalidCodePageBytesIndex" xml:space="preserve">
+ <value>Unable to translate bytes {0} at index {1} from specified code page to Unicode.</value>
+ </data>
+ <data name="Argument_InvalidCodePageConversionIndex" xml:space="preserve">
+ <value>Unable to translate Unicode character \\u{0:X4} at index {1} to specified code page.</value>
+ </data>
+ <data name="Argument_InvalidConstructorDeclaringType" xml:space="preserve">
+ <value>The specified constructor must be declared on the generic type definition of the specified type.</value>
+ </data>
+ <data name="Argument_InvalidConstructorInfo" xml:space="preserve">
+ <value>The ConstructorInfo object is not valid.</value>
+ </data>
+ <data name="Argument_InvalidCultureName" xml:space="preserve">
+ <value>Culture name '{0}' is not supported.</value>
+ </data>
+ <data name="Argument_InvalidDateTimeKind" xml:space="preserve">
+ <value>Invalid DateTimeKind value.</value>
+ </data>
+ <data name="Argument_InvalidDateTimeStyles" xml:space="preserve">
+ <value>An undefined DateTimeStyles value is being used.</value>
+ </data>
+ <data name="Argument_InvalidDigitSubstitution" xml:space="preserve">
+ <value>The DigitSubstitution property must be of a valid member of the DigitShapes enumeration. Valid entries include Context, NativeNational or None.</value>
+ </data>
+ <data name="Argument_InvalidDirectory" xml:space="preserve">
+ <value>Invalid directory, '{0}'.</value>
+ </data>
+ <data name="Argument_InvalidDirectoryOnUrl" xml:space="preserve">
+ <value>Invalid directory on URL.</value>
+ </data>
+ <data name="Argument_InvalidElementName" xml:space="preserve">
+ <value>Invalid element name '{0}'.</value>
+ </data>
+ <data name="Argument_InvalidElementTag" xml:space="preserve">
+ <value>Invalid element tag '{0}'.</value>
+ </data>
+ <data name="Argument_InvalidElementText" xml:space="preserve">
+ <value>Invalid element text '{0}'.</value>
+ </data>
+ <data name="Argument_InvalidElementValue" xml:space="preserve">
+ <value>Invalid element value '{0}'.</value>
+ </data>
+ <data name="Argument_InvalidEnum" xml:space="preserve">
+ <value>The Enum type should contain one and only one instance field.</value>
+ </data>
+ <data name="Argument_InvalidEnumValue" xml:space="preserve">
+ <value>The value '{0}' is not valid for this usage of the type {1}.</value>
+ </data>
+ <data name="Argument_InvalidFieldDeclaringType" xml:space="preserve">
+ <value>The specified field must be declared on the generic type definition of the specified type.</value>
+ </data>
+ <data name="Argument_InvalidFieldInfo" xml:space="preserve">
+ <value>The FieldInfo object is not valid.</value>
+ </data>
+ <data name="Argument_InvalidFileModeAndAccessCombo" xml:space="preserve">
+ <value>Combining FileMode: {0} with FileAccess: {1} is invalid.</value>
+ </data>
+ <data name="Argument_InvalidFileModeAndRightsCombo" xml:space="preserve">
+ <value>Combining FileMode: {0} with FileSystemRights: {1} is invalid.</value>
+ </data>
+ <data name="Argument_InvalidFileModeTruncateAndRightsCombo" xml:space="preserve">
+ <value>Combining FileMode: {0} with FileSystemRights: {1} is invalid. FileMode.Truncate is valid only when used with FileSystemRights.Write.</value>
+ </data>
+ <data name="Argument_InvalidFlag" xml:space="preserve">
+ <value>Value of flags is invalid.</value>
+ </data>
+ <data name="Argument_InvalidGenericArg" xml:space="preserve">
+ <value>The generic type parameter was not valid</value>
+ </data>
+ <data name="Argument_InvalidGenericInstantiation" xml:space="preserve">
+ <value>The given generic instantiation was invalid.</value>
+ </data>
+ <data name="Argument_InvalidGenericInstArray" xml:space="preserve">
+ <value>Generic arguments must be provided for each generic parameter and each generic argument must be a RuntimeType.</value>
+ </data>
+ <data name="Argument_InvalidGroupSize" xml:space="preserve">
+ <value>Every element in the value array should be between one and nine, except for the last element, which can be zero.</value>
+ </data>
+ <data name="Argument_InvalidHandle" xml:space="preserve">
+ <value>The handle is invalid.</value>
+ </data>
+ <data name="Argument_InvalidHexFormat" xml:space="preserve">
+ <value>Improperly formatted hex string.</value>
+ </data>
+ <data name="Argument_InvalidHighSurrogate" xml:space="preserve">
+ <value>Found a high surrogate char without a following low surrogate at index: {0}. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters.</value>
+ </data>
+ <data name="Argument_InvalidId" xml:space="preserve">
+ <value>The specified ID parameter '{0}' is not supported.</value>
+ </data>
+ <data name="Argument_InvalidKey" xml:space="preserve">
+ <value>Key was invalid.</value>
+ </data>
+ <data name="Argument_InvalidKeyStore" xml:space="preserve">
+ <value>'{0}' is not a valid KeyStore name.</value>
+ </data>
+ <data name="Argument_InvalidKindOfTypeForCA" xml:space="preserve">
+ <value>This type cannot be represented as a custom attribute.</value>
+ </data>
+ <data name="Argument_InvalidLabel" xml:space="preserve">
+ <value>Invalid Label.</value>
+ </data>
+ <data name="Argument_InvalidLowSurrogate" xml:space="preserve">
+ <value>Found a low surrogate char without a preceding high surrogate at index: {0}. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters.</value>
+ </data>
+ <data name="Argument_InvalidMarshalByRefObject" xml:space="preserve">
+ <value>The MarshalByRefObject is not valid.</value>
+ </data>
+ <data name="Argument_InvalidMemberForNamedArgument" xml:space="preserve">
+ <value>The member must be either a field or a property.</value>
+ </data>
+ <data name="Argument_InvalidMethodDeclaringType" xml:space="preserve">
+ <value>The specified method must be declared on the generic type definition of the specified type.</value>
+ </data>
+ <data name="Argument_InvalidName" xml:space="preserve">
+ <value>Invalid name.</value>
+ </data>
+ <data name="Argument_InvalidNativeDigitCount" xml:space="preserve">
+ <value>The NativeDigits array must contain exactly ten members.</value>
+ </data>
+ <data name="Argument_InvalidNativeDigitValue" xml:space="preserve">
+ <value>Each member of the NativeDigits array must be a single text element (one or more UTF16 code points) with a Unicode Nd (Number, Decimal Digit) property indicating it is a digit.</value>
+ </data>
+ <data name="Argument_InvalidNeutralRegionName" xml:space="preserve">
+ <value>The region name {0} should not correspond to neutral culture; a specific culture name is required.</value>
+ </data>
+ <data name="Argument_InvalidNormalizationForm" xml:space="preserve">
+ <value>Invalid or unsupported normalization form.</value>
+ </data>
+ <data name="Argument_InvalidNumberOfMembers" xml:space="preserve">
+ <value>MemberData contains an invalid number of members.</value>
+ </data>
+ <data name="Argument_InvalidNumberStyles" xml:space="preserve">
+ <value>An undefined NumberStyles value is being used.</value>
+ </data>
+ <data name="Argument_InvalidOffLen" xml:space="preserve">
+ <value>Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.</value>
+ </data>
+ <data name="Argument_InvalidOpCodeOnDynamicMethod" xml:space="preserve">
+ <value>Ldtoken, Ldftn and Ldvirtftn OpCodes cannot target DynamicMethods.</value>
+ </data>
+ <data name="Argument_InvalidParameterInfo" xml:space="preserve">
+ <value>The ParameterInfo object is not valid.</value>
+ </data>
+ <data name="Argument_InvalidParamInfo" xml:space="preserve">
+ <value>Invalid type for ParameterInfo member in Attribute class.</value>
+ </data>
+ <data name="Argument_InvalidPathChars" xml:space="preserve">
+ <value>Illegal characters in path.</value>
+ </data>
+ <data name="Argument_InvalidPermissionState" xml:space="preserve">
+ <value>Invalid permission state.</value>
+ </data>
+ <data name="Argument_InvalidREG_TZI_FORMAT" xml:space="preserve">
+ <value>The REG_TZI_FORMAT structure is corrupt.</value>
+ </data>
+ <data name="Argument_InvalidRegionName" xml:space="preserve">
+ <value>Region name '{0}' is not supported.</value>
+ </data>
+ <data name="Argument_InvalidRegistryKeyPermissionCheck" xml:space="preserve">
+ <value>The specified RegistryKeyPermissionCheck value is invalid.</value>
+ </data>
+ <data name="Argument_InvalidRegistryOptionsCheck" xml:space="preserve">
+ <value>The specified RegistryOptions value is invalid.</value>
+ </data>
+ <data name="Argument_InvalidRegistryViewCheck" xml:space="preserve">
+ <value>The specified RegistryView value is invalid.</value>
+ </data>
+ <data name="Argument_InvalidResourceCultureName" xml:space="preserve">
+ <value>The given culture name '{0}' cannot be used to locate a resource file. Resource filenames must consist of only letters, numbers, hyphens or underscores.</value>
+ </data>
+ <data name="Argument_InvalidSafeBufferOffLen" xml:space="preserve">
+ <value>Offset and length were greater than the size of the SafeBuffer.</value>
+ </data>
+ <data name="Argument_InvalidSafeHandle" xml:space="preserve">
+ <value>The SafeHandle is invalid.</value>
+ </data>
+ <data name="Argument_InvalidSeekOrigin" xml:space="preserve">
+ <value>Invalid seek origin.</value>
+ </data>
+ <data name="Argument_InvalidSerializedString" xml:space="preserve">
+ <value>The specified serialized string '{0}' is not supported.</value>
+ </data>
+ <data name="Argument_InvalidSite" xml:space="preserve">
+ <value>Invalid site.</value>
+ </data>
+ <data name="Argument_InvalidSubPath" xml:space="preserve">
+ <value>The directory specified, '{0}', is not a subdirectory of '{1}'.</value>
+ </data>
+ <data name="Argument_InvalidTimeSpanStyles" xml:space="preserve">
+ <value>An undefined TimeSpanStyles value is being used.</value>
+ </data>
+ <data name="Argument_InvalidToken" xml:space="preserve">
+ <value>Token {0:x} is not valid in the scope of module {1}.</value>
+ </data>
+ <data name="Argument_InvalidType" xml:space="preserve">
+ <value>The type of arguments passed into generic comparer methods is invalid.</value>
+ </data>
+ <data name="Argument_InvalidTypeForCA" xml:space="preserve">
+ <value>Cannot build type parameter for custom attribute with a type that does not support the AssemblyQualifiedName property. The type instance supplied was of type '{0}'.</value>
+ </data>
+ <data name="Argument_InvalidTypeForDynamicMethod" xml:space="preserve">
+ <value>Invalid type owner for DynamicMethod.</value>
+ </data>
+ <data name="Argument_InvalidTypeName" xml:space="preserve">
+ <value>The name of the type is invalid.</value>
+ </data>
+ <data name="Argument_InvalidTypeToken" xml:space="preserve">
+ <value>Token {0:x} is not a valid Type token.</value>
+ </data>
+ <data name="Argument_InvalidTypeWithPointersNotSupported" xml:space="preserve">
+ <value>Cannot use type '{0}'. Only value types without pointers or references are supported.</value>
+ </data>
+ <data name="Argument_InvalidUnity" xml:space="preserve">
+ <value>Invalid Unity type.</value>
+ </data>
+ <data name="Argument_InvalidUrl" xml:space="preserve">
+ <value>Invalid URL.</value>
+ </data>
+ <data name="Argument_InvalidValue" xml:space="preserve">
+ <value>Value was invalid.</value>
+ </data>
+ <data name="Argument_InvalidXML" xml:space="preserve">
+ <value>Invalid Xml.</value>
+ </data>
+ <data name="Argument_InvalidXMLBadVersion" xml:space="preserve">
+ <value>Invalid Xml - can only parse elements of version one.</value>
+ </data>
+ <data name="Argument_InvalidXMLElement" xml:space="preserve">
+ <value>Invalid XML. Missing required tag <{0}> for type '{1}'.</value>
+ </data>
+ <data name="Argument_InvalidXMLMissingAttr" xml:space="preserve">
+ <value>Invalid XML. Missing required attribute '{0}'.</value>
+ </data>
+ <data name="Argument_ItemNotExist" xml:space="preserve">
+ <value>The specified item does not exist in this KeyedCollection.</value>
+ </data>
+ <data name="Argument_LargeInteger" xml:space="preserve">
+ <value>Integer or token was too large to be encoded.</value>
+ </data>
+ <data name="Argument_LongEnvVarName" xml:space="preserve">
+ <value>Environment variable name cannot contain 1024 or more characters.</value>
+ </data>
+ <data name="Argument_LongEnvVarValue" xml:space="preserve">
+ <value>Environment variable name or value is too long.</value>
+ </data>
+ <data name="Argument_ManifestFileDoesNotExist" xml:space="preserve">
+ <value>The specified manifest file does not exist.</value>
+ </data>
+ <data name="Argument_MemberAndArray" xml:space="preserve">
+ <value>Cannot supply both a MemberInfo and an Array to indicate the parent of a value type.</value>
+ </data>
+ <data name="Argument_MethodDeclaringTypeGeneric" xml:space="preserve">
+ <value>Cannot resolve method {0} because the declaring type of the method handle {1} is generic. Explicitly provide the declaring type to GetMethodFromHandle.</value>
+ </data>
+ <data name="Argument_MethodDeclaringTypeGenericLcg" xml:space="preserve">
+ <value>Method '{0}' has a generic declaring type '{1}'. Explicitly provide the declaring type to GetTokenFor.</value>
+ </data>
+ <data name="Argument_MethodNeedGenericDeclaringType" xml:space="preserve">
+ <value>The specified method cannot be dynamic or global and must be declared on a generic type definition.</value>
+ </data>
+ <data name="Argument_MethodRedefined" xml:space="preserve">
+ <value>Method has been already defined.</value>
+ </data>
+ <data name="Argument_MinMaxValue" xml:space="preserve">
+ <value>'{0}' cannot be greater than {1}.</value>
+ </data>
+ <data name="Argument_MismatchedArrays" xml:space="preserve">
+ <value>Two arrays, {0} and {1}, must be of the same size.</value>
+ </data>
+ <data name="Argument_MissingDefaultConstructor" xml:space="preserve">
+ <value>was missing default constructor.</value>
+ </data>
+ <data name="Argument_ModuleAlreadyLoaded" xml:space="preserve">
+ <value>The specified module has already been loaded.</value>
+ </data>
+ <data name="Argument_MustBeFalse" xml:space="preserve">
+ <value>Argument must be initialized to false</value>
+ </data>
+ <data name="Argument_MustBeInterfaceMethod" xml:space="preserve">
+ <value>The MemberInfo must be an interface method.</value>
+ </data>
+ <data name="Argument_MustBeRuntimeAssembly" xml:space="preserve">
+ <value>Assembly must be a runtime Assembly object.</value>
+ </data>
+ <data name="Argument_MustBeRuntimeFieldInfo" xml:space="preserve">
+ <value>FieldInfo must be a runtime FieldInfo object.</value>
+ </data>
+ <data name="Argument_MustBeRuntimeMethodInfo" xml:space="preserve">
+ <value>MethodInfo must be a runtime MethodInfo object.</value>
+ </data>
+ <data name="Argument_MustBeRuntimeModule" xml:space="preserve">
+ <value>Module must be a runtime Module object.</value>
+ </data>
+ <data name="Argument_MustBeRuntimeParameterInfo" xml:space="preserve">
+ <value>ParameterInfo must be a runtime ParameterInfo object.</value>
+ </data>
+ <data name="Argument_MustBeRuntimeReflectionObject" xml:space="preserve">
+ <value>The object must be a runtime Reflection object.</value>
+ </data>
+ <data name="Argument_MustBeRuntimeType" xml:space="preserve">
+ <value>Type must be a runtime Type object.</value>
+ </data>
+ <data name="Argument_MustBeString" xml:space="preserve">
+ <value>String is too long or has invalid contents.</value>
+ </data>
+ <data name="Argument_MustBeTypeBuilder" xml:space="preserve">
+ <value>'type' must contain a TypeBuilder as a generic argument.</value>
+ </data>
+ <data name="Argument_MustHaveAttributeBaseClass" xml:space="preserve">
+ <value>Type passed in must be derived from System.Attribute or System.Attribute itself.</value>
+ </data>
+ <data name="Argument_MustHaveLayoutOrBeBlittable" xml:space="preserve">
+ <value>The specified structure must be blittable or have layout information.</value>
+ </data>
+ <data name="Argument_MustSupplyContainer" xml:space="preserve">
+ <value>When supplying a FieldInfo for fixing up a nested type, a valid ID for that containing object must also be supplied.</value>
+ </data>
+ <data name="Argument_MustSupplyParent" xml:space="preserve">
+ <value>When supplying the ID of a containing object, the FieldInfo that identifies the current field within that object must also be supplied.</value>
+ </data>
+ <data name="Argument_NameContainsInvalidCharacters" xml:space="preserve">
+ <value>The name '{0}' contains characters that are not valid for a Culture or Region.</value>
+ </data>
+ <data name="Argument_NameTooLong" xml:space="preserve">
+ <value>The name '{0}' is too long to be a Culture or Region name, which is limited to {1} characters.</value>
+ </data>
+ <data name="Argument_NativeOverlappedAlreadyFree" xml:space="preserve">
+ <value>'overlapped' has already been freed.</value>
+ </data>
+ <data name="Argument_NativeOverlappedWrongBoundHandle" xml:space="preserve">
+ <value>'overlapped' was not allocated by this ThreadPoolBoundHandle instance.</value>
+ </data>
+ <data name="Argument_NativeResourceAlreadyDefined" xml:space="preserve">
+ <value>Native resource has already been defined.</value>
+ </data>
+ <data name="Argument_NeedGenericMethodDefinition" xml:space="preserve">
+ <value>Method must represent a generic method definition on a generic type definition.</value>
+ </data>
+ <data name="Argument_NeedNonGenericObject" xml:space="preserve">
+ <value>The specified object must not be an instance of a generic type.</value>
+ </data>
+ <data name="Argument_NeedNonGenericType" xml:space="preserve">
+ <value>The specified Type must not be a generic type definition.</value>
+ </data>
+ <data name="Argument_NeedStructWithNoRefs" xml:space="preserve">
+ <value>The specified Type must be a struct containing no references.</value>
+ </data>
+ <data name="Argument_NeverValidGenericArgument" xml:space="preserve">
+ <value>The type '{0}' may not be used as a type argument.</value>
+ </data>
+ <data name="Argument_NoClass" xml:space="preserve">
+ <value>Element does not specify a class.</value>
+ </data>
+ <data name="Argument_NoDomainManager" xml:space="preserve">
+ <value>The domain manager specified by the host could not be instantiated.</value>
+ </data>
+ <data name="Argument_NoEra" xml:space="preserve">
+ <value>No Era was supplied.</value>
+ </data>
+ <data name="Argument_NoMain" xml:space="preserve">
+ <value>Main entry point not defined.</value>
+ </data>
+ <data name="Argument_NoModuleFileExtension" xml:space="preserve">
+ <value>Module file name '{0}' must have file extension.</value>
+ </data>
+ <data name="Argument_NoNestedMarshal" xml:space="preserve">
+ <value>Only LPArray or SafeArray has nested unmanaged marshal.</value>
+ </data>
+ <data name="Argument_NonNullObjAndCtx" xml:space="preserve">
+ <value>Either obj or ctx must be null.</value>
+ </data>
+ <data name="Argument_NoRegionInvariantCulture" xml:space="preserve">
+ <value>There is no region associated with the Invariant Culture (Culture ID: 0x7F).</value>
+ </data>
+ <data name="Argument_NoSpecificCulture" xml:space="preserve">
+ <value>Please select a specific culture, such as zh-CN, zh-HK, zh-TW, zh-MO, zh-SG.</value>
+ </data>
+ <data name="Argument_NotACodeGroupType" xml:space="preserve">
+ <value>The type does not inherit from CodeGroup</value>
+ </data>
+ <data name="Argument_NotACustomMarshaler" xml:space="preserve">
+ <value>Not a custom marshal.</value>
+ </data>
+ <data name="Argument_NotAMembershipCondition" xml:space="preserve">
+ <value>The type does not implement IMembershipCondition</value>
+ </data>
+ <data name="Argument_NotAPermissionElement" xml:space="preserve">
+ <value>'elem' was not a permission element.</value>
+ </data>
+ <data name="Argument_NotAPermissionType" xml:space="preserve">
+ <value>The type does not implement IPermission</value>
+ </data>
+ <data name="Argument_NotASimpleNativeType" xml:space="preserve">
+ <value>The UnmanagedType passed to DefineUnmanagedMarshal is not a simple type. None of the following values may be used: UnmanagedType.ByValTStr, UnmanagedType.SafeArray, UnmanagedType.ByValArray, UnmanagedType.LPArray, UnmanagedType.CustomMarshaler.</value>
+ </data>
+ <data name="Argument_NotATP" xml:space="preserve">
+ <value>Type must be a TransparentProxy</value>
+ </data>
+ <data name="Argument_NotAWritableProperty" xml:space="preserve">
+ <value>Not a writable property.</value>
+ </data>
+ <data name="Argument_NotEnoughBytesToRead" xml:space="preserve">
+ <value>There are not enough bytes remaining in the accessor to read at this position.</value>
+ </data>
+ <data name="Argument_NotEnoughBytesToWrite" xml:space="preserve">
+ <value>There are not enough bytes remaining in the accessor to write at this position.</value>
+ </data>
+ <data name="Argument_NotEnoughGenArguments" xml:space="preserve">
+ <value>The type or method has {1} generic parameter(s), but {0} generic argument(s) were provided. A generic argument must be provided for each generic parameter.</value>
+ </data>
+ <data name="Argument_NotExceptionType" xml:space="preserve">
+ <value>Does not extend Exception.</value>
+ </data>
+ <data name="Argument_NotInExceptionBlock" xml:space="preserve">
+ <value>Not currently in an exception block.</value>
+ </data>
+ <data name="Argument_NotInTheSameModuleBuilder" xml:space="preserve">
+ <value>The argument passed in was not from the same ModuleBuilder.</value>
+ </data>
+ <data name="Argument_NotMethodCallOpcode" xml:space="preserve">
+ <value>The specified opcode cannot be passed to EmitCall.</value>
+ </data>
+ <data name="Argument_NotSerializable" xml:space="preserve">
+ <value>Argument passed in is not serializable.</value>
+ </data>
+ <data name="Argument_NotSimpleFileName" xml:space="preserve">
+ <value>The filename must not include a path specification.</value>
+ </data>
+ <data name="Argument_NoUnderlyingCCW" xml:space="preserve">
+ <value>The object has no underlying COM data associated with it.</value>
+ </data>
+ <data name="Argument_NoUninitializedStrings" xml:space="preserve">
+ <value>Uninitialized Strings cannot be created.</value>
+ </data>
+ <data name="Argument_NoUnmanagedElementCount" xml:space="preserve">
+ <value>Unmanaged marshal does not have ElementCount.</value>
+ </data>
+ <data name="Argument_NPMSInvalidName" xml:space="preserve">
+ <value>Name can be neither null nor empty.</value>
+ </data>
+ <data name="Argument_NullFullTrustAssembly" xml:space="preserve">
+ <value>A null StrongName was found in the full trust assembly list.</value>
+ </data>
+ <data name="Argument_ObjIsWinRTObject" xml:space="preserve">
+ <value>The object's type must not be a Windows Runtime type.</value>
+ </data>
+ <data name="Argument_ObjNotComObject" xml:space="preserve">
+ <value>The object's type must be __ComObject or derived from __ComObject.</value>
+ </data>
+ <data name="Argument_OffsetAndCapacityOutOfBounds" xml:space="preserve">
+ <value>Offset and capacity were greater than the size of the view.</value>
+ </data>
+ <data name="Argument_OffsetAndLengthOutOfBounds" xml:space="preserve">
+ <value>Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.</value>
+ </data>
+ <data name="Argument_OffsetLocalMismatch" xml:space="preserve">
+ <value>The UTC Offset of the local dateTime parameter does not match the offset argument.</value>
+ </data>
+ <data name="Argument_OffsetOfFieldNotFound" xml:space="preserve">
+ <value>Field passed in is not a marshaled member of the type '{0}'.</value>
+ </data>
+ <data name="Argument_OffsetOutOfRange" xml:space="preserve">
+ <value>Offset must be within plus or minus 14 hours.</value>
+ </data>
+ <data name="Argument_OffsetPrecision" xml:space="preserve">
+ <value>Offset must be specified in whole minutes.</value>
+ </data>
+ <data name="Argument_OffsetUtcMismatch" xml:space="preserve">
+ <value>The UTC Offset for Utc DateTime instances must be 0.</value>
+ </data>
+ <data name="Argument_OneOfCulturesNotSupported" xml:space="preserve">
+ <value>Culture name {0} or {1} is not supported.</value>
+ </data>
+ <data name="Argument_OnlyMscorlib" xml:space="preserve">
+ <value>Only mscorlib's assembly is valid.</value>
+ </data>
+ <data name="Argument_OutOfOrderDateTimes" xml:space="preserve">
+ <value>The DateStart property must come before the DateEnd property.</value>
+ </data>
+ <data name="Argument_PathEmpty" xml:space="preserve">
+ <value>Path cannot be the empty string or all whitespace.</value>
+ </data>
+ <data name="Argument_PathFormatNotSupported" xml:space="preserve">
+ <value>The given path's format is not supported.</value>
+ </data>
+ <data name="Argument_PathUriFormatNotSupported" xml:space="preserve">
+ <value>URI formats are not supported.</value>
+ </data>
+ <data name="Argument_PolicyFileDoesNotExist" xml:space="preserve">
+ <value>The requested policy file does not exist.</value>
+ </data>
+ <data name="Argument_PreAllocatedAlreadyAllocated" xml:space="preserve">
+ <value>'preAllocated' is already in use.</value>
+ </data>
+ <data name="Argument_RecursiveFallback" xml:space="preserve">
+ <value>Recursive fallback not allowed for character \\u{0:X4}.</value>
+ </data>
+ <data name="Argument_RecursiveFallbackBytes" xml:space="preserve">
+ <value>Recursive fallback not allowed for bytes {0}.</value>
+ </data>
+ <data name="Argument_RedefinedLabel" xml:space="preserve">
+ <value>Label multiply defined.</value>
+ </data>
+ <data name="Argument_RelativeUrlMembershipCondition" xml:space="preserve">
+ <value>UrlMembershipCondition requires an absolute URL.</value>
+ </data>
+ <data name="Argument_ResolveField" xml:space="preserve">
+ <value>Token {0:x} is not a valid FieldInfo token in the scope of module {1}.</value>
+ </data>
+ <data name="Argument_ResolveFieldHandle" xml:space="preserve">
+ <value>Type handle '{0}' and field handle with declaring type '{1}' are incompatible. Get RuntimeFieldHandle and declaring RuntimeTypeHandle off the same FieldInfo.</value>
+ </data>
+ <data name="Argument_ResolveMember" xml:space="preserve">
+ <value>Token {0:x} is not a valid MemberInfo token in the scope of module {1}.</value>
+ </data>
+ <data name="Argument_ResolveMethod" xml:space="preserve">
+ <value>Token {0:x} is not a valid MethodBase token in the scope of module {1}.</value>
+ </data>
+ <data name="Argument_ResolveMethodHandle" xml:space="preserve">
+ <value>Type handle '{0}' and method handle with declaring type '{1}' are incompatible. Get RuntimeMethodHandle and declaring RuntimeTypeHandle off the same MethodBase.</value>
+ </data>
+ <data name="Argument_ResolveModuleType" xml:space="preserve">
+ <value>Token {0} resolves to the special module type representing this module.</value>
+ </data>
+ <data name="Argument_ResolveString" xml:space="preserve">
+ <value>Token {0:x} is not a valid string token in the scope of module {1}.</value>
+ </data>
+ <data name="Argument_ResolveType" xml:space="preserve">
+ <value>Token {0:x} is not a valid Type token in the scope of module {1}.</value>
+ </data>
+ <data name="Argument_ResourceScopeWrongDirection" xml:space="preserve">
+ <value>Resource type in the ResourceScope enum is going from a more restrictive resource type to a more general one. From: "{0}" To: "{1}"</value>
+ </data>
+ <data name="Argument_ResultCalendarRange" xml:space="preserve">
+ <value>The result is out of the supported range for this calendar. The result should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive.</value>
+ </data>
+ <data name="Argument_ResultIslamicCalendarRange" xml:space="preserve">
+ <value>The date is out of the supported range for the Islamic calendar. The date should be greater than July 18th, 622 AD (Gregorian date).</value>
+ </data>
+ <data name="Argument_SeekOverflow" xml:space="preserve">
+ <value>The specified seek offset '{0}' would result in a negative Stream position.</value>
+ </data>
+ <data name="Argument_SemaphoreInitialMaximum" xml:space="preserve">
+ <value>The initial count for the semaphore must be greater than or equal to zero and less than the maximum count.</value>
+ </data>
+ <data name="Argument_ShouldNotSpecifyExceptionType" xml:space="preserve">
+ <value>Should not specify exception type for catch clause for filter block.</value>
+ </data>
+ <data name="Argument_ShouldOnlySetVisibilityFlags" xml:space="preserve">
+ <value>Should only set visibility flags when creating EnumBuilder.</value>
+ </data>
+ <data name="Argument_SigIsFinalized" xml:space="preserve">
+ <value>Completed signature cannot be modified.</value>
+ </data>
+ <data name="Argument_StreamNotReadable" xml:space="preserve">
+ <value>Stream was not readable.</value>
+ </data>
+ <data name="Argument_StreamNotWritable" xml:space="preserve">
+ <value>Stream was not writable.</value>
+ </data>
+ <data name="Argument_StringFirstCharIsZero" xml:space="preserve">
+ <value>The first char in the string is the null character.</value>
+ </data>
+ <data name="Argument_StringZeroLength" xml:space="preserve">
+ <value>String cannot be of zero length.</value>
+ </data>
+ <data name="Argument_StructMustNotBeValueClass" xml:space="preserve">
+ <value>The structure must not be a value class.</value>
+ </data>
+ <data name="Argument_TimeSpanHasSeconds" xml:space="preserve">
+ <value>The TimeSpan parameter cannot be specified more precisely than whole minutes.</value>
+ </data>
+ <data name="Argument_TimeZoneInfoBadTZif" xml:space="preserve">
+ <value>The tzfile does not begin with the magic characters 'TZif'. Please verify that the file is not corrupt.</value>
+ </data>
+ <data name="Argument_TimeZoneInfoInvalidTZif" xml:space="preserve">
+ <value>The TZif data structure is corrupt.</value>
+ </data>
+ <data name="Argument_ToExclusiveLessThanFromExclusive" xml:space="preserve">
+ <value>fromInclusive must be less than or equal to toExclusive.</value>
+ </data>
+ <data name="Argument_TooManyFinallyClause" xml:space="preserve">
+ <value>Exception blocks may have at most one finally clause.</value>
+ </data>
+ <data name="Argument_TransitionTimesAreIdentical" xml:space="preserve">
+ <value>The DaylightTransitionStart property must not equal the DaylightTransitionEnd property.</value>
+ </data>
+ <data name="Argument_TypeDoesNotContainMethod" xml:space="preserve">
+ <value>Type does not contain the given method.</value>
+ </data>
+ <data name="Argument_TypedReferenceInvalidField" xml:space="preserve">
+ <value>Field in TypedReferences cannot be static or init only.</value>
+ </data>
+ <data name="Argument_TypeIsWinRTType" xml:space="preserve">
+ <value>The type must not be a Windows Runtime type.</value>
+ </data>
+ <data name="Argument_TypeMustBeComCreatable" xml:space="preserve">
+ <value>The type must be creatable from COM.</value>
+ </data>
+ <data name="Argument_TypeMustBeVisibleFromCom" xml:space="preserve">
+ <value>The specified type must be visible from COM.</value>
+ </data>
+ <data name="Argument_TypeMustNotBeComImport" xml:space="preserve">
+ <value>The type must not be imported from COM.</value>
+ </data>
+ <data name="Argument_TypeNameTooLong" xml:space="preserve">
+ <value>Type name was too long. The fully qualified type name must be less than 1,024 characters.</value>
+ </data>
+ <data name="Argument_TypeNotActivatableViaWindowsRuntime" xml:space="preserve">
+ <value>Type '{0}' does not have an activation factory because it is not activatable by Windows Runtime.</value>
+ </data>
+ <data name="Argument_TypeNotComObject" xml:space="preserve">
+ <value>The type must be __ComObject or be derived from __ComObject.</value>
+ </data>
+ <data name="Argument_TypeNotValid" xml:space="preserve">
+ <value>The Type object is not valid.</value>
+ </data>
+ <data name="Argument_UnableToGeneratePermissionSet" xml:space="preserve">
+ <value>Unable to generate permission set; input XML may be malformed.</value>
+ </data>
+ <data name="Argument_UnableToParseManifest" xml:space="preserve">
+ <value>Unexpected error while parsing the specified manifest.</value>
+ </data>
+ <data name="Argument_UnclosedExceptionBlock" xml:space="preserve">
+ <value>The IL Generator cannot be used while there are unclosed exceptions.</value>
+
+ </data>
+ <data name="Argument_UnequalMembers" xml:space="preserve">
+ <value>Supplied MemberInfo does not match the expected type.</value>
+ </data>
+ <data name="Argument_Unexpected_TypeSource" xml:space="preserve">
+ <value>Unexpected TypeKind when marshaling Windows.Foundation.TypeName.</value>
+ </data>
+ <data name="Argument_UnknownUnmanagedCallConv" xml:space="preserve">
+ <value>Unknown unmanaged calling convention for function signature.</value>
+ </data>
+ <data name="Argument_UnmanagedMemAccessorWrapAround" xml:space="preserve">
+ <value>The UnmanagedMemoryAccessor capacity and offset would wrap around the high end of the address space.</value>
+ </data>
+ <data name="Argument_UnmatchedMethodForLocal" xml:space="preserve">
+ <value>Local passed in does not belong to this ILGenerator.</value>
+ </data>
+ <data name="Argument_UnmatchingSymScope" xml:space="preserve">
+ <value>Non-matching symbol scope.</value>
+ </data>
+ <data name="Argument_UnrecognizedLoaderOptimization" xml:space="preserve">
+ <value>Unrecognized LOADER_OPTIMIZATION property value. Supported values may include "SingleDomain", "MultiDomain", "MultiDomainHost", and "NotSpecified".</value>
+ </data>
+ <data name="Argument_UnrestrictedIdentityPermission" xml:space="preserve">
+ <value>Identity permissions cannot be unrestricted.</value>
+ </data>
+ <data name="Argument_UTCOutOfRange" xml:space="preserve">
+ <value>The UTC time represented when the offset is applied must be between year 0 and 10,000.</value>
+ </data>
+ <data name="Argument_VerStringTooLong" xml:space="preserve">
+ <value>The unmanaged Version information is too large to persist.</value>
+ </data>
+ <data name="Argument_WaitHandleNameTooLong" xml:space="preserve">
+ <value>The name can be no more than {0} characters in length.</value>
+ </data>
+ <data name="Argument_WinRTSystemRuntimeType" xml:space="preserve">
+ <value>Cannot marshal type '{0}' to Windows Runtime. Only 'System.RuntimeType' is supported.</value>
+ </data>
+ <data name="Argument_WrongElementType" xml:space="preserve">
+ <value>'{0}' element required.</value>
+ </data>
+ <data name="Argument_WrongType" xml:space="preserve">
+ <value>Operation on type '{0}' attempted with target of incorrect type.</value>
+ </data>
+ <data name="ArgumentException_BadMethodImplBody" xml:space="preserve">
+ <value>MethodOverride's body must be from this type.</value>
+ </data>
+ <data name="ArgumentException_BufferNotFromPool" xml:space="preserve">
+ <value>The buffer is not associated with this pool and may not be returned to it.</value>
+ </data>
+ <data name="ArgumentException_InvalidAceBinaryForm" xml:space="preserve">
+ <value>The binary form of an ACE object is invalid.</value>
+ </data>
+ <data name="ArgumentException_InvalidAclBinaryForm" xml:space="preserve">
+ <value>The binary form of an ACL object is invalid.</value>
+ </data>
+ <data name="ArgumentException_InvalidSDSddlForm" xml:space="preserve">
+ <value>The SDDL form of a security descriptor object is invalid.</value>
+ </data>
+ <data name="ArgumentException_MinSortingVersion" xml:space="preserve">
+ <value>The runtime does not support a version of "{0}" less than {1}.</value>
+ </data>
+ <data name="ArgumentException_NotAllCustomSortingFuncsDefined" xml:space="preserve">
+ <value>Implementations of all the NLS functions must be provided.</value>
+ </data>
+ <data name="ArgumentException_OtherNotArrayOfCorrectLength" xml:space="preserve">
+ <value>Object is not a array with the same number of elements as the array to compare it to.</value>
+ </data>
+ <data name="ArgumentException_TupleIncorrectType" xml:space="preserve">
+ <value>Argument must be of type {0}.</value>
+ </data>
+ <data name="ArgumentException_TupleLastArgumentNotATuple" xml:space="preserve">
+ <value>The last element of an eight element tuple must be a Tuple.</value>
+ </data>
+ <data name="ArgumentException_TupleNonIComparableElement" xml:space="preserve">
+ <value>The tuple contains an element of type {0} which does not implement the IComparable interface.</value>
+ </data>
+ <data name="ArgumentException_ValueTupleIncorrectType" xml:space="preserve">
+ <value>Argument must be of type {0}.</value>
+ </data>
+ <data name="ArgumentException_ValueTupleLastArgumentNotAValueTuple" xml:space="preserve">
+ <value>The last element of an eight element ValueTuple must be a ValueTuple.</value>
+ </data>
+ <data name="ArgumentNull_ApplicationTrust" xml:space="preserve">
+ <value>The application trust cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Array" xml:space="preserve">
+ <value>Array cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_ArrayElement" xml:space="preserve">
+ <value>At least one element in the specified array was null.</value>
+ </data>
+ <data name="ArgumentNull_ArrayValue" xml:space="preserve">
+ <value>Found a null value within an array.</value>
+ </data>
+ <data name="ArgumentNull_Assembly" xml:space="preserve">
+ <value>Assembly cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_AssemblyName" xml:space="preserve">
+ <value>AssemblyName cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_AssemblyNameName" xml:space="preserve">
+ <value>AssemblyName.Name cannot be null or an empty string.</value>
+ </data>
+ <data name="ArgumentNull_Buffer" xml:space="preserve">
+ <value>Buffer cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Child" xml:space="preserve">
+ <value>Cannot have a null child.</value>
+ </data>
+ <data name="ArgumentNull_Collection" xml:space="preserve">
+ <value>Collection cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_CriticalHandle" xml:space="preserve">
+ <value>CriticalHandle cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_CultureInfo" xml:space="preserve">
+ <value>CultureInfo cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Dictionary" xml:space="preserve">
+ <value>Dictionary cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_FileName" xml:space="preserve">
+ <value>File name cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Generic" xml:space="preserve">
+ <value>Value cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Graph" xml:space="preserve">
+ <value>Object Graph cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_GUID" xml:space="preserve">
+ <value>GUID cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Key" xml:space="preserve">
+ <value>Key cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_NullMember" xml:space="preserve">
+ <value>Member at position {0} was null.</value>
+ </data>
+ <data name="ArgumentNull_Obj" xml:space="preserve">
+ <value>Object cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Path" xml:space="preserve">
+ <value>Path cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_SafeHandle" xml:space="preserve">
+ <value>SafeHandle cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Stream" xml:space="preserve">
+ <value>Stream cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_String" xml:space="preserve">
+ <value>String reference not set to an instance of a String.</value>
+ </data>
+ <data name="ArgumentNull_Type" xml:space="preserve">
+ <value>Type cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_TypedRefType" xml:space="preserve">
+ <value>Type in TypedReference cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_TypeRequiredByResourceScope" xml:space="preserve">
+ <value>The type parameter cannot be null when scoping the resource's visibility to Private or Assembly.</value>
+ </data>
+ <data name="ArgumentNull_Waithandles" xml:space="preserve">
+ <value>The waitHandles parameter cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_WithParamName" xml:space="preserve">
+ <value>Parameter '{0}' cannot be null.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ActualValue" xml:space="preserve">
+ <value>Actual value was {0}.</value>
+ </data>
+ <data name="ArgumentOutOfRange_AddressSpace" xml:space="preserve">
+ <value>The number of bytes cannot exceed the virtual address space on a 32 bit machine.</value>
+ </data>
+ <data name="ArgumentOutOfRange_AddValue" xml:space="preserve">
+ <value>Value to add was out of range.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ArrayLB" xml:space="preserve">
+ <value>Number was less than the array's lower bound in the first dimension.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ArrayLBAndLength" xml:space="preserve">
+ <value>Higher indices will exceed Int32.MaxValue because of large lower bound and/or length.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ArrayLength" xml:space="preserve">
+ <value>The length of the array must be between {0} and {1}, inclusive.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ArrayLengthMultiple" xml:space="preserve">
+ <value>The length of the array must be a multiple of {0}.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ArrayListInsert" xml:space="preserve">
+ <value>Insertion index was out of range. Must be non-negative and less than or equal to size.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ArrayTooSmall" xml:space="preserve">
+ <value>Destination array is not long enough to copy all the required data. Check array length and offset.</value>
+ </data>
+ <data name="ArgumentOutOfRange_BadHourMinuteSecond" xml:space="preserve">
+ <value>Hour, Minute, and Second parameters describe an un-representable DateTime.</value>
+ </data>
+ <data name="ArgumentOutOfRange_BadYearMonthDay" xml:space="preserve">
+ <value>Year, Month, and Day parameters describe an un-representable DateTime.</value>
+ </data>
+ <data name="ArgumentOutOfRange_BeepFrequency" xml:space="preserve">
+ <value>Console.Beep's frequency must be between {0} and {1}.</value>
+ </data>
+ <data name="ArgumentOutOfRange_BiggerThanCollection" xml:space="preserve">
+ <value>Larger than collection size.</value>
+ </data>
+ <data name="ArgumentOutOfRange_BinaryReaderFillBuffer" xml:space="preserve">
+ <value>The number of bytes requested does not fit into BinaryReader's internal buffer.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Bounds_Lower_Upper" xml:space="preserve">
+ <value>Argument must be between {0} and {1}.</value>
+ </data>
+ <data name="ArgumentOutOfRange_CalendarRange" xml:space="preserve">
+ <value>Specified time is not supported in this calendar. It should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Capacity" xml:space="preserve">
+ <value>Capacity exceeds maximum capacity.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ConsoleBufferBoundaries" xml:space="preserve">
+ <value>The value must be greater than or equal to zero and less than the console's buffer size in that dimension.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ConsoleBufferLessThanWindowSize" xml:space="preserve">
+ <value>The console buffer size must not be less than the current size and position of the console window, nor greater than or equal to Int16.MaxValue.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ConsoleKey" xml:space="preserve">
+ <value>Console key values must be between 0 and 255.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ConsoleTitleTooLong" xml:space="preserve">
+ <value>The console title is too long.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ConsoleWindowBufferSize" xml:space="preserve">
+ <value>The new console window size would force the console buffer size to be too large.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ConsoleWindowPos" xml:space="preserve">
+ <value>The window position must be set such that the current window size fits within the console's buffer, and the numbers must not be negative.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ConsoleWindowSize_Size" xml:space="preserve">
+ <value>The value must be less than the console's current maximum window size of {0} in that dimension. Note that this value depends on screen resolution and the console font.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Count" xml:space="preserve">
+ <value>Count must be positive and count must refer to a location within the string/array/collection.</value>
+ </data>
+ <data name="ArgumentOutOfRange_CursorSize" xml:space="preserve">
+ <value>The cursor size is invalid. It must be a percentage between 1 and 100.</value>
+ </data>
+ <data name="ArgumentOutOfRange_DateArithmetic" xml:space="preserve">
+ <value>The added or subtracted value results in an un-representable DateTime.</value>
+ </data>
+ <data name="ArgumentOutOfRange_DateTimeBadMonths" xml:space="preserve">
+ <value>Months value must be between +/-120000.</value>
+ </data>
+ <data name="ArgumentOutOfRange_DateTimeBadTicks" xml:space="preserve">
+ <value>Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.</value>
+ </data>
+ <data name="ArgumentOutOfRange_DateTimeBadYears" xml:space="preserve">
+ <value>Years value must be between +/-10000.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Day" xml:space="preserve">
+ <value>Day must be between 1 and {0} for month {1}.</value>
+ </data>
+ <data name="ArgumentOutOfRange_DayOfWeek" xml:space="preserve">
+ <value>The DayOfWeek enumeration must be in the range 0 through 6.</value>
+ </data>
+ <data name="ArgumentOutOfRange_DayParam" xml:space="preserve">
+ <value>The Day parameter must be in the range 1 through 31.</value>
+ </data>
+ <data name="ArgumentOutOfRange_DecimalRound" xml:space="preserve">
+ <value>Decimal can only round to between 0 and 28 digits of precision.</value>
+ </data>
+ <data name="ArgumentOutOfRange_DecimalScale" xml:space="preserve">
+ <value>Decimal's scale value must be between 0 and 28, inclusive.</value>
+ </data>
+ <data name="ArgumentOutOfRange_EndIndexStartIndex" xml:space="preserve">
+ <value>endIndex cannot be greater than startIndex.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Enum" xml:space="preserve">
+ <value>Enum value was out of legal range.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Era" xml:space="preserve">
+ <value>Time value was out of era range.</value>
+ </data>
+ <data name="ArgumentOutOfRange_FileLengthTooBig" xml:space="preserve">
+ <value>Specified file length was too large for the file system.</value>
+ </data>
+ <data name="ArgumentOutOfRange_FileTimeInvalid" xml:space="preserve">
+ <value>Not a valid Win32 FileTime.</value>
+ </data>
+ <data name="ArgumentOutOfRange_GenericPositive" xml:space="preserve">
+ <value>Value must be positive.</value>
+ </data>
+ <data name="ArgumentOutOfRange_GetByteCountOverflow" xml:space="preserve">
+ <value>Too many characters. The resulting number of bytes is larger than what can be returned as an int.</value>
+ </data>
+ <data name="ArgumentOutOfRange_GetCharCountOverflow" xml:space="preserve">
+ <value>Too many bytes. The resulting number of chars is larger than what can be returned as an int.</value>
+ </data>
+ <data name="ArgumentOutOfRange_HashtableLoadFactor" xml:space="preserve">
+ <value>Load factor needs to be between 0.1 and 1.0.</value>
+ </data>
+ <data name="ArgumentOutOfRange_HugeArrayNotSupported" xml:space="preserve">
+ <value>Arrays larger than 2GB are not supported.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Index" xml:space="preserve">
+ <value>Index was out of range. Must be non-negative and less than the size of the collection.</value>
+ </data>
+ <data name="ArgumentOutOfRange_IndexCount" xml:space="preserve">
+ <value>Index and count must refer to a location within the string.</value>
+ </data>
+ <data name="ArgumentOutOfRange_IndexCountBuffer" xml:space="preserve">
+ <value>Index and count must refer to a location within the buffer.</value>
+ </data>
+ <data name="ArgumentOutOfRange_IndexLargerThanMaxValue" xml:space="preserve">
+ <value>This collection cannot work with indices larger than Int32.MaxValue - 1 (0x7FFFFFFF - 1).</value>
+ </data>
+ <data name="ArgumentOutOfRange_IndexLength" xml:space="preserve">
+ <value>Index and length must refer to a location within the string.</value>
+ </data>
+ <data name="ArgumentOutOfRange_IndexOutOfRange" xml:space="preserve">
+ <value>The specified index is outside the current index range of this collection.</value>
+ </data>
+ <data name="ArgumentOutOfRange_IndexString" xml:space="preserve">
+ <value>Index was out of range. Must be non-negative and less than the length of the string.</value>
+ </data>
+ <data name="ArgumentOutOfRange_InvalidEraValue" xml:space="preserve">
+ <value>Era value was not valid.</value>
+ </data>
+ <data name="ArgumentOutOfRange_InvalidHighSurrogate" xml:space="preserve">
+ <value>A valid high surrogate character is between 0xd800 and 0xdbff, inclusive.</value>
+ </data>
+ <data name="ArgumentOutOfRange_InvalidLowSurrogate" xml:space="preserve">
+ <value>A valid low surrogate character is between 0xdc00 and 0xdfff, inclusive.</value>
+ </data>
+ <data name="ArgumentOutOfRange_InvalidThreshold" xml:space="preserve">
+ <value>The specified threshold for creating dictionary is out of range.</value>
+ </data>
+ <data name="ArgumentOutOfRange_InvalidUserDefinedAceType" xml:space="preserve">
+ <value>User-defined ACEs must not have a well-known ACE type.</value>
+ </data>
+ <data name="ArgumentOutOfRange_InvalidUTF32" xml:space="preserve">
+ <value>A valid UTF32 value is between 0x000000 and 0x10ffff, inclusive, and should not include surrogate codepoint values (0x00d800 ~ 0x00dfff).</value>
+ </data>
+ <data name="ArgumentOutOfRange_Length" xml:space="preserve">
+ <value>The specified length exceeds maximum capacity of SecureString.</value>
+ </data>
+ <data name="ArgumentOutOfRange_LengthGreaterThanCapacity" xml:space="preserve">
+ <value>The length cannot be greater than the capacity.</value>
+ </data>
+ <data name="ArgumentOutOfRange_LengthTooLarge" xml:space="preserve">
+ <value>The specified length exceeds the maximum value of {0}.</value>
+ </data>
+ <data name="ArgumentOutOfRange_LessEqualToIntegerMaxVal" xml:space="preserve">
+ <value>Argument must be less than or equal to 2^31 - 1 milliseconds.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ListInsert" xml:space="preserve">
+ <value>Index must be within the bounds of the List.</value>
+ </data>
+ <data name="ArgumentOutOfRange_MaxArgExceeded" xml:space="preserve">
+ <value>The total number of parameters must not exceed {0}.</value>
+ </data>
+ <data name="ArgumentOutOfRange_MaxStringsExceeded" xml:space="preserve">
+ <value>The number of String parameters must not exceed {0}.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Month" xml:space="preserve">
+ <value>Month must be between one and twelve.</value>
+ </data>
+ <data name="ArgumentOutOfRange_MonthParam" xml:space="preserve">
+ <value>The Month parameter must be in the range 1 through 12.</value>
+ </data>
+ <data name="ArgumentOutOfRange_MustBeNonNegInt32" xml:space="preserve">
+ <value>Value must be non-negative and less than or equal to Int32.MaxValue.</value>
+ </data>
+ <data name="ArgumentOutOfRange_MustBeNonNegNum" xml:space="preserve">
+ <value>'{0}' must be non-negative.</value>
+ </data>
+ <data name="ArgumentOutOfRange_MustBePositive" xml:space="preserve">
+ <value>'{0}' must be greater than zero.</value>
+ </data>
+ <data name="ArgumentOutOfRange_NeedNonNegNum" xml:space="preserve">
+ <value>Non-negative number required.</value>
+ </data>
+ <data name="ArgumentOutOfRange_NeedNonNegOrNegative1" xml:space="preserve">
+ <value>Number must be either non-negative and less than or equal to Int32.MaxValue or -1.</value>
+ </data>
+ <data name="ArgumentOutOfRange_NeedPosNum" xml:space="preserve">
+ <value>Positive number required.</value>
+ </data>
+ <data name="ArgumentOutOfRange_NeedValidId" xml:space="preserve">
+ <value>The ID parameter must be in the range {0} through {1}.</value>
+ </data>
+ <data name="ArgumentOutOfRange_NegativeCapacity" xml:space="preserve">
+ <value>Capacity must be positive.</value>
+ </data>
+ <data name="ArgumentOutOfRange_NegativeCount" xml:space="preserve">
+ <value>Count cannot be less than zero.</value>
+ </data>
+ <data name="ArgumentOutOfRange_NegativeLength" xml:space="preserve">
+ <value>Length cannot be less than zero.</value>
+ </data>
+ <data name="ArgumentOutOfRange_NegFileSize" xml:space="preserve">
+ <value>Length must be non-negative.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ObjectID" xml:space="preserve">
+ <value>objectID cannot be less than or equal to zero.</value>
+ </data>
+ <data name="ArgumentOutOfRange_OffsetLength" xml:space="preserve">
+ <value>Offset and length must refer to a position in the string.</value>
+ </data>
+ <data name="ArgumentOutOfRange_OffsetOut" xml:space="preserve">
+ <value>Either offset did not refer to a position in the string, or there is an insufficient length of destination character array.</value>
+ </data>
+ <data name="ArgumentOutOfRange_ParamSequence" xml:space="preserve">
+ <value>The specified parameter index is not in range.</value>
+ </data>
+ <data name="ArgumentOutOfRange_PartialWCHAR" xml:space="preserve">
+ <value>Pointer startIndex and length do not refer to a valid string.</value>
+ </data>
+ <data name="ArgumentOutOfRange_PeriodTooLarge" xml:space="preserve">
+ <value>Period must be less than 2^32-2.</value>
+ </data>
+ <data name="ArgumentOutOfRange_PositionLessThanCapacityRequired" xml:space="preserve">
+ <value>The position may not be greater or equal to the capacity of the accessor.</value>
+ </data>
+ <data name="ArgumentOutOfRange_QueueGrowFactor" xml:space="preserve">
+ <value>Queue grow factor must be between {0} and {1}.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Range" xml:space="preserve">
+ <value>Valid values are between {0} and {1}, inclusive.</value>
+ </data>
+ <data name="ArgumentOutOfRange_RoundingDigits" xml:space="preserve">
+ <value>Rounding digits must be between 0 and 15, inclusive.</value>
+ </data>
+ <data name="ArgumentOutOfRange_SmallCapacity" xml:space="preserve">
+ <value>capacity was less than the current size.</value>
+ </data>
+ <data name="ArgumentOutOfRange_SmallMaxCapacity" xml:space="preserve">
+ <value>MaxCapacity must be one or greater.</value>
+ </data>
+ <data name="ArgumentOutOfRange_StartIndex" xml:space="preserve">
+ <value>StartIndex cannot be less than zero.</value>
+ </data>
+ <data name="ArgumentOutOfRange_StartIndexLargerThanLength" xml:space="preserve">
+ <value>startIndex cannot be larger than length of string.</value>
+ </data>
+ <data name="ArgumentOutOfRange_StartIndexLessThanLength" xml:space="preserve">
+ <value>startIndex must be less than length of string.</value>
+ </data>
+ <data name="ArgumentOutOfRange_StreamLength" xml:space="preserve">
+ <value>Stream length must be non-negative and less than 2^31 - 1 - origin.</value>
+ </data>
+ <data name="ArgumentOutOfRange_TimeoutTooLarge" xml:space="preserve">
+ <value>Time-out interval must be less than 2^32-2.</value>
+ </data>
+ <data name="ArgumentOutOfRange_UIntPtrMax" xml:space="preserve">
+ <value>The length of the buffer must be less than the maximum UIntPtr value for your platform.</value>
+ </data>
+ <data name="ArgumentOutOfRange_UnmanagedMemStreamLength" xml:space="preserve">
+ <value>UnmanagedMemoryStream length must be non-negative and less than 2^63 - 1 - baseAddress.</value>
+ </data>
+ <data name="ArgumentOutOfRange_UnmanagedMemStreamWrapAround" xml:space="preserve">
+ <value>The UnmanagedMemoryStream capacity would wrap around the high end of the address space.</value>
+ </data>
+ <data name="ArgumentOutOfRange_UtcOffset" xml:space="preserve">
+ <value>The TimeSpan parameter must be within plus or minus 14.0 hours.</value>
+ </data>
+ <data name="ArgumentOutOfRange_UtcOffsetAndDaylightDelta" xml:space="preserve">
+ <value>The sum of the BaseUtcOffset and DaylightDelta properties must within plus or minus 14.0 hours.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Version" xml:space="preserve">
+ <value>Version's parameters must be greater than or equal to zero.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Week" xml:space="preserve">
+ <value>The Week parameter must be in the range 1 through 5.</value>
+ </data>
+ <data name="ArgumentOutOfRange_Year" xml:space="preserve">
+ <value>Year must be between 1 and 9999.</value>
+ </data>
+ <data name="Arithmetic_NaN" xml:space="preserve">
+ <value>Function does not accept floating point Not-a-Number values.</value>
+ </data>
+ <data name="ArrayTypeMismatch_CantAssignType" xml:space="preserve">
+ <value>Source array type cannot be assigned to destination array type.</value>
+ </data>
+ <data name="ArrayTypeMismatch_ConstrainedCopy" xml:space="preserve">
+ <value>Array.ConstrainedCopy will only work on array types that are provably compatible, without any form of boxing, unboxing, widening, or casting of each array element. Change the array types (i.e., copy a Derived[] to a Base[]), or use a mitigation strategy in the CER for Array.Copy's less powerful reliability contract, such as cloning the array or throwing away the potentially corrupt destination array.</value>
+ </data>
+ <data name="Arugment_EmitMixedContext1" xml:space="preserve">
+ <value>Type '{0}' was loaded in the ReflectionOnly context but the AssemblyBuilder was not created as AssemblyBuilderAccess.ReflectionOnly.</value>
+ </data>
+ <data name="Arugment_EmitMixedContext2" xml:space="preserve">
+ <value>Type '{0}' was not loaded in the ReflectionOnly context but the AssemblyBuilder was created as AssemblyBuilderAccess.ReflectionOnly.</value>
+ </data>
+ <data name="AssertionFailed" xml:space="preserve">
+ <value>Assertion failed.</value>
+ </data>
+ <data name="AssertionFailed_Cnd" xml:space="preserve">
+ <value>Assertion failed: {0}</value>
+ </data>
+ <data name="AssumptionFailed" xml:space="preserve">
+ <value>Assumption failed.</value>
+ </data>
+ <data name="AssumptionFailed_Cnd" xml:space="preserve">
+ <value>Assumption failed: {0}</value>
+ </data>
+ <data name="AsyncMethodBuilder_InstanceNotInitialized" xml:space="preserve">
+ <value>The builder was not properly initialized.</value>
+ </data>
+ <data name="AwaitableAwaiter_InstanceNotInitialized" xml:space="preserve">
+ <value>The awaitable or awaiter was not properly initialized.</value>
+ </data>
+ <data name="BadImageFormat_BadILFormat" xml:space="preserve">
+ <value>Bad IL format.</value>
+ </data>
+ <data name="BadImageFormat_InvalidType" xml:space="preserve">
+ <value>Corrupt .resources file. The specified type doesn't exist.</value>
+ </data>
+ <data name="BadImageFormat_NegativeStringLength" xml:space="preserve">
+ <value>Corrupt .resources file. String length must be non-negative.</value>
+ </data>
+ <data name="BadImageFormat_ParameterSignatureMismatch" xml:space="preserve">
+ <value>The parameters and the signature of the method don't match.</value>
+ </data>
+ <data name="BadImageFormat_ResourceDataLengthInvalid" xml:space="preserve">
+ <value>Corrupt .resources file. The specified data length '{0}' is not a valid position in the stream.</value>
+ </data>
+ <data name="BadImageFormat_ResourceNameCorrupted" xml:space="preserve">
+ <value>Corrupt .resources file. A resource name extends past the end of the stream.</value>
+ </data>
+ <data name="BadImageFormat_ResourceNameCorrupted_NameIndex" xml:space="preserve">
+ <value>Corrupt .resources file. The resource name for name index {0} extends past the end of the stream.</value>
+ </data>
+ <data name="BadImageFormat_ResourcesDataInvalidOffset" xml:space="preserve">
+ <value>Corrupt .resources file. Invalid offset '{0}' into data section.</value>
+ </data>
+ <data name="BadImageFormat_ResourcesHeaderCorrupted" xml:space="preserve">
+ <value>Corrupt .resources file. Unable to read resources from this file because of invalid header information. Try regenerating the .resources file.</value>
+ </data>
+ <data name="BadImageFormat_ResourcesIndexInvalid" xml:space="preserve">
+ <value>Corrupt .resources file. The resource index '{0}' is outside the valid range.</value>
+ </data>
+ <data name="BadImageFormat_ResourcesIndexTooLong" xml:space="preserve">
+ <value>Corrupt .resources file. String for name index '{0}' extends past the end of the file.</value>
+ </data>
+ <data name="BadImageFormat_ResourcesNameInvalidOffset" xml:space="preserve">
+ <value>Corrupt .resources file. Invalid offset '{0}' into name section.</value>
+ </data>
+ <data name="BadImageFormat_ResourcesNameTooLong" xml:space="preserve">
+ <value>Corrupt .resources file. Resource name extends past the end of the file.</value>
+ </data>
+ <data name="BadImageFormat_ResTypeAndSerBlobMismatch" xml:space="preserve">
+ <value>The type serialized in the .resources file was not the same type that the .resources file said it contained. Expected '{0}' but read '{1}'.</value>
+ </data>
+ <data name="BadImageFormat_StreamPositionInvalid" xml:space="preserve">
+ <value>Corrupt .resources file. The specified position '{0}' is not a valid position in the stream.</value>
+ </data>
+ <data name="BadImageFormat_TypeMismatch" xml:space="preserve">
+ <value>Corrupt .resources file. The specified type doesn't match the available data in the stream.</value>
+ </data>
+ <data name="CancellationToken_CreateLinkedToken_TokensIsEmpty" xml:space="preserve">
+ <value>No tokens were supplied.</value>
+ </data>
+ <data name="CancellationToken_SourceDisposed" xml:space="preserve">
+ <value>The CancellationTokenSource associated with this CancellationToken has been disposed.</value>
+ </data>
+ <data name="CancellationTokenSource_Disposed" xml:space="preserve">
+ <value>The CancellationTokenSource has been disposed.</value>
+ </data>
+ <data name="ConcurrentCollection_SyncRoot_NotSupported" xml:space="preserve">
+ <value>The SyncRoot property may not be used for the synchronization of concurrent collections.</value>
+ </data>
+ <data name="ConcurrentDictionary_ArrayIncorrectType" xml:space="preserve">
+ <value>The array is multidimensional, or the type parameter for the set cannot be cast automatically to the type of the destination array.</value>
+ </data>
+ <data name="ConcurrentDictionary_ArrayNotLargeEnough" xml:space="preserve">
+ <value>The index is equal to or greater than the length of the array, or the number of elements in the dictionary is greater than the available space from index to the end of the destination array.</value>
+ </data>
+ <data name="ConcurrentDictionary_CapacityMustNotBeNegative" xml:space="preserve">
+ <value>The capacity argument must be greater than or equal to zero.</value>
+ </data>
+ <data name="ConcurrentDictionary_ConcurrencyLevelMustBePositive" xml:space="preserve">
+ <value>The concurrencyLevel argument must be positive.</value>
+ </data>
+ <data name="ConcurrentDictionary_IndexIsNegative" xml:space="preserve">
+ <value>The index argument is less than zero.</value>
+ </data>
+ <data name="ConcurrentDictionary_ItemKeyIsNull" xml:space="preserve">
+ <value>TKey is a reference type and item.Key is null.</value>
+ </data>
+ <data name="ConcurrentDictionary_KeyAlreadyExisted" xml:space="preserve">
+ <value>The key already existed in the dictionary.</value>
+ </data>
+ <data name="ConcurrentDictionary_SourceContainsDuplicateKeys" xml:space="preserve">
+ <value>The source argument contains duplicate keys.</value>
+ </data>
+ <data name="ConcurrentDictionary_TypeOfKeyIncorrect" xml:space="preserve">
+ <value>The key was of an incorrect type for this dictionary.</value>
+ </data>
+ <data name="ConcurrentDictionary_TypeOfValueIncorrect" xml:space="preserve">
+ <value>The value was of an incorrect type for this dictionary.</value>
+ </data>
+ <data name="ConcurrentStack_PushPopRange_CountOutOfRange" xml:space="preserve">
+ <value>The count argument must be greater than or equal to zero.</value>
+ </data>
+ <data name="ConcurrentStack_PushPopRange_InvalidCount" xml:space="preserve">
+ <value>The sum of the startIndex and count arguments must be less than or equal to the collection's Count.</value>
+ </data>
+ <data name="ConcurrentStack_PushPopRange_StartOutOfRange" xml:space="preserve">
+ <value>The startIndex argument must be greater than or equal to zero.</value>
+ </data>
+ <data name="ConcurrentStackQueue_OnDeserialization_NoData" xml:space="preserve">
+ <value>The serialization stream contains no elements.</value>
+ </data>
+ <data name="CountdownEvent_Decrement_BelowZero" xml:space="preserve">
+ <value>Invalid attempt made to decrement the event's count below zero.</value>
+ </data>
+ <data name="CountdownEvent_Increment_AlreadyMax" xml:space="preserve">
+ <value>The increment operation would cause the CurrentCount to overflow.</value>
+ </data>
+ <data name="CountdownEvent_Increment_AlreadyZero" xml:space="preserve">
+ <value>The event is already signaled and cannot be incremented.</value>
+ </data>
+ <data name="Cryptography_CryptoStream_FlushFinalBlockTwice" xml:space="preserve">
+ <value>FlushFinalBlock() method was called twice on a CryptoStream. It can only be called once.</value>
+ </data>
+ <data name="Cryptography_CSSM_Error" xml:space="preserve">
+ <value>Error 0x{0} from the operating system security framework: '{1}'.</value>
+ </data>
+ <data name="Cryptography_CSSM_Error_Unknown" xml:space="preserve">
+ <value>Error 0x{0} from the operating system security framework.</value>
+ </data>
+ <data name="Cryptography_HashKeySet" xml:space="preserve">
+ <value>Hash key cannot be changed after the first write to the stream.</value>
+ </data>
+ <data name="Cryptography_HashNotYetFinalized" xml:space="preserve">
+ <value>Hash must be finalized before the hash value is retrieved.</value>
+ </data>
+ <data name="Cryptography_InsufficientBuffer" xml:space="preserve">
+ <value>Input buffer contains insufficient data.</value>
+ </data>
+ <data name="Cryptography_InvalidBlockSize" xml:space="preserve">
+ <value>Specified block size is not valid for this algorithm.</value>
+ </data>
+ <data name="Cryptography_InvalidCipherMode" xml:space="preserve">
+ <value>Specified cipher mode is not valid for this algorithm.</value>
+ </data>
+ <data name="Cryptography_InvalidDSASignatureSize" xml:space="preserve">
+ <value>Length of the DSA signature was not 40 bytes.</value>
+ </data>
+ <data name="Cryptography_InvalidHandle" xml:space="preserve">
+ <value>{0} is an invalid handle.</value>
+ </data>
+ <data name="Cryptography_InvalidIVSize" xml:space="preserve">
+ <value>Specified initialization vector (IV) does not match the block size for this algorithm.</value>
+ </data>
+ <data name="Cryptography_InvalidKeySize" xml:space="preserve">
+ <value>Specified key is not a valid size for this algorithm.</value>
+ </data>
+ <data name="Cryptography_InvalidOID" xml:space="preserve">
+ <value>Object identifier (OID) is unknown.</value>
+ </data>
+ <data name="Cryptography_OAEPDecoding" xml:space="preserve">
+ <value>Error occurred while decoding OAEP padding.</value>
+ </data>
+ <data name="Cryptography_PasswordDerivedBytes_FewBytesSalt" xml:space="preserve">
+ <value>Salt is not at least eight bytes.</value>
+ </data>
+ <data name="Cryptography_PasswordDerivedBytes_InvalidIV" xml:space="preserve">
+ <value>The Initialization vector should have the same length as the algorithm block size in bytes.</value>
+ </data>
+ <data name="Cryptography_PKCS7_InvalidPadding" xml:space="preserve">
+ <value>Padding is invalid and cannot be removed.</value>
+ </data>
+ <data name="Cryptography_SSE_InvalidDataSize" xml:space="preserve">
+ <value>Length of the data to encrypt is invalid.</value>
+ </data>
+ <data name="Cryptography_UnknownHashAlgorithm" xml:space="preserve">
+ <value>'{0}' is not a known hash algorithm.</value>
+ </data>
+ <data name="Cryptography_X509_ExportFailed" xml:space="preserve">
+ <value>The certificate export operation failed.</value>
+ </data>
+ <data name="Cryptography_X509_InvalidContentType" xml:space="preserve">
+ <value>Invalid content type.</value>
+ </data>
+ <data name="Error_SecurityPolicyFileParse" xml:space="preserve">
+ <value>Error occurred while parsing the '{0}' policy level. The default policy level was used instead.</value>
+ </data>
+ <data name="Error_SecurityPolicyFileParseEx" xml:space="preserve">
+ <value>Error '{1}' occurred while parsing the '{0}' policy level. The default policy level was used instead.</value>
+ </data>
+ <data name="event_Barrier_PhaseFinished" xml:space="preserve">
+ <value>Barrier finishing phase {1}.</value>
+ </data>
+ <data name="event_ConcurrentBag_TryPeekSteals" xml:space="preserve">
+ <value>ConcurrentBag stealing in TryPeek.</value>
+ </data>
+ <data name="event_ConcurrentBag_TryTakeSteals" xml:space="preserve">
+ <value>ConcurrentBag stealing in TryTake.</value>
+ </data>
+ <data name="event_ConcurrentDictionary_AcquiringAllLocks" xml:space="preserve">
+ <value>ConcurrentDictionary acquiring all locks on {0} bucket(s).</value>
+ </data>
+ <data name="event_ConcurrentStack_FastPopFailed" xml:space="preserve">
+ <value>Pop from ConcurrentStack spun {0} time(s).</value>
+ </data>
+ <data name="event_ConcurrentStack_FastPushFailed" xml:space="preserve">
+ <value>Push to ConcurrentStack spun {0} time(s).</value>
+ </data>
+ <data name="event_ParallelFork" xml:space="preserve">
+ <value>Task {1} entering fork/join {2}.</value>
+ </data>
+ <data name="event_ParallelInvokeBegin" xml:space="preserve">
+ <value>Beginning ParallelInvoke {2} from Task {1} for {4} actions.</value>
+ </data>
+ <data name="event_ParallelInvokeEnd" xml:space="preserve">
+ <value>Ending ParallelInvoke {2}.</value>
+ </data>
+ <data name="event_ParallelJoin" xml:space="preserve">
+ <value>Task {1} leaving fork/join {2}.</value>
+ </data>
+ <data name="event_ParallelLoopBegin" xml:space="preserve">
+ <value>Beginning {3} loop {2} from Task {1}.</value>
+ </data>
+ <data name="event_ParallelLoopEnd" xml:space="preserve">
+ <value>Ending loop {2} after {3} iterations.</value>
+ </data>
+ <data name="event_SpinLock_FastPathFailed" xml:space="preserve">
+ <value>SpinLock beginning to spin.</value>
+ </data>
+ <data name="event_SpinWait_NextSpinWillYield" xml:space="preserve">
+ <value>Next spin will yield.</value>
+ </data>
+ <data name="event_TaskCompleted" xml:space="preserve">
+ <value>Task {2} completed.</value>
+ </data>
+ <data name="event_TaskScheduled" xml:space="preserve">
+ <value>Task {2} scheduled to TaskScheduler {0}.</value>
+ </data>
+ <data name="event_TaskStarted" xml:space="preserve">
+ <value>Task {2} executing.</value>
+ </data>
+ <data name="event_TaskWaitBegin" xml:space="preserve">
+ <value>Beginning wait ({3}) on Task {2}.</value>
+ </data>
+ <data name="event_TaskWaitEnd" xml:space="preserve">
+ <value>Ending wait on Task {2}.</value>
+ </data>
+ <data name="EventSource_AbstractMustNotDeclareEventMethods" xml:space="preserve">
+ <value>Abstract event source must not declare event methods ({0} with ID {1}).</value>
+ </data>
+ <data name="EventSource_AbstractMustNotDeclareKTOC" xml:space="preserve">
+ <value>Abstract event source must not declare {0} nested type.</value>
+ </data>
+ <data name="EventSource_AddScalarOutOfRange" xml:space="preserve">
+ <value>Getting out of bounds during scalar addition.</value>
+ </data>
+ <data name="EventSource_AttributeOnNonVoid" xml:space="preserve">
+ <value>Event attribute placed on method {0} which does not return 'void'.</value>
+ </data>
+ <data name="EventSource_ChannelTypeDoesNotMatchEventChannelValue" xml:space="preserve">
+ <value>Channel {0} does not match event channel value {1}.</value>
+ </data>
+ <data name="EventSource_DataDescriptorsOutOfRange" xml:space="preserve">
+ <value>Data descriptors are out of range.</value>
+ </data>
+ <data name="EventSource_DuplicateStringKey" xml:space="preserve">
+ <value>Multiple definitions for string "{0}".</value>
+ </data>
+ <data name="EventSource_EnumKindMismatch" xml:space="preserve">
+ <value>The type of {0} is not expected in {1}.</value>
+ </data>
+ <data name="EventSource_EtwAlreadyRegistered" xml:space="preserve">
+ <value>The provider has already been registered with the operating system.</value>
+ </data>
+ <data name="EventSource_EventChannelOutOfRange" xml:space="preserve">
+ <value>Channel {0} has a value of {1} which is outside the legal range (16-254).</value>
+ </data>
+ <data name="EventSource_EventIdReused" xml:space="preserve">
+ <value>Event {0} has ID {1} which is already in use.</value>
+ </data>
+ <data name="EventSource_EventMustHaveTaskIfNonDefaultOpcode" xml:space="preserve">
+ <value>Event {0} (with ID {1}) has a non-default opcode but not a task.</value>
+ </data>
+ <data name="EventSource_EventMustNotBeExplicitImplementation" xml:space="preserve">
+ <value>Event method {0} (with ID {1}) is an explicit interface method implementation. Re-write method as implicit implementation.</value>
+ </data>
+ <data name="EventSource_EventNameDoesNotEqualTaskPlusOpcode" xml:space="preserve">
+ <value>Event {0} (with ID {1}) has a name that is not the concatenation of its task name and opcode.</value>
+ </data>
+ <data name="EventSource_EventNameReused" xml:space="preserve">
+ <value>Event name {0} used more than once. If you wish to overload a method, the overloaded method should have a NonEvent attribute.</value>
+ </data>
+ <data name="EventSource_EventParametersMismatch" xml:space="preserve">
+ <value>Event {0} was called with {1} argument(s), but it is defined with {2} parameter(s).</value>
+ </data>
+ <data name="EventSource_EventSourceGuidInUse" xml:space="preserve">
+ <value>An instance of EventSource with Guid {0} already exists.</value>
+ </data>
+ <data name="EventSource_EventWithAdminChannelMustHaveMessage" xml:space="preserve">
+ <value>Event {0} specifies an Admin channel {1}. It must specify a Message property.</value>
+ </data>
+ <data name="EventSource_IllegalKeywordsValue" xml:space="preserve">
+ <value>Keyword {0} has a value of {1} which is outside the legal range (0-0x0000080000000000).</value>
+ </data>
+ <data name="EventSource_IllegalOpcodeValue" xml:space="preserve">
+ <value>Opcode {0} has a value of {1} which is outside the legal range (11-238).</value>
+ </data>
+ <data name="EventSource_IllegalTaskValue" xml:space="preserve">
+ <value>Task {0} has a value of {1} which is outside the legal range (1-65535).</value>
+ </data>
+ <data name="EventSource_IncorrentlyAuthoredTypeInfo" xml:space="preserve">
+ <value>Incorrectly-authored TypeInfo - a type should be serialized as one field or as one group</value>
+ </data>
+ <data name="EventSource_InvalidCommand" xml:space="preserve">
+ <value>Invalid command value.</value>
+ </data>
+ <data name="EventSource_InvalidEventFormat" xml:space="preserve">
+ <value>Can't specify both etw event format flags.</value>
+ </data>
+ <data name="EventSource_KeywordCollision" xml:space="preserve">
+ <value>Keywords {0} and {1} are defined with the same value ({2}).</value>
+ </data>
+ <data name="EventSource_KeywordNeedPowerOfTwo" xml:space="preserve">
+ <value>Value {0} for keyword {1} needs to be a power of 2.</value>
+ </data>
+ <data name="EventSource_ListenerCreatedInsideCallback" xml:space="preserve">
+ <value>Creating an EventListener inside a EventListener callback.</value>
+ </data>
+ <data name="EventSource_ListenerNotFound" xml:space="preserve">
+ <value>Listener not found.</value>
+ </data>
+ <data name="EventSource_ListenerWriteFailure" xml:space="preserve">
+ <value>An error occurred when writing to a listener.</value>
+ </data>
+ <data name="EventSource_MaxChannelExceeded" xml:space="preserve">
+ <value>Attempt to define more than the maximum limit of 8 channels for a provider.</value>
+ </data>
+ <data name="EventSource_MismatchIdToWriteEvent" xml:space="preserve">
+ <value>Event {0} is givien event ID {1} but {2} was passed to WriteEvent.</value>
+ </data>
+ <data name="EventSource_NeedGuid" xml:space="preserve">
+ <value>The Guid of an EventSource must be non zero.</value>
+ </data>
+ <data name="EventSource_NeedName" xml:space="preserve">
+ <value>The name of an EventSource must not be null.</value>
+ </data>
+ <data name="EventSource_NeedPositiveId" xml:space="preserve">
+ <value>Event IDs must be positive integers.</value>
+ </data>
+ <data name="EventSource_NoFreeBuffers" xml:space="preserve">
+ <value>No Free Buffers available from the operating system (e.g. event rate too fast).</value>
+ </data>
+ <data name="EventSource_NonCompliantTypeError" xml:space="preserve">
+ <value>The API supports only anonymous types or types decorated with the EventDataAttribute. Non-compliant type: {0} dataType.</value>
+ </data>
+ <data name="EventSource_NoRelatedActivityId" xml:space="preserve">
+ <value>EventSource expects the first parameter of the Event method to be of type Guid and to be named "relatedActivityId" when calling WriteEventWithRelatedActivityId.</value>
+ </data>
+ <data name="EventSource_NotSupportedArrayOfBinary" xml:space="preserve">
+ <value>Arrays of Binary are not supported.</value>
+ </data>
+ <data name="EventSource_NotSupportedArrayOfNil" xml:space="preserve">
+ <value>Arrays of Nil are not supported.</value>
+ </data>
+ <data name="EventSource_NotSupportedArrayOfNullTerminatedString" xml:space="preserve">
+ <value>Arrays of null-terminated string are not supported.</value>
+ </data>
+ <data name="EventSource_NotSupportedCustomSerializedData" xml:space="preserve">
+ <value>Enumerables of custom-serialized data are not supported</value>
+ </data>
+ <data name="EventSource_NotSupportedEnumType" xml:space="preserve">
+ <value>Enum type {0} underlying type {1} is not supported for serialization.</value>
+ </data>
+ <data name="EventSource_NotSupportedNestedArraysEnums" xml:space="preserve">
+ <value>Nested arrays/enumerables are not supported.</value>
+ </data>
+ <data name="EventSource_NullInput" xml:space="preserve">
+ <value>Null passed as a event argument.</value>
+ </data>
+ <data name="EventSource_OpcodeCollision" xml:space="preserve">
+ <value>Opcodes {0} and {1} are defined with the same value ({2}).</value>
+ </data>
+ <data name="EventSource_PayloadTooBig" xml:space="preserve">
+ <value>The payload for a single event is too large.</value>
+ </data>
+ <data name="EventSource_PeriodIllegalInProviderName" xml:space="preserve">
+ <value>Period character ('.') is illegal in an ETW provider name ({0}).</value>
+ </data>
+ <data name="EventSource_PinArrayOutOfRange" xml:space="preserve">
+ <value>Pins are out of range.</value>
+ </data>
+ <data name="EventSource_RecursiveTypeDefinition" xml:space="preserve">
+ <value>Recursive type definition is not supported.</value>
+ </data>
+ <data name="EventSource_ReservedKeywords" xml:space="preserve">
+ <value>Keywords values larger than 0x0000100000000000 are reserved for system use</value>
+ </data>
+ <data name="EventSource_ReservedOpcode" xml:space="preserve">
+ <value>Opcode values less than 11 are reserved for system use.</value>
+ </data>
+ <data name="EventSource_SessionIdError" xml:space="preserve">
+ <value>Bit position in AllKeywords ({0}) must equal the command argument named "EtwSessionKeyword" ({1}).</value>
+ </data>
+ <data name="EventSource_StopsFollowStarts" xml:space="preserve">
+ <value>An event with stop suffix must follow a corresponding event with a start suffix.</value>
+ </data>
+ <data name="EventSource_TaskCollision" xml:space="preserve">
+ <value>Tasks {0} and {1} are defined with the same value ({2}).</value>
+ </data>
+ <data name="EventSource_TaskOpcodePairReused" xml:space="preserve">
+ <value>Event {0} (with ID {1}) has the same task/opcode pair as event {2} (with ID {3}).</value>
+ </data>
+ <data name="EventSource_TooManyArgs" xml:space="preserve">
+ <value>Too many arguments.</value>
+ </data>
+ <data name="EventSource_TooManyFields" xml:space="preserve">
+ <value>Too many fields in structure.</value>
+ </data>
+ <data name="EventSource_ToString" xml:space="preserve">
+ <value>EventSource({0}, {1})</value>
+ </data>
+ <data name="EventSource_TypeMustBeSealedOrAbstract" xml:space="preserve">
+ <value>Event source types must be sealed or abstract.</value>
+ </data>
+ <data name="EventSource_TypeMustDeriveFromEventSource" xml:space="preserve">
+ <value>Event source types must derive from EventSource.</value>
+ </data>
+ <data name="EventSource_UndefinedChannel" xml:space="preserve">
+ <value>Use of undefined channel value {0} for event {1}.</value>
+ </data>
+ <data name="EventSource_UndefinedKeyword" xml:space="preserve">
+ <value>Use of undefined keyword value {0} for event {1}.</value>
+ </data>
+ <data name="EventSource_UndefinedOpcode" xml:space="preserve">
+ <value>Use of undefined opcode value {0} for event {1}.</value>
+ </data>
+ <data name="EventSource_UnsupportedEventTypeInManifest" xml:space="preserve">
+ <value>Unsupported type {0} in event source.</value>
+ </data>
+ <data name="EventSource_UnsupportedMessageProperty" xml:space="preserve">
+ <value>Event {0} specifies an illegal or unsupported formatting message ("{1}").</value>
+ </data>
+ <data name="EventSource_VarArgsParameterMismatch" xml:space="preserve">
+ <value>The parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly.</value>
+ </data>
+ <data name="Exception_EndOfInnerExceptionStack" xml:space="preserve">
+ <value>--- End of inner exception stack trace ---</value>
+ </data>
+ <data name="Exception_EndStackTraceFromPreviousThrow" xml:space="preserve">
+ <value>--- End of stack trace from previous location where exception was thrown ---</value>
+ </data>
+ <data name="Exception_WasThrown" xml:space="preserve">
+ <value>Exception of type '{0}' was thrown.</value>
+ </data>
+ <data name="ExecutionContext_ExceptionInAsyncLocalNotification" xml:space="preserve">
+ <value>An exception was not handled in an AsyncLocal<T> notification callback.</value>
+ </data>
+ <data name="ExecutionContext_UndoFailed" xml:space="preserve">
+ <value>Undo operation on a component context threw an exception</value>
+ </data>
+ <data name="ExecutionEngine_InvalidAttribute" xml:space="preserve">
+ <value>Attribute cannot have multiple definitions.</value>
+ </data>
+ <data name="ExecutionEngine_MissingSecurityDescriptor" xml:space="preserve">
+ <value>Unable to retrieve security descriptor for this frame.</value>
+ </data>
+ <data name="FieldAccess_InitOnly" xml:space="preserve">
+ <value>InitOnly (aka ReadOnly) fields can only be initialized in the type/instance constructor.</value>
+ </data>
+ <data name="FileNotFound_ResolveAssembly" xml:space="preserve">
+ <value>Could not resolve assembly '{0}'.</value>
+ </data>
+ <data name="FileSecurityState_OperationNotPermitted" xml:space="preserve">
+ <value>File operation not permitted. Access to path '{0}' is denied.</value>
+ </data>
+ <data name="Format_AttributeUsage" xml:space="preserve">
+ <value>Duplicate AttributeUsageAttribute found on attribute type {0}.</value>
+ </data>
+ <data name="Format_Bad7BitInt32" xml:space="preserve">
+ <value>Too many bytes in what should have been a 7 bit encoded Int32.</value>
+ </data>
+ <data name="Format_BadBase" xml:space="preserve">
+ <value>Invalid digits for the specified base.</value>
+ </data>
+ <data name="Format_BadBase64Char" xml:space="preserve">
+ <value>The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.</value>
+ </data>
+ <data name="Format_BadBase64CharArrayLength" xml:space="preserve">
+ <value>Invalid length for a Base-64 char array or string.</value>
+ </data>
+ <data name="Format_BadBoolean" xml:space="preserve">
+ <value>String was not recognized as a valid Boolean.</value>
+ </data>
+ <data name="Format_BadDatePattern" xml:space="preserve">
+ <value>Could not determine the order of year, month, and date from '{0}'.</value>
+ </data>
+ <data name="Format_BadDateTime" xml:space="preserve">
+ <value>String was not recognized as a valid DateTime.</value>
+ </data>
+ <data name="Format_BadDateTimeCalendar" xml:space="preserve">
+ <value>The DateTime represented by the string is not supported in calendar {0}.</value>
+ </data>
+ <data name="Format_BadDayOfWeek" xml:space="preserve">
+ <value>String was not recognized as a valid DateTime because the day of week was incorrect.</value>
+ </data>
+ <data name="Format_BadFormatSpecifier" xml:space="preserve">
+ <value>Format specifier was invalid.</value>
+ </data>
+ <data name="Format_BadQuote" xml:space="preserve">
+ <value>Cannot find a matching quote character for the character '{0}'.</value>
+ </data>
+ <data name="Format_BadTimeSpan" xml:space="preserve">
+ <value>String was not recognized as a valid TimeSpan.</value>
+ </data>
+ <data name="Format_DateOutOfRange" xml:space="preserve">
+ <value>The DateTime represented by the string is out of range.</value>
+ </data>
+ <data name="Format_EmptyInputString" xml:space="preserve">
+ <value>Input string was either empty or contained only whitespace.</value>
+ </data>
+ <data name="Format_ExtraJunkAtEnd" xml:space="preserve">
+ <value>Additional non-parsable characters are at the end of the string.</value>
+ </data>
+ <data name="Format_GuidBrace" xml:space="preserve">
+ <value>Expected {0xdddddddd, etc}.</value>
+ </data>
+ <data name="Format_GuidBraceAfterLastNumber" xml:space="preserve">
+ <value>Could not find a brace, or the length between the previous token and the brace was zero (i.e., '0x,'etc.).</value>
+ </data>
+ <data name="Format_GuidComma" xml:space="preserve">
+ <value>Could not find a comma, or the length between the previous token and the comma was zero (i.e., '0x,'etc.).</value>
+ </data>
+ <data name="Format_GuidDashes" xml:space="preserve">
+ <value>Dashes are in the wrong position for GUID parsing.</value>
+ </data>
+ <data name="Format_GuidEndBrace" xml:space="preserve">
+ <value>Could not find the ending brace.</value>
+ </data>
+ <data name="Format_GuidHexPrefix" xml:space="preserve">
+ <value>Expected hex 0x in '{0}'.</value>
+ </data>
+ <data name="Format_GuidInvalidChar" xml:space="preserve">
+ <value>Guid string should only contain hexadecimal characters.</value>
+ </data>
+ <data name="Format_GuidInvLen" xml:space="preserve">
+ <value>Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).</value>
+ </data>
+ <data name="Format_GuidUnrecognized" xml:space="preserve">
+ <value>Unrecognized Guid format.</value>
+ </data>
+ <data name="Format_IndexOutOfRange" xml:space="preserve">
+ <value>Index (zero based) must be greater than or equal to zero and less than the size of the argument list.</value>
+ </data>
+ <data name="Format_InvalidEnumFormatSpecification" xml:space="preserve">
+ <value>Format String can be only "G", "g", "X", "x", "F", "f", "D" or "d".</value>
+ </data>
+ <data name="Format_InvalidGuidFormatSpecification" xml:space="preserve">
+ <value>Format String can be only "D", "d", "N", "n", "P", "p", "B", "b", "X" or "x".</value>
+ </data>
+ <data name="Format_InvalidString" xml:space="preserve">
+ <value>Input string was not in a correct format.</value>
+ </data>
+ <data name="Format_MissingIncompleteDate" xml:space="preserve">
+ <value>There must be at least a partial date with a year present in the input.</value>
+ </data>
+ <data name="Format_NeedSingleChar" xml:space="preserve">
+ <value>String must be exactly one character long.</value>
+ </data>
+ <data name="Format_NoParsibleDigits" xml:space="preserve">
+ <value>Could not find any recognizable digits.</value>
+ </data>
+ <data name="Format_OffsetOutOfRange" xml:space="preserve">
+ <value>The time zone offset must be within plus or minus 14 hours.</value>
+ </data>
+ <data name="Format_RepeatDateTimePattern" xml:space="preserve">
+ <value>DateTime pattern '{0}' appears more than once with different values.</value>
+ </data>
+ <data name="Format_StringZeroLength" xml:space="preserve">
+ <value>String cannot have zero length.</value>
+ </data>
+ <data name="Format_TwoTimeZoneSpecifiers" xml:space="preserve">
+ <value>The String being parsed cannot contain two TimeZone specifiers.</value>
+ </data>
+ <data name="Format_UnknowDateTimeWord" xml:space="preserve">
+ <value>The string was not recognized as a valid DateTime. There is an unknown word starting at index {0}.</value>
+ </data>
+ <data name="Format_UTCOutOfRange" xml:space="preserve">
+ <value>The UTC representation of the date falls outside the year range 1-9999.</value>
+ </data>
+ <data name="GAC_ToString" xml:space="preserve">
+ <value>GAC</value>
+ </data>
+ <data name="Globalization_cp_1200" xml:space="preserve">
+ <value>Unicode</value>
+ </data>
+ <data name="Globalization_cp_12000" xml:space="preserve">
+ <value>Unicode (UTF-32)</value>
+ </data>
+ <data name="Globalization_cp_12001" xml:space="preserve">
+ <value>Unicode (UTF-32 Big-Endian)</value>
+ </data>
+ <data name="Globalization_cp_1201" xml:space="preserve">
+ <value>Unicode (Big-Endian)</value>
+ </data>
+ <data name="Globalization_cp_20127" xml:space="preserve">
+ <value>US-ASCII</value>
+ </data>
+ <data name="Globalization_cp_28591" xml:space="preserve">
+ <value>Western European (ISO)</value>
+ </data>
+ <data name="Globalization_cp_65000" xml:space="preserve">
+ <value>Unicode (UTF-7)</value>
+ </data>
+ <data name="Globalization_cp_65001" xml:space="preserve">
+ <value>Unicode (UTF-8)</value>
+ </data>
+ <data name="Hash_ToString" xml:space="preserve">
+ <value>Hash - {0} = {1}</value>
+ </data>
+ <data name="HostProtection_DemandedResources" xml:space="preserve">
+ <value>The demanded resources were:</value>
+ </data>
+ <data name="HostProtection_HostProtection" xml:space="preserve">
+ <value>Attempted to perform an operation that was forbidden by the CLR host.</value>
+ </data>
+ <data name="HostProtection_ProtectedResources" xml:space="preserve">
+ <value>The protected resources (only available with full trust) were:</value>
+ </data>
+ <data name="IndexOutOfRange_ArrayRankIndex" xml:space="preserve">
+ <value>Array does not have that many dimensions.</value>
+ </data>
+ <data name="IndexOutOfRange_IORaceCondition" xml:space="preserve">
+ <value>Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.</value>
+ </data>
+ <data name="IndexOutOfRange_UMSPosition" xml:space="preserve">
+ <value>Unmanaged memory stream position was beyond the capacity of the stream.</value>
+ </data>
+ <data name="InsufficientMemory_MemFailPoint" xml:space="preserve">
+ <value>Insufficient available memory to meet the expected demands of an operation at this time. Please try again later.</value>
+ </data>
+ <data name="InsufficientMemory_MemFailPoint_TooBig" xml:space="preserve">
+ <value>Insufficient memory to meet the expected demands of an operation, and this system is likely to never satisfy this request. If this is a 32 bit system, consider booting in 3 GB mode.</value>
+ </data>
+ <data name="InsufficientMemory_MemFailPoint_VAFrag" xml:space="preserve">
+ <value>Insufficient available memory to meet the expected demands of an operation at this time, possibly due to virtual address space fragmentation. Please try again later.</value>
+ </data>
+ <data name="Interop_COM_TypeMismatch" xml:space="preserve">
+ <value>Type mismatch between source and destination types.</value>
+ </data>
+ <data name="Interop_Marshal_Unmappable_Char" xml:space="preserve">
+ <value>Cannot marshal: Encountered unmappable character.</value>
+ </data>
+ <data name="InvalidCast_CannotCastNullToValueType" xml:space="preserve">
+ <value>Null object cannot be converted to a value type.</value>
+ </data>
+ <data name="InvalidCast_CannotCoerceByRefVariant" xml:space="preserve">
+ <value>Object cannot be coerced to the original type of the ByRef VARIANT it was obtained from.</value>
+ </data>
+ <data name="InvalidCast_DBNull" xml:space="preserve">
+ <value>Object cannot be cast to DBNull.</value>
+ </data>
+ <data name="InvalidCast_DownCastArrayElement" xml:space="preserve">
+ <value>At least one element in the source array could not be cast down to the destination array type.</value>
+ </data>
+ <data name="InvalidCast_Empty" xml:space="preserve">
+ <value>Object cannot be cast to Empty.</value>
+ </data>
+ <data name="InvalidCast_FromDBNull" xml:space="preserve">
+ <value>Object cannot be cast from DBNull to other types.</value>
+ </data>
+ <data name="InvalidCast_FromTo" xml:space="preserve">
+ <value>Invalid cast from '{0}' to '{1}'.</value>
+ </data>
+ <data name="InvalidCast_IConvertible" xml:space="preserve">
+ <value>Object must implement IConvertible.</value>
+ </data>
+ <data name="InvalidCast_OATypeMismatch" xml:space="preserve">
+ <value>OleAut reported a type mismatch.</value>
+ </data>
+ <data name="InvalidCast_StoreArrayElement" xml:space="preserve">
+ <value>Object cannot be stored in an array of this type.</value>
+ </data>
+ <data name="InvalidCast_WinRTIPropertyValueArrayCoersion" xml:space="preserve">
+ <value>Object in an IPropertyValue is of type '{0}' which cannot be convereted to a '{1}' due to array element '{2}': {3}.</value>
+ </data>
+ <data name="InvalidCast_WinRTIPropertyValueCoersion" xml:space="preserve">
+ <value>Object in an IPropertyValue is of type '{0}' with value '{1}', which cannot be converted to a '{2}'.</value>
+ </data>
+ <data name="InvalidCast_WinRTIPropertyValueElement" xml:space="preserve">
+ <value>Object in an IPropertyValue is of type '{0}', which cannot be converted to a '{1}'.</value>
+ </data>
+ <data name="InvalidOperation_ActivationArgsAppTrustMismatch" xml:space="preserve">
+ <value>The activation arguments and application trust for the AppDomain must correspond to the same application identity.</value>
+ </data>
+ <data name="InvalidOperation_AddContextFrozen" xml:space="preserve">
+ <value>Attempted to add properties to a frozen context.</value>
+ </data>
+ <data name="InvalidOperation_AnonymousCannotImpersonate" xml:space="preserve">
+ <value>An anonymous identity cannot perform an impersonation.</value>
+ </data>
+ <data name="InvalidOperation_ApartmentStateSwitchFailed" xml:space="preserve">
+ <value>Failed to set the specified COM apartment state.</value>
+ </data>
+ <data name="InvalidOperation_APIInvalidForCurrentContext" xml:space="preserve">
+ <value>The API '{0}' cannot be used on the current platform. See http://go.microsoft.com/fwlink/?LinkId=248273 for more information.</value>
+ </data>
+ <data name="InvalidOperation_AppDomainSandboxAPINeedsExplicitAppBase" xml:space="preserve">
+ <value>This API requires the ApplicationBase to be specified explicitly in the AppDomainSetup parameter.</value>
+ </data>
+ <data name="InvalidOperation_AsmLoadedForReflectionOnly" xml:space="preserve">
+ <value>Assembly has been loaded as ReflectionOnly. This API requires an assembly capable of execution.</value>
+ </data>
+ <data name="InvalidOperation_AssemblyHasBeenSaved" xml:space="preserve">
+ <value>Assembly '{0}' has been saved.</value>
+ </data>
+ <data name="InvalidOperation_AssertTransparentCode" xml:space="preserve">
+ <value>Cannot perform CAS Asserts in Security Transparent methods</value>
+ </data>
+ <data name="InvalidOperation_AsyncFlowCtrlCtxMismatch" xml:space="preserve">
+ <value>AsyncFlowControl objects can be used to restore flow only on a Context that had its flow suppressed.</value>
+ </data>
+ <data name="InvalidOperation_AsyncIOInProgress" xml:space="preserve">
+ <value>The stream is currently in use by a previous operation on the stream.</value>
+ </data>
+ <data name="InvalidOperation_BadEmptyMethodBody" xml:space="preserve">
+ <value>Method '{0}' does not have a method body.</value>
+ </data>
+ <data name="InvalidOperation_BadILGeneratorUsage" xml:space="preserve">
+ <value>ILGenerator usage is invalid.</value>
+ </data>
+ <data name="InvalidOperation_BadInstructionOrIndexOutOfBound" xml:space="preserve">
+ <value>MSIL instruction is invalid or index is out of bounds.</value>
+ </data>
+ <data name="InvalidOperation_BadInterfaceNotAbstract" xml:space="preserve">
+ <value>Interface must be declared abstract.</value>
+ </data>
+ <data name="InvalidOperation_BadMethodBody" xml:space="preserve">
+ <value>Method '{0}' cannot have a method body.</value>
+ </data>
+ <data name="InvalidOperation_BadResourceContainer" xml:space="preserve">
+ <value>Unable to add resource to transient module or transient assembly.</value>
+ </data>
+ <data name="InvalidOperation_BadTransientModuleReference" xml:space="preserve">
+ <value>Unable to make a reference to a transient module from a non-transient module.</value>
+ </data>
+ <data name="InvalidOperation_BadTypeAttributesNotAbstract" xml:space="preserve">
+ <value>Type must be declared abstract if any of its methods are abstract.</value>
+ </data>
+ <data name="InvalidOperation_CalledTwice" xml:space="preserve">
+ <value>The method cannot be called twice on the same instance.</value>
+ </data>
+ <data name="InvalidOperation_CannotAlterAssembly" xml:space="preserve">
+ <value>Unable to alter assembly information.</value>
+ </data>
+ <data name="InvalidOperation_CannotCopyUsedContext" xml:space="preserve">
+ <value>Only newly captured contexts can be copied</value>
+
+ </data>
+ <data name="InvalidOperation_CannotImportGlobalFromDifferentModule" xml:space="preserve">
+ <value>Unable to import a global method or field from a different module.</value>
+ </data>
+ <data name="InvalidOperation_CannotOverrideSetWithoutRevert" xml:space="preserve">
+ <value>Must override both HostExecutionContextManager.SetHostExecutionContext and HostExecutionContextManager.Revert.</value>
+ </data>
+ <data name="InvalidOperation_CannotRemoveFromStackOrQueue" xml:space="preserve">
+ <value>Removal is an invalid operation for Stack or Queue.</value>
+ </data>
+ <data name="InvalidOperation_CannotRemoveLastFromEmptyCollection" xml:space="preserve">
+ <value>Cannot remove the last element from an empty collection.</value>
+ </data>
+ <data name="InvalidOperation_CannotRestoreUnsupressedFlow" xml:space="preserve">
+ <value>Cannot restore context flow when it is not suppressed.</value>
+ </data>
+ <data name="InvalidOperation_CannotSupressFlowMultipleTimes" xml:space="preserve">
+ <value>Context flow is already suppressed.</value>
+ </data>
+ <data name="InvalidOperation_CannotUseAFCMultiple" xml:space="preserve">
+ <value>AsyncFlowControl object can be used only once to call Undo().</value>
+ </data>
+ <data name="InvalidOperation_CannotUseAFCOtherThread" xml:space="preserve">
+ <value>AsyncFlowControl object must be used on the thread where it was created.</value>
+ </data>
+ <data name="InvalidOperation_CannotUseSwitcherOtherThread" xml:space="preserve">
+ <value>Undo operation must be performed on the thread where the corresponding context was Set.</value>
+ </data>
+ <data name="InvalidOperation_CantCancelCtrlBreak" xml:space="preserve">
+ <value>Applications may not prevent control-break from terminating their process.</value>
+ </data>
+ <data name="InvalidOperation_CantInstantiateAbstractClass" xml:space="preserve">
+ <value>Instances of abstract classes cannot be created.</value>
+ </data>
+ <data name="InvalidOperation_CantInstantiateFunctionPointer" xml:space="preserve">
+ <value>Instances of function pointers cannot be created.</value>
+ </data>
+ <data name="InvalidOperation_CantSaveTransientAssembly" xml:space="preserve">
+ <value>Cannot save a transient assembly.</value>
+ </data>
+ <data name="InvalidOperation_ClaimCannotBeRemoved" xml:space="preserve">
+ <value>The Claim '{0}' was not able to be removed. It is either not part of this Identity or it is a claim that is owned by the Principal that contains this Identity. For example, the Principal will own the claim when creating a GenericPrincipal with roles. The roles will be exposed through the Identity that is passed in the constructor, but not actually owned by the Identity. Similar logic exists for a RolePrincipal.</value>
+ </data>
+ <data name="InvalidOperation_CollectionBackingDictionaryTooLarge" xml:space="preserve">
+ <value>The collection backing this Dictionary contains too many elements.</value>
+ </data>
+ <data name="InvalidOperation_CollectionBackingListTooLarge" xml:space="preserve">
+ <value>The collection backing this List contains too many elements.</value>
+ </data>
+ <data name="InvalidOperation_CollectionCorrupted" xml:space="preserve">
+ <value>A prior operation on this collection was interrupted by an exception. Collection's state is no longer trusted.</value>
+ </data>
+ <data name="InvalidOperation_ComputerName" xml:space="preserve">
+ <value>Computer name could not be obtained.</value>
+ </data>
+ <data name="InvalidOperation_ConsoleKeyAvailableOnFile" xml:space="preserve">
+ <value>Cannot see if a key has been pressed when either application does not have a console or when console input has been redirected from a file. Try Console.In.Peek.</value>
+ </data>
+ <data name="InvalidOperation_ConsoleReadKeyOnFile" xml:space="preserve">
+ <value>Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.</value>
+ </data>
+ <data name="InvalidOperation_ConstructorNotAllowedOnInterface" xml:space="preserve">
+ <value>Interface cannot have constructors.</value>
+ </data>
+ <data name="InvalidOperation_ContextAlreadyFrozen" xml:space="preserve">
+ <value>Context is already frozen.</value>
+ </data>
+ <data name="InvalidOperation_CriticalTransparentAreMutuallyExclusive" xml:space="preserve">
+ <value>SecurityTransparent and SecurityCritical attributes cannot be applied to the assembly scope at the same time.</value>
+ </data>
+ <data name="InvalidOperation_DateTimeParsing" xml:space="preserve">
+ <value>Internal Error in DateTime and Calendar operations.</value>
+ </data>
+ <data name="InvalidOperation_DebuggerLaunchFailed" xml:space="preserve">
+ <value>Debugger unable to launch.</value>
+ </data>
+ <data name="InvalidOperation_DefaultConstructorDefineBody" xml:space="preserve">
+ <value>The method body of the default constructor cannot be changed.</value>
+ </data>
+ <data name="InvalidOperation_DefaultConstructorILGen" xml:space="preserve">
+ <value>Unable to access ILGenerator on a constructor created with DefineDefaultConstructor.</value>
+ </data>
+ <data name="InvalidOperation_DuplicatePropertyName" xml:space="preserve">
+ <value>Another property by this name already exists.</value>
+ </data>
+ <data name="InvalidOperation_EmptyQueue" xml:space="preserve">
+ <value>Queue empty.</value>
+ </data>
+ <data name="InvalidOperation_EmptyStack" xml:space="preserve">
+ <value>Stack empty.</value>
+ </data>
+ <data name="InvalidOperation_EndInvokeCalledMultiple" xml:space="preserve">
+ <value>EndInvoke can only be called once for each asynchronous operation.</value>
+ </data>
+ <data name="InvalidOperation_EndReadCalledMultiple" xml:space="preserve">
+ <value>EndRead can only be called once for each asynchronous operation.</value>
+ </data>
+ <data name="InvalidOperation_EndWriteCalledMultiple" xml:space="preserve">
+ <value>EndWrite can only be called once for each asynchronous operation.</value>
+ </data>
+ <data name="InvalidOperation_EntryMethodNotDefinedInAssembly" xml:space="preserve">
+ <value>Entry method is not defined in the same assembly.</value>
+ </data>
+ <data name="InvalidOperation_EnumEnded" xml:space="preserve">
+ <value>Enumeration already finished.</value>
+ </data>
+ <data name="InvalidOperation_EnumFailedVersion" xml:space="preserve">
+ <value>Collection was modified; enumeration operation may not execute.</value>
+ </data>
+ <data name="InvalidOperation_EnumNotStarted" xml:space="preserve">
+ <value>Enumeration has not started. Call MoveNext.</value>
+ </data>
+ <data name="InvalidOperation_EnumOpCantHappen" xml:space="preserve">
+ <value>Enumeration has either not started or has already finished.</value>
+ </data>
+ <data name="InvalidOperation_EventInfoNotAvailable" xml:space="preserve">
+ <value>This API does not support EventInfo tokens.</value>
+ </data>
+ <data name="InvalidOperation_EventTokenTableRequiresDelegate" xml:space="preserve">
+ <value>Type '{0}' is not a delegate type. EventTokenTable may only be used with delegate types.</value>
+ </data>
+ <data name="InvalidOperation_ExceptionStateCrossAppDomain" xml:space="preserve">
+ <value>Thread.ExceptionState cannot access an ExceptionState from a different AppDomain.</value>
+ </data>
+ <data name="InvalidOperation_GenericParametersAlreadySet" xml:space="preserve">
+ <value>The generic parameters are already defined on this MethodBuilder.</value>
+ </data>
+ <data name="InvalidOperation_GetVersion" xml:space="preserve">
+ <value>OSVersion's call to GetVersionEx failed.</value>
+ </data>
+ <data name="InvalidOperation_GlobalsHaveBeenCreated" xml:space="preserve">
+ <value>Type definition of the global function has been completed.</value>
+ </data>
+ <data name="InvalidOperation_HandleIsNotInitialized" xml:space="preserve">
+ <value>Handle is not initialized.</value>
+ </data>
+ <data name="InvalidOperation_HandleIsNotPinned" xml:space="preserve">
+ <value>Handle is not pinned.</value>
+ </data>
+ <data name="InvalidOperation_HashInsertFailed" xml:space="preserve">
+ <value>Hashtable insert failed. Load factor too high. The most common cause is multiple threads writing to the Hashtable simultaneously.</value>
+ </data>
+ <data name="InvalidOperation_HostModifiedSecurityState" xml:space="preserve">
+ <value>The security state of an AppDomain was modified by an AppDomainManager configured with the NoSecurityChanges flag.</value>
+ </data>
+ <data name="InvalidOperation_IComparerFailed" xml:space="preserve">
+ <value>Failed to compare two elements in the array.</value>
+ </data>
+ <data name="InvalidOperation_InternalState" xml:space="preserve">
+ <value>Invalid internal state.</value>
+ </data>
+ <data name="InvalidOperation_InvalidComRegFunctionSig" xml:space="preserve">
+ <value>COM register function must have a System.Type parameter and a void return type.</value>
+ </data>
+ <data name="InvalidOperation_InvalidComUnRegFunctionSig" xml:space="preserve">
+ <value>COM unregister function must have a System.Type parameter and a void return type.</value>
+ </data>
+ <data name="InvalidOperation_MetaDataError" xml:space="preserve">
+ <value>Metadata operation failed.</value>
+ </data>
+ <data name="InvalidOperation_Method" xml:space="preserve">
+ <value>This method is not supported by the current object.</value>
+ </data>
+ <data name="InvalidOperation_MethodBaked" xml:space="preserve">
+ <value>Type definition of the method is complete.</value>
+ </data>
+ <data name="InvalidOperation_MethodBuilderBaked" xml:space="preserve">
+ <value>The signature of the MethodBuilder can no longer be modified because an operation on the MethodBuilder caused the methodDef token to be created. For example, a call to SetCustomAttribute requires the methodDef token to emit the CustomAttribute token.</value>
+ </data>
+ <data name="InvalidOperation_MethodHasBody" xml:space="preserve">
+ <value>Method already has a body.</value>
+ </data>
+ <data name="InvalidOperation_MismatchedAsyncResult" xml:space="preserve">
+ <value>The IAsyncResult object provided does not match this delegate.</value>
+ </data>
+ <data name="InvalidOperation_ModificationOfNonCanonicalAcl" xml:space="preserve">
+ <value>This access control list is not in canonical form and therefore cannot be modified.</value>
+ </data>
+ <data name="InvalidOperation_ModifyRONumFmtInfo" xml:space="preserve">
+ <value>Unable to modify a read-only NumberFormatInfo object.</value>
+ </data>
+ <data name="InvalidOperation_ModuleHasBeenSaved" xml:space="preserve">
+ <value>Module '{0}' has been saved.</value>
+ </data>
+ <data name="InvalidOperation_MultipleComRegFunctions" xml:space="preserve">
+ <value>Type '{0}' has more than one COM registration function.</value>
+ </data>
+ <data name="InvalidOperation_MultipleComUnRegFunctions" xml:space="preserve">
+ <value>Type '{0}' has more than one COM unregistration function.</value>
+ </data>
+ <data name="InvalidOperation_MustBeSameThread" xml:space="preserve">
+ <value>This operation must take place on the same thread on which the object was created.</value>
+ </data>
+ <data name="InvalidOperation_MustCallInitialize" xml:space="preserve">
+ <value>You must call Initialize on this object instance before using it.</value>
+ </data>
+ <data name="InvalidOperation_MustLockForReadOrWrite" xml:space="preserve">
+ <value>Object must be locked for read or write.</value>
+ </data>
+ <data name="InvalidOperation_MustLockForWrite" xml:space="preserve">
+ <value>Object must be locked for read.</value>
+ </data>
+ <data name="InvalidOperation_MustRevertPrivilege" xml:space="preserve">
+ <value>Must revert the privilege prior to attempting this operation.</value>
+ </data>
+ <data name="InvalidOperation_NativeOverlappedReused" xml:space="preserve">
+ <value>NativeOverlapped cannot be reused for multiple operations.</value>
+ </data>
+ <data name="InvalidOperation_NoAsmCodeBase" xml:space="preserve">
+ <value>Assembly does not have a code base.</value>
+ </data>
+ <data name="InvalidOperation_NoAsmName" xml:space="preserve">
+ <value>Assembly does not have an assembly name. In order to be registered for use by COM, an assembly must have a valid assembly name.</value>
+ </data>
+ <data name="InvalidOperation_NoMultiModuleAssembly" xml:space="preserve">
+ <value>You cannot have more than one dynamic module in each dynamic assembly in this version of the runtime.</value>
+ </data>
+ <data name="InvalidOperation_NonStaticComRegFunction" xml:space="preserve">
+ <value>COM register function must be static.</value>
+ </data>
+ <data name="InvalidOperation_NonStaticComUnRegFunction" xml:space="preserve">
+ <value>COM unregister function must be static.</value>
+ </data>
+ <data name="InvalidOperation_NoPublicAddMethod" xml:space="preserve">
+ <value>Cannot add the event handler since no public add method exists for the event.</value>
+ </data>
+ <data name="InvalidOperation_NoPublicRemoveMethod" xml:space="preserve">
+ <value>Cannot remove the event handler since no public remove method exists for the event.</value>
+ </data>
+ <data name="InvalidOperation_NoSecurityDescriptor" xml:space="preserve">
+ <value>The object does not contain a security descriptor.</value>
+ </data>
+ <data name="InvalidOperation_NotADebugModule" xml:space="preserve">
+ <value>Not a debug ModuleBuilder.</value>
+ </data>
+ <data name="InvalidOperation_NotAllowedInDynamicMethod" xml:space="preserve">
+ <value>The requested operation is invalid for DynamicMethod.</value>
+ </data>
+ <data name="InvalidOperation_NotAllowedInReflectionOnly" xml:space="preserve">
+ <value>The requested operation is invalid in the ReflectionOnly context.</value>
+ </data>
+ <data name="InvalidOperation_NotAVarArgCallingConvention" xml:space="preserve">
+ <value>Calling convention must be VarArgs.</value>
+ </data>
+ <data name="InvalidOperation_NotCurrentDomain" xml:space="preserve">
+ <value>You can only define a dynamic assembly on the current AppDomain.</value>
+ </data>
+ <data name="InvalidOperation_NotGenericType" xml:space="preserve">
+ <value>This operation is only valid on generic types.</value>
+ </data>
+ <data name="InvalidOperation_NotNewCaptureContext" xml:space="preserve">
+ <value>Cannot apply a context that has been marshaled across AppDomains, that was not acquired through a Capture operation or that has already been the argument to a Set call.</value>
+ </data>
+ <data name="InvalidOperation_NotSupportedOnWinRTEvent" xml:space="preserve">
+ <value>Adding or removing event handlers dynamically is not supported on WinRT events.</value>
+ </data>
+ <data name="InvalidOperation_NotWithConcurrentGC" xml:space="preserve">
+ <value>This API is not available when the concurrent GC is enabled.</value>
+ </data>
+ <data name="InvalidOperation_NoUnderlyingTypeOnEnum" xml:space="preserve">
+ <value>Underlying type information on enumeration is not specified.</value>
+ </data>
+ <data name="InvalidOperation_NoValue" xml:space="preserve">
+ <value>Nullable object must have a value.</value>
+ </data>
+ <data name="InvalidOperation_NullArray" xml:space="preserve">
+ <value>The underlying array is null.</value>
+ </data>
+ <data name="InvalidOperation_NullContext" xml:space="preserve">
+ <value>Cannot call Set on a null context</value>
+ </data>
+ <data name="InvalidOperation_NullModuleHandle" xml:space="preserve">
+ <value>The requested operation is invalid when called on a null ModuleHandle.</value>
+ </data>
+ <data name="InvalidOperation_OnlyValidForDS" xml:space="preserve">
+ <value>Adding ACEs with Object Flags and Object GUIDs is only valid for directory-object ACLs.</value>
+ </data>
+ <data name="InvalidOperation_OpenLocalVariableScope" xml:space="preserve">
+ <value>Local variable scope was not properly closed.</value>
+ </data>
+ <data name="InvalidOperation_Overlapped_Pack" xml:space="preserve">
+ <value>Cannot pack a packed Overlapped again.</value>
+ </data>
+ <data name="InvalidOperation_PIAMustBeStrongNamed" xml:space="preserve">
+ <value>Primary interop assemblies must be strongly named.</value>
+ </data>
+ <data name="InvalidOperation_PropertyInfoNotAvailable" xml:space="preserve">
+ <value>This API does not support PropertyInfo tokens.</value>
+ </data>
+ <data name="InvalidOperation_ReadOnly" xml:space="preserve">
+ <value>Instance is read-only.</value>
+ </data>
+ <data name="InvalidOperation_RegRemoveSubKey" xml:space="preserve">
+ <value>Registry key has subkeys and recursive removes are not supported by this method.</value>
+ </data>
+ <data name="InvalidOperation_ResMgrBadResSet_Type" xml:space="preserve">
+ <value>'{0}': ResourceSet derived classes must provide a constructor that takes a String file name and a constructor that takes a Stream.</value>
+ </data>
+ <data name="InvalidOperation_ResourceNotStream_Name" xml:space="preserve">
+ <value>Resource '{0}' was not a Stream - call GetObject instead.</value>
+ </data>
+ <data name="InvalidOperation_ResourceNotString_Name" xml:space="preserve">
+ <value>Resource '{0}' was not a String - call GetObject instead.</value>
+ </data>
+ <data name="InvalidOperation_ResourceNotString_Type" xml:space="preserve">
+ <value>Resource was of type '{0}' instead of String - call GetObject instead.</value>
+ </data>
+ <data name="InvalidOperation_ResourceWriterSaved" xml:space="preserve">
+ <value>The resource writer has already been closed and cannot be edited.</value>
+ </data>
+ <data name="InvalidOperation_SetData" xml:space="preserve">
+ <value>An additional permission should not be supplied for setting loader information.</value>
+ </data>
+ <data name="InvalidOperation_SetData_OnlyLocationURI" xml:space="preserve">
+ <value>SetData cannot be used to set the value for '{0}'.</value>
+ </data>
+ <data name="InvalidOperation_SetData_OnlyOnce" xml:space="preserve">
+ <value>SetData can only be used to set the value of a given name once.</value>
+ </data>
+ <data name="InvalidOperation_SetVolumeLabelFailed" xml:space="preserve">
+ <value>Volume labels can only be set for writable local volumes.</value>
+ </data>
+ <data name="InvalidOperation_ShouldNotHaveMethodBody" xml:space="preserve">
+ <value>Method body should not exist.</value>
+ </data>
+ <data name="InvalidOperation_SlotHasBeenFreed" xml:space="preserve">
+ <value>LocalDataStoreSlot storage has been freed.</value>
+ </data>
+ <data name="InvalidOperation_StrongNameKeyPairRequired" xml:space="preserve">
+ <value>A strong name key pair is required to emit a strong-named dynamic assembly.</value>
+ </data>
+ <data name="InvalidOperation_SwitcherCtxMismatch" xml:space="preserve">
+ <value>The Undo operation encountered a context that is different from what was applied in the corresponding Set operation. The possible cause is that a context was Set on the thread and not reverted(undone).</value>
+ </data>
+ <data name="InvalidOperation_ThreadAPIsNotSupported" xml:space="preserve">
+ <value>Use CompressedStack.(Capture/Run) or ExecutionContext.(Capture/Run) APIs instead.</value>
+ </data>
+ <data name="InvalidOperation_ThreadWrongThreadStart" xml:space="preserve">
+ <value>The thread was created with a ThreadStart delegate that does not accept a parameter.</value>
+ </data>
+ <data name="InvalidOperation_TimeoutsNotSupported" xml:space="preserve">
+ <value>Timeouts are not supported on this stream.</value>
+ </data>
+ <data name="InvalidOperation_TypeCannotBeBoxed" xml:space="preserve">
+ <value>The given type cannot be boxed.</value>
+ </data>
+ <data name="InvalidOperation_TypeHasBeenCreated" xml:space="preserve">
+ <value>Unable to change after type has been created.</value>
+ </data>
+ <data name="InvalidOperation_TypeNotCreated" xml:space="preserve">
+ <value>Type has not been created.</value>
+ </data>
+ <data name="InvalidOperation_UnderlyingArrayListChanged" xml:space="preserve">
+ <value>This range in the underlying list is invalid. A possible cause is that elements were removed.</value>
+ </data>
+ <data name="InvalidOperation_UnexpectedWin32Error" xml:space="preserve">
+ <value>Unexpected error when calling an operating system function. The returned error code is 0x{0:x}.</value>
+ </data>
+ <data name="InvalidOperation_UnknownEnumType" xml:space="preserve">
+ <value>Unknown enum type.</value>
+ </data>
+ <data name="InvalidOperation_UserDomainName" xml:space="preserve">
+ <value>UserDomainName native call failed.</value>
+ </data>
+ <data name="InvalidOperation_WaitOnTransparentProxy" xml:space="preserve">
+ <value>Cannot wait on a transparent proxy.</value>
+ </data>
+ <data name="InvalidOperation_WithoutARM" xml:space="preserve">
+ <value>This API is not available when AppDomain Resource Monitoring is not turned on.</value>
+ </data>
+ <data name="InvalidOperation_WriteOnce" xml:space="preserve">
+ <value>This property has already been set and cannot be modified.</value>
+ </data>
+ <data name="InvalidOperation_WrongAsyncResultOrEndCalledMultiple" xml:space="preserve">
+ <value>Either the IAsyncResult object did not come from the corresponding async method on this type, or the End method was called multiple times with the same IAsyncResult.</value>
+ </data>
+ <data name="InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple" xml:space="preserve">
+ <value>Either the IAsyncResult object did not come from the corresponding async method on this type, or EndRead was called multiple times with the same IAsyncResult.</value>
+ </data>
+ <data name="InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple" xml:space="preserve">
+ <value>Either the IAsyncResult object did not come from the corresponding async method on this type, or EndWrite was called multiple times with the same IAsyncResult.</value>
+ </data>
+ <data name="InvalidOperationException_ActorGraphCircular" xml:space="preserve">
+ <value>Actor cannot be set so that circular directed graph will exist chaining the subjects together.</value>
+ </data>
+ <data name="InvalidProgram_Default" xml:space="preserve">
+ <value>Common Language Runtime detected an invalid program.</value>
+ </data>
+ <data name="InvalidTimeZone_InvalidFileData" xml:space="preserve">
+ <value>The time zone ID '{0}' was found on the local computer, but the file at '{1}' was corrupt.</value>
+ </data>
+ <data name="InvalidTimeZone_InvalidRegistryData" xml:space="preserve">
+ <value>The time zone ID '{0}' was found on the local computer, but the registry information was corrupt.</value>
+ </data>
+ <data name="InvalidTimeZone_InvalidWin32APIData" xml:space="preserve">
+ <value>The Local time zone was found on the local computer, but the data was corrupt.</value>
+ </data>
+ <data name="InvalidTimeZone_JulianDayNotSupported" xml:space="preserve">
+ <value>Julian dates in POSIX strings are unsupported.</value>
+ </data>
+ <data name="InvalidTimeZone_NoTTInfoStructures" xml:space="preserve">
+ <value>There are no ttinfo structures in the tzfile. At least one ttinfo structure is required in order to construct a TimeZoneInfo object.</value>
+ </data>
+ <data name="InvalidTimeZone_UnparseablePosixMDateString" xml:space="preserve">
+ <value>'{0}' is not a valid POSIX-TZ-environment-variable MDate rule. A valid rule has the format 'Mm.w.d'.</value>
+ </data>
+ <data name="InvariantFailed" xml:space="preserve">
+ <value>Invariant failed.</value>
+ </data>
+ <data name="InvariantFailed_Cnd" xml:space="preserve">
+ <value>Invariant failed: {0}</value>
+ </data>
+ <data name="IO_DriveNotFound_Drive" xml:space="preserve">
+ <value>Could not find the drive '{0}'. The drive might not be ready or might not be mapped.</value>
+ </data>
+ <data name="IO_EOF_ReadBeyondEOF" xml:space="preserve">
+ <value>Unable to read beyond the end of the stream.</value>
+ </data>
+ <data name="IO_FileLoad" xml:space="preserve">
+ <value>Could not load the specified file.</value>
+ </data>
+ <data name="IO_FileName_Name" xml:space="preserve">
+ <value>File name: '{0}'</value>
+ </data>
+ <data name="IO_FileNotFound" xml:space="preserve">
+ <value>Unable to find the specified file.</value>
+ </data>
+ <data name="IO_FileNotFound_FileName" xml:space="preserve">
+ <value>Could not find file '{0}'.</value>
+ </data>
+ <data name="IO_AlreadyExists_Name" xml:space="preserve">
+ <value>Cannot create "{0}" because a file or directory with the same name already exists.</value>
+ </data>
+ <data name="IO_BindHandleFailed" xml:space="preserve">
+ <value>BindHandle for ThreadPool failed on this handle.</value>
+ </data>
+ <data name="IO_CannotCreateDirectory" xml:space="preserve">
+ <value>The specified directory '{0}' cannot be created.</value>
+ </data>
+ <data name="IO_FileExists_Name" xml:space="preserve">
+ <value>The file '{0}' already exists.</value>
+ </data>
+ <data name="IO_FileStreamHandlePosition" xml:space="preserve">
+ <value>The OS handle's position is not what FileStream expected. Do not use a handle simultaneously in one FileStream and in Win32 code or another FileStream. This may cause data loss.</value>
+ </data>
+ <data name="IO_FileTooLong2GB" xml:space="preserve">
+ <value>The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size.</value>
+ </data>
+ <data name="IO_FileTooLongOrHandleNotSync" xml:space="preserve">
+ <value>IO operation will not work. Most likely the file will become too long or the handle was not opened to support synchronous IO operations.</value>
+ </data>
+ <data name="IO_FixedCapacity" xml:space="preserve">
+ <value>Unable to expand length of this stream beyond its capacity.</value>
+ </data>
+ <data name="IO_InvalidStringLen_Len" xml:space="preserve">
+ <value>BinaryReader encountered an invalid string length of {0} characters.</value>
+ </data>
+ <data name="IO_NoConsole" xml:space="preserve">
+ <value>There is no console.</value>
+ </data>
+ <data name="IO_NoPermissionToDirectoryName" xml:space="preserve">
+ <value><Path discovery permission to the specified directory was denied.></value>
+ </data>
+ <data name="IO_SeekAppendOverwrite" xml:space="preserve">
+ <value>Unable seek backward to overwrite data that previously existed in a file opened in Append mode.</value>
+ </data>
+ <data name="IO_SeekBeforeBegin" xml:space="preserve">
+ <value>An attempt was made to move the position before the beginning of the stream.</value>
+ </data>
+ <data name="IO_SetLengthAppendTruncate" xml:space="preserve">
+ <value>Unable to truncate data that previously existed in a file opened in Append mode.</value>
+ </data>
+ <data name="IO_SharingViolation_File" xml:space="preserve">
+ <value>The process cannot access the file '{0}' because it is being used by another process.</value>
+ </data>
+ <data name="IO_SharingViolation_NoFileName" xml:space="preserve">
+ <value>The process cannot access the file because it is being used by another process.</value>
+ </data>
+ <data name="IO_SourceDestMustBeDifferent" xml:space="preserve">
+ <value>Source and destination path must be different.</value>
+ </data>
+ <data name="IO_SourceDestMustHaveSameRoot" xml:space="preserve">
+ <value>Source and destination path must have identical roots. Move will not work across volumes.</value>
+ </data>
+ <data name="IO_StreamTooLong" xml:space="preserve">
+ <value>Stream was too long.</value>
+ </data>
+ <data name="IO_PathNotFound_NoPathName" xml:space="preserve">
+ <value>Could not find a part of the path.</value>
+ </data>
+ <data name="IO_PathNotFound_Path" xml:space="preserve">
+ <value>Could not find a part of the path '{0}'.</value>
+ </data>
+ <data name="IO_PathTooLong" xml:space="preserve">
+ <value>The specified file name or path is too long, or a component of the specified path is too long.</value>
+ </data>
+ <data name="IO_StreamWriterBufferedDataLost" xml:space="preserve">
+ <value>A StreamWriter was not closed and all buffered data within that StreamWriter was not flushed to the underlying stream. (This was detected when the StreamWriter was finalized with data in its buffer.) A portion of the data was lost. Consider one of calling Close(), Flush(), setting the StreamWriter's AutoFlush property to true, or allocating the StreamWriter with a "using" statement. Stream type: {0}\r\nFile name: {1}\r\nAllocated from:\r\n {2}</value>
+ </data>
+ <data name="IO_StreamWriterBufferedDataLostCaptureAllocatedFromCallstackNotEnabled" xml:space="preserve">
+ <value>callstack information is not captured by default for performance reasons. Please enable captureAllocatedCallStack config switch for streamWriterBufferedDataLost MDA (refer to MSDN MDA documentation for how to do this).</value>
+ </data>
+ <data name="IO_UnknownFileName" xml:space="preserve">
+ <value>[Unknown]</value>
+ </data>
+ <data name="Lazy_CreateValue_NoParameterlessCtorForT" xml:space="preserve">
+ <value>The lazily-initialized type does not have a public, parameterless constructor.</value>
+ </data>
+ <data name="Lazy_ctor_deserialization_ValueInvalid" xml:space="preserve">
+ <value>The Value cannot be null.</value>
+ </data>
+ <data name="Lazy_ctor_InfoNull" xml:space="preserve">
+ <value>The info argument is null.</value>
+ </data>
+ <data name="Lazy_ctor_ModeInvalid" xml:space="preserve">
+ <value>The mode argument specifies an invalid value.</value>
+ </data>
+ <data name="Lazy_ctor_ValueSelectorNull" xml:space="preserve">
+ <value>The valueSelector argument is null.</value>
+ </data>
+ <data name="Lazy_StaticInit_InvalidOperation" xml:space="preserve">
+ <value>ValueFactory returned null.</value>
+ </data>
+ <data name="Lazy_ToString_ValueNotCreated" xml:space="preserve">
+ <value>Value is not created.</value>
+ </data>
+ <data name="Lazy_Value_RecursiveCallsToValue" xml:space="preserve">
+ <value>ValueFactory attempted to access the Value property of this instance.</value>
+ </data>
+ <data name="Loader_ContextPolicies" xml:space="preserve">
+ <value>Context Policies:</value>
+ </data>
+ <data name="Loader_InvalidPath" xml:space="preserve">
+ <value>Relative path must be a string that contains the substring, "..", or does not contain a root directory.</value>
+ </data>
+ <data name="Loader_Name" xml:space="preserve">
+ <value>Name:</value>
+ </data>
+ <data name="Loader_NoContextPolicies" xml:space="preserve">
+ <value>There are no context policies.</value>
+ </data>
+ <data name="LoadOfFxAssemblyNotSupported_AppX" xml:space="preserve">
+ <value>{0} of .NET Framework assemblies is not supported in AppX.</value>
+ </data>
+ <data name="ManualResetEventSlim_ctor_SpinCountOutOfRange" xml:space="preserve">
+ <value>The spinCount argument must be in the range 0 to {0}, inclusive.</value>
+ </data>
+ <data name="ManualResetEventSlim_ctor_TooManyWaiters" xml:space="preserve">
+ <value>There are too many threads currently waiting on the event. A maximum of {0} waiting threads are supported.</value>
+ </data>
+ <data name="ManualResetEventSlim_Disposed" xml:space="preserve">
+ <value>The event has been disposed.</value>
+ </data>
+ <data name="Marshaler_StringTooLong" xml:space="preserve">
+ <value>Marshaler restriction: Excessively long string.</value>
+ </data>
+ <data name="MissingConstructor_Name" xml:space="preserve">
+ <value>Constructor on type '{0}' not found.</value>
+ </data>
+ <data name="MissingField" xml:space="preserve">
+ <value>Field not found.</value>
+ </data>
+ <data name="MissingField_Name" xml:space="preserve">
+ <value>Field '{0}' not found.</value>
+ </data>
+ <data name="MissingManifestResource_LooselyLinked" xml:space="preserve">
+ <value>Could not find a manifest resource entry called "{0}" in assembly "{1}". Please check spelling, capitalization, and build rules to ensure "{0}" is being linked into the assembly.</value>
+ </data>
+ <data name="MissingManifestResource_MultipleBlobs" xml:space="preserve">
+ <value>A case-insensitive lookup for resource file "{0}" in assembly "{1}" found multiple entries. Remove the duplicates or specify the exact case.</value>
+ </data>
+ <data name="MissingManifestResource_NoNeutralAsm" xml:space="preserve">
+ <value>Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "{0}" was correctly embedded or linked into assembly "{1}" at compile time, or that all the satellite assemblies required are loadable and fully signed.</value>
+ </data>
+ <data name="MissingManifestResource_NoNeutralDisk" xml:space="preserve">
+ <value>Could not find any resources appropriate for the specified culture (or the neutral culture) on disk.</value>
+ </data>
+ <data name="MissingManifestResource_NoPRIresources" xml:space="preserve">
+ <value>Unable to open Package Resource Index.</value>
+ </data>
+ <data name="MissingManifestResource_ResWFileNotLoaded" xml:space="preserve">
+ <value>Unable to load resources for resource file "{0}" in package "{1}".</value>
+ </data>
+ <data name="MissingMember" xml:space="preserve">
+ <value>Member not found.</value>
+ </data>
+ <data name="MissingMember_Name" xml:space="preserve">
+ <value>Member '{0}' not found.</value>
+ </data>
+ <data name="MissingMemberNestErr" xml:space="preserve">
+ <value>TypedReference can only be made on nested value Types.</value>
+ </data>
+ <data name="MissingMemberTypeRef" xml:space="preserve">
+ <value>FieldInfo does not match the target Type.</value>
+ </data>
+ <data name="MissingMethod_Name" xml:space="preserve">
+ <value>Method '{0}' not found.</value>
+ </data>
+ <data name="MissingModule" xml:space="preserve">
+ <value>Module '{0}' not found.</value>
+ </data>
+ <data name="MissingSatelliteAssembly_Culture_Name" xml:space="preserve">
+ <value>The satellite assembly named "{1}" for fallback culture "{0}" either could not be found or could not be loaded. This is generally a setup problem. Please consider reinstalling or repairing the application.</value>
+ </data>
+ <data name="MissingSatelliteAssembly_Default" xml:space="preserve">
+ <value>Resource lookup fell back to the ultimate fallback resources in a satellite assembly, but that satellite either was not found or could not be loaded. Please consider reinstalling or repairing the application.</value>
+ </data>
+ <data name="MissingType" xml:space="preserve">
+ <value>Type '{0}' not found.</value>
+ </data>
+ <data name="Multicast_Combine" xml:space="preserve">
+ <value>Delegates that are not of type MulticastDelegate may not be combined.</value>
+ </data>
+ <data name="MustUseCCRewrite" xml:space="preserve">
+ <value>An assembly (probably "{1}") must be rewritten using the code contracts binary rewriter (CCRewrite) because it is calling Contract.{0} and the CONTRACTS_FULL symbol is defined. Remove any explicit definitions of the CONTRACTS_FULL symbol from your project and rebuild. CCRewrite can be downloaded from http://go.microsoft.com/fwlink/?LinkID=169180. \r\nAfter the rewriter is installed, it can be enabled in Visual Studio from the project's Properties page on the Code Contracts pane. Ensure that "Perform Runtime Contract Checking" is enabled, which will define CONTRACTS_FULL.</value>
+ </data>
+ <data name="NoDebugResources" xml:space="preserve">
+ <value>[{0}]\r\nArguments: {1}\r\nDebugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663AndVersion={2}AndFile={3}AndKey={4}</value>
+ </data>
+ <data name="NotImplemented_ResourcesLongerThanInt64Max" xml:space="preserve">
+ <value>Resource files longer than 2^63 bytes are not currently implemented.</value>
+ </data>
+ <data name="NotSupported_AbstractNonCLS" xml:space="preserve">
+ <value>This non-CLS method is not implemented.</value>
+ </data>
+ <data name="NotSupported_ActivAttr" xml:space="preserve">
+ <value>Activation Attributes are not supported.</value>
+ </data>
+ <data name="NotSupported_ActivAttrOnNonMBR" xml:space="preserve">
+ <value>Activation Attributes are not supported for types not deriving from MarshalByRefObject.</value>
+ </data>
+ <data name="NotSupported_ActivForCom" xml:space="preserve">
+ <value>Activation Attributes not supported for COM Objects.</value>
+ </data>
+ <data name="NotSupported_AmbiguousIdentity" xml:space="preserve">
+ <value>The operation is ambiguous because the permission represents multiple identities.</value>
+ </data>
+ <data name="NotSupported_AppX" xml:space="preserve">
+ <value>{0} is not supported in AppX.</value>
+ </data>
+ <data name="NotSupported_AssemblyLoadCodeBase" xml:space="preserve">
+ <value>Assembly.Load with a Codebase is not supported.</value>
+ </data>
+ <data name="NotSupported_AssemblyLoadFromHash" xml:space="preserve">
+ <value>Assembly.LoadFrom with hashValue is not supported.</value>
+ </data>
+ <data name="NotSupported_ByRefLike" xml:space="preserve">
+ <value>Cannot create boxed ByRef-like values.</value>
+ </data>
+ <data name="NotSupported_ByRefLikeArray" xml:space="preserve">
+ <value>Cannot create arrays of ByRef-like values.</value>
+ </data>
+ <data name="NotSupported_ByRefReturn" xml:space="preserve">
+ <value>ByRef return value not supported in reflection invocation.</value>
+ </data>
+ <data name="NotSupported_CallToVarArg" xml:space="preserve">
+ <value>Vararg calling convention not supported.</value>
+ </data>
+ <data name="NotSupported_CannotCallEqualsOnSpan" xml:space="preserve">
+ <value>Equals() on Span and ReadOnlySpan is not supported. Use operator== instead.</value>
+ </data>
+ <data name="NotSupported_CannotCallGetHashCodeOnSpan" xml:space="preserve">
+ <value>GetHashCode() on Span and ReadOnlySpan is not supported.</value>
+ </data>
+ <data name="NotSupported_CannotSaveModuleIndividually" xml:space="preserve">
+ <value>Unable to save a ModuleBuilder if it was created underneath an AssemblyBuilder. Call Save on the AssemblyBuilder instead.</value>
+ </data>
+ <data name="NotSupported_CannotWriteToBufferedStreamIfReadBufferCannotBeFlushed" xml:space="preserve">
+ <value>Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream.</value>
+ </data>
+ <data name="NotSupported_ChangeType" xml:space="preserve">
+ <value>ChangeType operation is not supported.</value>
+ </data>
+ <data name="NotSupported_CodePage50229" xml:space="preserve">
+ <value>The ISO-2022-CN Encoding (Code page 50229) is not supported.</value>
+ </data>
+ <data name="NotSupported_CollectibleAssemblyResolve" xml:space="preserve">
+ <value>Resolving to a collectible assembly is not supported.</value>
+ </data>
+ <data name="NotSupported_CollectibleBoundNonCollectible" xml:space="preserve">
+ <value>A non-collectible assembly may not reference a collectible assembly.</value>
+ </data>
+ <data name="NotSupported_CollectibleCOM" xml:space="preserve">
+ <value>COM Interop is not supported for collectible types.</value>
+ </data>
+ <data name="NotSupported_CollectibleDelegateMarshal" xml:space="preserve">
+ <value>Delegate marshaling for types within collectible assemblies is not supported.</value>
+ </data>
+ <data name="NotSupported_Constructor" xml:space="preserve">
+ <value>Object cannot be created through this constructor.</value>
+ </data>
+ <data name="NotSupported_CreateInstanceWithTypeBuilder" xml:space="preserve">
+ <value>CreateInstance cannot be used with an object of type TypeBuilder.</value>
+ </data>
+ <data name="NotSupported_DBNullSerial" xml:space="preserve">
+ <value>Only one DBNull instance may exist, and calls to DBNull deserialization methods are not allowed.</value>
+ </data>
+ <data name="NotSupported_DeclarativeUnion" xml:space="preserve">
+ <value>Declarative unionizing of these permissions is not supported.</value>
+ </data>
+ <data name="NotSupported_DeclSecVarArg" xml:space="preserve">
+ <value>Assert, Deny, and PermitOnly are not supported on methods with a Vararg calling convention.</value>
+ </data>
+ <data name="NotSupported_DelegateCreationFromPT" xml:space="preserve">
+ <value>Application code cannot use Activator.CreateInstance to create types that derive from System.Delegate. Delegate.CreateDelegate can be used instead.</value>
+ </data>
+ <data name="NotSupported_DelegateMarshalToWrongDomain" xml:space="preserve">
+ <value>Delegates cannot be marshaled from native code into a domain other than their home domain.</value>
+ </data>
+ <data name="NotSupported_DelegateSerHolderSerial" xml:space="preserve">
+ <value>DelegateSerializationHolder objects are designed to represent a delegate during serialization and are not serializable themselves.</value>
+ </data>
+ <data name="NotSupported_DynamicAssembly" xml:space="preserve">
+ <value>The invoked member is not supported in a dynamic assembly.</value>
+ </data>
+ <data name="NotSupported_DynamicAssemblyNoRunAccess" xml:space="preserve">
+ <value>Cannot execute code on a dynamic assembly without run access.</value>
+ </data>
+ <data name="NotSupported_DynamicMethodFlags" xml:space="preserve">
+ <value>Wrong MethodAttributes or CallingConventions for DynamicMethod. Only public, static, standard supported</value>
+ </data>
+ <data name="NotSupported_DynamicModule" xml:space="preserve">
+ <value>The invoked member is not supported in a dynamic module.</value>
+ </data>
+ <data name="NotSupported_EncryptionNeedsNTFS" xml:space="preserve">
+ <value>File encryption support only works on NTFS partitions.</value>
+ </data>
+ <data name="NotSupported_FileStreamOnNonFiles" xml:space="preserve">
+ <value>FileStream was asked to open a device that was not a file. For support for devices like 'com1:' or 'lpt1:', call CreateFile, then use the FileStream constructors that take an OS handle as an IntPtr.</value>
+ </data>
+ <data name="NotSupported_FixedSizeCollection" xml:space="preserve">
+ <value>Collection was of a fixed size.</value>
+ </data>
+ <data name="NotSupported_GenericMethod" xml:space="preserve">
+ <value>Generic methods with NativeCallableAttribute are not supported.</value>
+ </data>
+ <data name="NotSupported_GetMethod" xml:space="preserve">
+ <value>The 'get' method is not supported on this property.</value>
+ </data>
+ <data name="NotSupported_GlobalFunctionNotBaked" xml:space="preserve">
+ <value>The type definition of the global function is not completed.</value>
+ </data>
+ <data name="NotSupported_GlobalMethodSerialization" xml:space="preserve">
+ <value>Serialization of global methods (including implicit serialization via the use of asynchronous delegates) is not supported.</value>
+ </data>
+ <data name="NotSupported_IDispInvokeDefaultMemberWithNamedArgs" xml:space="preserve">
+ <value>Invoking default method with named arguments is not supported.</value>
+ </data>
+ <data name="NotSupported_IllegalOneByteBranch" xml:space="preserve">
+ <value>Illegal one-byte branch at position: {0}. Requested branch was: {1}.</value>
+ </data>
+ <data name="NotSupported_InComparableType" xml:space="preserve">
+ <value>A type must implement IComparable<T> or IComparable to support comparison.</value>
+ </data>
+ <data name="NotSupported_KeyCollectionSet" xml:space="preserve">
+ <value>Mutating a key collection derived from a dictionary is not allowed.</value>
+ </data>
+ <data name="NotSupported_ManagedActivation" xml:space="preserve">
+ <value>Cannot create uninitialized instances of types requiring managed activation.</value>
+ </data>
+ <data name="NotSupported_MaxValue" xml:space="preserve">
+ <value>The arithmetic type '{0}' does not have a maximum value.</value>
+ </data>
+ <data name="NotSupported_MaxWaitHandles" xml:space="preserve">
+ <value>The number of WaitHandles must be less than or equal to 64.</value>
+ </data>
+ <data name="NotSupported_MemStreamNotExpandable" xml:space="preserve">
+ <value>Memory stream is not expandable.</value>
+ </data>
+ <data name="NotSupported_Method" xml:space="preserve">
+ <value>Method is not supported.</value>
+ </data>
+ <data name="NotSupported_MinValue" xml:space="preserve">
+ <value>The arithmetic type '{0}' does not have a minimum value.</value>
+ </data>
+ <data name="NotSupported_MustBeModuleBuilder" xml:space="preserve">
+ <value>Module argument must be a ModuleBuilder.</value>
+ </data>
+ <data name="NotSupported_NativeCallableTarget" xml:space="preserve">
+ <value>Methods with NativeCallableAttribute cannot be used as delegate target.</value>
+ </data>
+ <data name="NotSupported_NegativeInfinity" xml:space="preserve">
+ <value>The arithmetic type '{0}' cannot represent negative infinity.</value>
+ </data>
+ <data name="NotSupported_NoCodepageData" xml:space="preserve">
+ <value>No data is available for encoding {0}. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.</value>
+ </data>
+ <data name="NotSupported_NonBlittableTypes" xml:space="preserve">
+ <value>Non-blittable parameter types are not supported for NativeCallable methods.</value>
+ </data>
+ <data name="NotSupported_NonReflectedType" xml:space="preserve">
+ <value>Not supported in a non-reflected type.</value>
+ </data>
+ <data name="NotSupported_NonStaticMethod" xml:space="preserve">
+ <value>Non-static methods with NativeCallableAttribute are not supported.</value>
+ </data>
+ <data name="NotSupported_NonUrlAttrOnMBR" xml:space="preserve">
+ <value>UrlAttribute is the only attribute supported for MarshalByRefObject.</value>
+ </data>
+ <data name="NotSupported_NoParentDefaultConstructor" xml:space="preserve">
+ <value>Parent does not have a default constructor. The default constructor must be explicitly defined.</value>
+ </data>
+ <data name="NotSupported_NotAllTypesAreBaked" xml:space="preserve">
+ <value>Type '{0}' was not completed.</value>
+ </data>
+ <data name="NotSupported_NotDynamicModule" xml:space="preserve">
+ <value>The MethodRental.SwapMethodBody method can only be called to swap the method body of a method in a dynamic module.</value>
+ </data>
+ <data name="NotSupported_NoTypeInfo" xml:space="preserve">
+ <value>Cannot resolve {0} to a TypeInfo object.</value>
+ </data>
+ <data name="NotSupported_NYI" xml:space="preserve">
+ <value>This feature is not currently implemented.</value>
+ </data>
+ <data name="NotSupported_ObsoleteResourcesFile" xml:space="preserve">
+ <value>Found an obsolete .resources file in assembly '{0}'. Rebuild that .resources file then rebuild that assembly.</value>
+ </data>
+ <data name="NotSupported_OleAutBadVarType" xml:space="preserve">
+ <value>The given Variant type is not supported by this OleAut function.</value>
+ </data>
+ <data name="NotSupported_One" xml:space="preserve">
+ <value>The arithmetic type '{0}' cannot represent the number one.</value>
+ </data>
+ <data name="NotSupported_OpenType" xml:space="preserve">
+ <value>Cannot create arrays of open type.</value>
+ </data>
+ <data name="NotSupported_OutputStreamUsingTypeBuilder" xml:space="preserve">
+ <value>Output streams do not support TypeBuilders.</value>
+ </data>
+ <data name="NotSupported_PIAInAppxProcess" xml:space="preserve">
+ <value>A Primary Interop Assembly is not supported in AppX.</value>
+ </data>
+ <data name="NotSupported_PopulateData" xml:space="preserve">
+ <value>This Surrogate does not support PopulateData().</value>
+ </data>
+ <data name="NotSupported_PositiveInfinity" xml:space="preserve">
+ <value>The arithmetic type '{0}' cannot represent positive infinity.</value>
+ </data>
+ <data name="NotSupported_RangeCollection" xml:space="preserve">
+ <value>The specified operation is not supported on Ranges.</value>
+ </data>
+ <data name="NotSupported_Reading" xml:space="preserve">
+ <value>Accessor does not support reading.</value>
+ </data>
+ <data name="NotSupported_ReadOnlyCollection" xml:space="preserve">
+ <value>Collection is read-only.</value>
+ </data>
+ <data name="NotSupported_ReflectionOnlyGetType" xml:space="preserve">
+ <value>Type.ReflectionOnlyGetType is not supported.</value>
+ </data>
+ <data name="NotSupported_ReflectionOnlyLoad" xml:space="preserve">
+ <value>Assembly.ReflectionOnlyLoad is not supported.</value>
+ </data>
+ <data name="NotSupported_ResourceObjectSerialization" xml:space="preserve">
+ <value>Cannot read resources that depend on serialization.</value>
+ </data>
+ <data name="NotSupported_SecurityPermissionUnion" xml:space="preserve">
+ <value>Union is not implemented.</value>
+ </data>
+ <data name="NotSupported_SetMethod" xml:space="preserve">
+ <value>The 'set' method is not supported on this property.</value>
+ </data>
+ <data name="NotSupported_SignalAndWaitSTAThread" xml:space="preserve">
+ <value>SignalAndWait on a STA thread is not supported.</value>
+ </data>
+ <data name="NotSupported_SortedListNestedWrite" xml:space="preserve">
+ <value>This operation is not supported on SortedList nested types because they require modifying the original SortedList.</value>
+ </data>
+ <data name="NotSupported_StringComparison" xml:space="preserve">
+ <value>The string comparison type passed in is currently not supported.</value>
+ </data>
+ <data name="NotSupported_SubclassOverride" xml:space="preserve">
+ <value>Derived classes must provide an implementation.</value>
+ </data>
+ <data name="NotSupported_SymbolMethod" xml:space="preserve">
+ <value>Not supported in an array method of a type definition that is not complete.</value>
+ </data>
+ <data name="NotSupported_TooManyArgs" xml:space="preserve">
+ <value>Stack size too deep. Possibly too many arguments.</value>
+ </data>
+ <data name="NotSupported_Type" xml:space="preserve">
+ <value>Type is not supported.</value>
+ </data>
+ <data name="NotSupported_TypeCannotDeserialized" xml:space="preserve">
+ <value>Direct deserialization of type '{0}' is not supported.</value>
+ </data>
+ <data name="NotSupported_TypeNotYetCreated" xml:space="preserve">
+ <value>The invoked member is not supported before the type is created.</value>
+ </data>
+ <data name="NotSupported_UmsSafeBuffer" xml:space="preserve">
+ <value>This operation is not supported for an UnmanagedMemoryStream created from a SafeBuffer.</value>
+ </data>
+ <data name="NotSupported_UnitySerHolder" xml:space="preserve">
+ <value>The UnitySerializationHolder object is designed to transmit information about other types and is not serializable itself.</value>
+ </data>
+ <data name="NotSupported_UnknownTypeCode" xml:space="preserve">
+ <value>TypeCode '{0}' was not valid.</value>
+ </data>
+ <data name="NotSupported_UnreadableStream" xml:space="preserve">
+ <value>Stream does not support reading.</value>
+ </data>
+ <data name="NotSupported_UnsafePointer" xml:space="preserve">
+ <value>This accessor was created with a SafeBuffer; use the SafeBuffer to gain access to the pointer.</value>
+ </data>
+ <data name="NotSupported_UnseekableStream" xml:space="preserve">
+ <value>Stream does not support seeking.</value>
+ </data>
+ <data name="NotSupported_UnwritableStream" xml:space="preserve">
+ <value>Stream does not support writing.</value>
+ </data>
+ <data name="NotSupported_UserCOM" xml:space="preserve">
+ <value>COM Interop is not supported for user-defined types.</value>
+ </data>
+ <data name="NotSupported_UserDllImport" xml:space="preserve">
+ <value>DllImport cannot be used on user-defined methods.</value>
+ </data>
+ <data name="NotSupported_ValueClassCM" xml:space="preserve">
+ <value>Custom marshalers for value types are not currently supported.</value>
+ </data>
+ <data name="NotSupported_ValueCollectionSet" xml:space="preserve">
+ <value>Mutating a value collection derived from a dictionary is not allowed.</value>
+ </data>
+ <data name="NotSupported_VoidArray" xml:space="preserve">
+ <value>Arrays of System.Void are not supported.</value>
+ </data>
+ <data name="NotSupported_WaitAllSTAThread" xml:space="preserve">
+ <value>WaitAll for multiple handles on a STA thread is not supported.</value>
+ </data>
+ <data name="NotSupported_WinRT_PartialTrust" xml:space="preserve">
+ <value>Windows Runtime is not supported in partial trust.</value>
+ </data>
+ <data name="NotSupported_Writing" xml:space="preserve">
+ <value>Accessor does not support writing.</value>
+ </data>
+ <data name="NotSupported_WrongResourceReader_Type" xml:space="preserve">
+ <value>This .resources file should not be read with this reader. The resource reader type is "{0}".</value>
+ </data>
+ <data name="NotSupported_Zero" xml:space="preserve">
+ <value>The arithmetic type '{0}' cannot represent the number zero.</value>
+ </data>
+ <data name="NullReference_This" xml:space="preserve">
+ <value>The pointer for this method was null.</value>
+ </data>
+ <data name="ObjectDisposed_FileClosed" xml:space="preserve">
+ <value>Cannot access a closed file.</value>
+ </data>
+ <data name="ObjectDisposed_Generic" xml:space="preserve">
+ <value>Cannot access a disposed object.</value>
+ </data>
+ <data name="ObjectDisposed_ObjectName_Name" xml:space="preserve">
+ <value>Object name: '{0}'.</value>
+ </data>
+ <data name="ObjectDisposed_ReaderClosed" xml:space="preserve">
+ <value>Cannot read from a closed TextReader.</value>
+ </data>
+ <data name="ObjectDisposed_RegKeyClosed" xml:space="preserve">
+ <value>Cannot access a closed registry key.</value>
+ </data>
+ <data name="ObjectDisposed_ResourceSet" xml:space="preserve">
+ <value>Cannot access a closed resource set.</value>
+ </data>
+ <data name="ObjectDisposed_StreamClosed" xml:space="preserve">
+ <value>Cannot access a closed Stream.</value>
+ </data>
+ <data name="ObjectDisposed_ViewAccessorClosed" xml:space="preserve">
+ <value>Cannot access a closed accessor.</value>
+ </data>
+ <data name="ObjectDisposed_WriterClosed" xml:space="preserve">
+ <value>Cannot write to a closed TextWriter.</value>
+ </data>
+ <data name="OperationCanceled" xml:space="preserve">
+ <value>The operation was canceled.</value>
+ </data>
+ <data name="OrderablePartitioner_GetPartitions_WrongNumberOfPartitions" xml:space="preserve">
+ <value>GetPartitions returned an incorrect number of partitions.</value>
+ </data>
+ <data name="OutOfMemory_GCHandleMDA" xml:space="preserve">
+ <value>The GCHandle MDA has run out of available cookies.</value>
+ </data>
+ <data name="Overflow_Byte" xml:space="preserve">
+ <value>Value was either too large or too small for an unsigned byte.</value>
+ </data>
+ <data name="Overflow_Char" xml:space="preserve">
+ <value>Value was either too large or too small for a character.</value>
+ </data>
+ <data name="Overflow_Currency" xml:space="preserve">
+ <value>Value was either too large or too small for a Currency.</value>
+ </data>
+ <data name="Overflow_Decimal" xml:space="preserve">
+ <value>Value was either too large or too small for a Decimal.</value>
+ </data>
+ <data name="Overflow_Double" xml:space="preserve">
+ <value>Value was either too large or too small for a Double.</value>
+ </data>
+ <data name="Overflow_Duration" xml:space="preserve">
+ <value>The duration cannot be returned for TimeSpan.MinValue because the absolute value of TimeSpan.MinValue exceeds the value of TimeSpan.MaxValue.</value>
+ </data>
+ <data name="Overflow_Int16" xml:space="preserve">
+ <value>Value was either too large or too small for an Int16.</value>
+ </data>
+ <data name="Overflow_Int32" xml:space="preserve">
+ <value>Value was either too large or too small for an Int32.</value>
+ </data>
+ <data name="Overflow_Int64" xml:space="preserve">
+ <value>Value was either too large or too small for an Int64.</value>
+ </data>
+ <data name="Overflow_NegateTwosCompNum" xml:space="preserve">
+ <value>Negating the minimum value of a twos complement number is invalid.</value>
+ </data>
+ <data name="Overflow_NegativeUnsigned" xml:space="preserve">
+ <value>The string was being parsed as an unsigned number and could not have a negative sign.</value>
+ </data>
+ <data name="Overflow_SByte" xml:space="preserve">
+ <value>Value was either too large or too small for a signed byte.</value>
+ </data>
+ <data name="Overflow_Single" xml:space="preserve">
+ <value>Value was either too large or too small for a Single.</value>
+ </data>
+ <data name="Overflow_TimeSpanElementTooLarge" xml:space="preserve">
+ <value>The TimeSpan could not be parsed because at least one of the numeric components is out of range or contains too many digits.</value>
+ </data>
+ <data name="Overflow_TimeSpanTooLong" xml:space="preserve">
+ <value>TimeSpan overflowed because the duration is too long.</value>
+ </data>
+ <data name="Overflow_UInt16" xml:space="preserve">
+ <value>Value was either too large or too small for a UInt16.</value>
+ </data>
+ <data name="Overflow_UInt32" xml:space="preserve">
+ <value>Value was either too large or too small for a UInt32.</value>
+ </data>
+ <data name="Overflow_UInt64" xml:space="preserve">
+ <value>Value was either too large or too small for a UInt64.</value>
+ </data>
+ <data name="Parallel_ForEach_NullEnumerator" xml:space="preserve">
+ <value>The Partitioner source returned a null enumerator.</value>
+ </data>
+ <data name="Parallel_ForEach_OrderedPartitionerKeysNotNormalized" xml:space="preserve">
+ <value>This method requires the use of an OrderedPartitioner with the KeysNormalized property set to true.</value>
+ </data>
+ <data name="Parallel_ForEach_PartitionerNotDynamic" xml:space="preserve">
+ <value>The Partitioner used here must support dynamic partitioning.</value>
+ </data>
+ <data name="Parallel_ForEach_PartitionerReturnedNull" xml:space="preserve">
+ <value>The Partitioner used here returned a null partitioner source.</value>
+ </data>
+ <data name="Parallel_Invoke_ActionNull" xml:space="preserve">
+ <value>One of the actions was null.</value>
+ </data>
+ <data name="ParallelState_Break_InvalidOperationException_BreakAfterStop" xml:space="preserve">
+ <value>Break was called after Stop was called.</value>
+ </data>
+ <data name="ParallelState_NotSupportedException_UnsupportedMethod" xml:space="preserve">
+ <value>This method is not supported.</value>
+ </data>
+ <data name="ParallelState_Stop_InvalidOperationException_StopAfterBreak" xml:space="preserve">
+ <value>Stop was called after Break was called.</value>
+ </data>
+ <data name="Partitioner_DynamicPartitionsNotSupported" xml:space="preserve">
+ <value>Dynamic partitions are not supported by this partitioner.</value>
+ </data>
+ <data name="PartitionerStatic_CanNotCallGetEnumeratorAfterSourceHasBeenDisposed" xml:space="preserve">
+ <value>Can not call GetEnumerator on partitions after the source enumerable is disposed</value>
+ </data>
+ <data name="PartitionerStatic_CurrentCalledBeforeMoveNext" xml:space="preserve">
+ <value>MoveNext must be called at least once before calling Current.</value>
+ </data>
+ <data name="PlatformNotSupported_NamedSynchronizationPrimitives" xml:space="preserve">
+ <value>The named version of this synchronization primitive is not supported on this platform.</value>
+ </data>
+ <data name="PlatformNotSupported_NamedSyncObjectWaitAnyWaitAll" xml:space="preserve">
+ <value>Wait operations on multiple wait handles including a named synchronization primitive are not supported on this platform.</value>
+ </data>
+ <data name="PlatformNotSupported_OSXFileLocking" xml:space="preserve">
+ <value>Locking/unlocking file regions is not supported on this platform. Use FileShare on the entire file instead.</value>
+ </data>
+ <data name="PlatformNotSupported_ReflectionOnly" xml:space="preserve">
+ <value>ReflectionOnly loading is not supported on this platform.</value>
+ </data>
+ <data name="PlatformNotSupported_RequiresLonghorn" xml:space="preserve">
+ <value>This operation is only supported on Windows Vista and above.</value>
+ </data>
+ <data name="PlatformNotSupported_RequiresNT" xml:space="preserve">
+ <value>This operation is only supported on Windows 2000, Windows XP, and higher.</value>
+ </data>
+ <data name="PlatformNotSupported_RequiresW2kSP3" xml:space="preserve">
+ <value>This operation is only supported on Windows 2000 SP3 or later operating systems.</value>
+ </data>
+ <data name="PlatformNotSupported_WinRT" xml:space="preserve">
+ <value>Windows Runtime is not supported on this operating system.</value>
+ </data>
+ <data name="Policy_AppTrustMustGrantAppRequest" xml:space="preserve">
+ <value>ApplicationTrust grant set does not contain ActivationContext's minimum request set.</value>
+ </data>
+ <data name="Policy_CannotLoadSemiTrustAssembliesDuringInit" xml:space="preserve">
+ <value>All assemblies loaded as part of AppDomain initialization must be fully trusted.</value>
+ </data>
+ <data name="Policy_Default" xml:space="preserve">
+ <value>Error occurred while performing a policy operation.</value>
+ </data>
+ <data name="Policy_SaveNotFileBased" xml:space="preserve">
+ <value>PolicyLevel object not based on a file cannot be saved.</value>
+ </data>
+ <data name="PostconditionFailed" xml:space="preserve">
+ <value>Postcondition failed.</value>
+ </data>
+ <data name="PostconditionFailed_Cnd" xml:space="preserve">
+ <value>Postcondition failed: {0}</value>
+ </data>
+ <data name="PostconditionOnExceptionFailed" xml:space="preserve">
+ <value>Postcondition failed after throwing an exception.</value>
+ </data>
+ <data name="PostconditionOnExceptionFailed_Cnd" xml:space="preserve">
+ <value>Postcondition failed after throwing an exception: {0}</value>
+ </data>
+ <data name="PreconditionFailed" xml:space="preserve">
+ <value>Precondition failed.</value>
+ </data>
+ <data name="PreconditionFailed_Cnd" xml:space="preserve">
+ <value>Precondition failed: {0}</value>
+ </data>
+ <data name="PrivilegeNotHeld_Default" xml:space="preserve">
+ <value>The process does not possess some privilege required for this operation.</value>
+ </data>
+ <data name="PrivilegeNotHeld_Named" xml:space="preserve">
+ <value>The process does not possess the '{0}' privilege which is required for this operation.</value>
+ </data>
+ <data name="Publisher_ToString" xml:space="preserve">
+ <value>Publisher</value>
+ </data>
+ <data name="Rank_MultiDimNotSupported" xml:space="preserve">
+ <value>Only single dimension arrays are supported here.</value>
+ </data>
+ <data name="Rank_MustMatch" xml:space="preserve">
+ <value>The specified arrays must have the same number of dimensions.</value>
+ </data>
+ <data name="ReflectionTypeLoad_LoadFailed" xml:space="preserve">
+ <value>Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.</value>
+ </data>
+ <data name="Remoting_AppDomainUnloaded" xml:space="preserve">
+ <value>The target application domain has been unloaded.</value>
+ </data>
+ <data name="Remoting_AppDomainUnloaded_ThreadUnwound" xml:space="preserve">
+ <value>The application domain in which the thread was running has been unloaded.</value>
+ </data>
+ <data name="Remoting_CantRemotePointerType" xml:space="preserve">
+ <value>Pointer types cannot be passed in a remote call.</value>
+ </data>
+ <data name="Remoting_Delegate_TooManyTargets" xml:space="preserve">
+ <value>The delegate must have only one target.</value>
+ </data>
+ <data name="Remoting_InvalidContext" xml:space="preserve">
+ <value>The context is not valid.</value>
+ </data>
+ <data name="Remoting_InvalidValueTypeFieldAccess" xml:space="preserve">
+ <value>An attempt was made to calculate the address of a value type field on a remote object. This was likely caused by an attempt to directly get or set the value of a field within this embedded value type. Avoid this and instead provide and use access methods for each field in the object that will be accessed remotely.</value>
+ </data>
+ <data name="Remoting_Message_BadRetValOrOutArg" xml:space="preserve">
+ <value>Bad return value or out-argument inside the return message.</value>
+ </data>
+ <data name="Remoting_NonPublicOrStaticCantBeCalledRemotely" xml:space="preserve">
+ <value>Permission denied: cannot call non-public or static methods remotely.</value>
+ </data>
+ <data name="Remoting_Proxy_ProxyTypeIsNotMBR" xml:space="preserve">
+ <value>classToProxy argument must derive from MarshalByRef type.</value>
+ </data>
+ <data name="Remoting_TP_NonNull" xml:space="preserve">
+ <value>The transparent proxy field of a real proxy must be null.</value>
+ </data>
+ <data name="Remoting_TypeCantBeRemoted" xml:space="preserve">
+ <value>The given type cannot be passed in a remote call.</value>
+ </data>
+ <data name="ResourceReaderIsClosed" xml:space="preserve">
+ <value>ResourceReader is closed.</value>
+ </data>
+ <data name="Resources_StreamNotValid" xml:space="preserve">
+ <value>Stream is not a valid resource file.</value>
+ </data>
+ <data name="RFLCT_AmbigCust" xml:space="preserve">
+ <value>Multiple custom attributes of the same type found.</value>
+ </data>
+ <data name="RFLCT_Ambiguous" xml:space="preserve">
+ <value>Ambiguous match found.</value>
+ </data>
+ <data name="InvalidFilterCriteriaException_CritInt" xml:space="preserve">
+ <value>An Int32 must be provided for the filter criteria.</value>
+ </data>
+ <data name="InvalidFilterCriteriaException_CritString" xml:space="preserve">
+ <value>A String must be provided for the filter criteria.</value>
+ </data>
+ <data name="RFLCT_InvalidFieldFail" xml:space="preserve">
+ <value>'{0}' field specified was not found.</value>
+ </data>
+ <data name="RFLCT_InvalidPropFail" xml:space="preserve">
+ <value>'{0}' property specified was not found.</value>
+ </data>
+ <data name="RFLCT_Targ_ITargMismatch" xml:space="preserve">
+ <value>Object does not match target type.</value>
+ </data>
+ <data name="RFLCT_Targ_StatFldReqTarg" xml:space="preserve">
+ <value>Non-static field requires a target.</value>
+ </data>
+ <data name="RFLCT_Targ_StatMethReqTarg" xml:space="preserve">
+ <value>Non-static method requires a target.</value>
+ </data>
+ <data name="RtType_InvalidCaller" xml:space="preserve">
+ <value>Caller is not a friend.</value>
+ </data>
+ <data name="RuntimeWrappedException" xml:space="preserve">
+ <value>An object that does not derive from System.Exception has been wrapped in a RuntimeWrappedException.</value>
+ </data>
+ <data name="Security_CannotReadFileData" xml:space="preserve">
+ <value>The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the file.</value>
+ </data>
+ <data name="Security_CannotReadRegistryData" xml:space="preserve">
+ <value>The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the registry information.</value>
+ </data>
+ <data name="Security_Generic" xml:space="preserve">
+ <value>Request for the permission of type '{0}' failed.</value>
+ </data>
+ <data name="Security_GenericNoType" xml:space="preserve">
+ <value>Request failed.</value>
+ </data>
+ <data name="Security_MustRevertOverride" xml:space="preserve">
+ <value>Stack walk modifier must be reverted before another modification of the same type can be performed.</value>
+
+ </data>
+ <data name="Security_NoAPTCA" xml:space="preserve">
+ <value>That assembly does not allow partially trusted callers.</value>
+ </data>
+ <data name="Security_RegistryPermission" xml:space="preserve">
+ <value>Requested registry access is not allowed.</value>
+ </data>
+ <data name="SemaphoreSlim_ctor_InitialCountWrong" xml:space="preserve">
+ <value>The initialCount argument must be non-negative and less than or equal to the maximumCount.</value>
+ </data>
+ <data name="SemaphoreSlim_ctor_MaxCountWrong" xml:space="preserve">
+ <value>The maximumCount argument must be a positive number. If a maximum is not required, use the constructor without a maxCount parameter.</value>
+ </data>
+ <data name="SemaphoreSlim_Disposed" xml:space="preserve">
+ <value>The semaphore has been disposed.</value>
+ </data>
+ <data name="SemaphoreSlim_Release_CountWrong" xml:space="preserve">
+ <value>The releaseCount argument must be greater than zero.</value>
+ </data>
+ <data name="SemaphoreSlim_Wait_TimeoutWrong" xml:space="preserve">
+ <value>The timeout must represent a value between -1 and Int32.MaxValue, inclusive.</value>
+ </data>
+ <data name="Serialization_BadParameterInfo" xml:space="preserve">
+ <value>Non existent ParameterInfo. Position bigger than member's parameters length.</value>
+ </data>
+ <data name="Serialization_CorruptField" xml:space="preserve">
+ <value>The value of the field '{0}' is invalid. The serialized data is corrupt.</value>
+ </data>
+ <data name="Serialization_DateTimeTicksOutOfRange" xml:space="preserve">
+ <value>Invalid serialized DateTime data. Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.</value>
+ </data>
+ <data name="Serialization_InsufficientDeserializationState" xml:space="preserve">
+ <value>Insufficient state to deserialize the object. Missing field '{0}'. More information is needed.</value>
+ </data>
+ <data name="Serialization_InsufficientState" xml:space="preserve">
+ <value>Insufficient state to return the real object.</value>
+ </data>
+ <data name="Serialization_InvalidData" xml:space="preserve">
+ <value>An error occurred while deserializing the object. The serialized data is corrupt.</value>
+ </data>
+ <data name="Serialization_InvalidDelegateType" xml:space="preserve">
+ <value>Cannot serialize delegates over unmanaged function pointers, dynamic methods or methods outside the delegate creator's assembly.</value>
+ </data>
+ <data name="Serialization_InvalidEscapeSequence" xml:space="preserve">
+ <value>The serialized data contained an invalid escape sequence '\\{0}'.</value>
+ </data>
+ <data name="Serialization_InvalidFieldState" xml:space="preserve">
+ <value>Object fields may not be properly initialized.</value>
+ </data>
+ <data name="Serialization_InvalidOnDeser" xml:space="preserve">
+ <value>OnDeserialization method was called while the object was not being deserialized.</value>
+ </data>
+ <data name="Serialization_InvalidPtrValue" xml:space="preserve">
+ <value>An IntPtr or UIntPtr with an eight byte value cannot be deserialized on a machine with a four byte word size.</value>
+ </data>
+ <data name="Serialization_InvalidType" xml:space="preserve">
+ <value>Only system-provided types can be passed to the GetUninitializedObject method. '{0}' is not a valid instance of a type.</value>
+ </data>
+ <data name="Serialization_KeyValueDifferentSizes" xml:space="preserve">
+ <value>The keys and values arrays have different sizes.</value>
+ </data>
+ <data name="Serialization_MemberOutOfRange" xml:space="preserve">
+ <value>The deserialized value of the member "{0}" in the class "{1}" is out of range.</value>
+ </data>
+ <data name="Serialization_MemberTypeNotRecognized" xml:space="preserve">
+ <value>Unknown member type.</value>
+ </data>
+ <data name="Serialization_MissField" xml:space="preserve">
+ <value>Field {0} is missing.</value>
+ </data>
+ <data name="Serialization_MissingDateTimeData" xml:space="preserve">
+ <value>Invalid serialized DateTime data. Unable to find 'ticks' or 'dateData'.</value>
+ </data>
+ <data name="Serialization_MissingKeys" xml:space="preserve">
+ <value>The Keys for this Hashtable are missing.</value>
+ </data>
+ <data name="Serialization_MissingValues" xml:space="preserve">
+ <value>The values for this dictionary are missing.</value>
+ </data>
+ <data name="Serialization_NonSerType" xml:space="preserve">
+ <value>Type '{0}' in Assembly '{1}' is not marked as serializable.</value>
+ </data>
+ <data name="Serialization_NoParameterInfo" xml:space="preserve">
+ <value>Serialized member does not have a ParameterInfo.</value>
+ </data>
+ <data name="Serialization_NotFound" xml:space="preserve">
+ <value>Member '{0}' was not found.</value>
+ </data>
+ <data name="Serialization_NullKey" xml:space="preserve">
+ <value>One of the serialized keys is null.</value>
+ </data>
+ <data name="Serialization_NullSignature" xml:space="preserve">
+ <value>The method signature cannot be null.</value>
+ </data>
+ <data name="Serialization_OptionalFieldVersionValue" xml:space="preserve">
+ <value>Version value must be positive.</value>
+ </data>
+ <data name="Serialization_SameNameTwice" xml:space="preserve">
+ <value>Cannot add the same member twice to a SerializationInfo object.</value>
+ </data>
+ <data name="Serialization_StringBuilderCapacity" xml:space="preserve">
+ <value>The serialized Capacity property of StringBuilder must be positive, less than or equal to MaxCapacity and greater than or equal to the String length.</value>
+ </data>
+ <data name="Serialization_StringBuilderMaxCapacity" xml:space="preserve">
+ <value>The serialized MaxCapacity property of StringBuilder must be positive and greater than or equal to the String length.</value>
+ </data>
+ <data name="Serialization_UnableToFindModule" xml:space="preserve">
+ <value>The given module {0} cannot be found within the assembly {1}.</value>
+ </data>
+ <data name="Serialization_UnknownMember" xml:space="preserve">
+ <value>Cannot get the member '{0}'.</value>
+ </data>
+ <data name="Site_ToString" xml:space="preserve">
+ <value>Site</value>
+ </data>
+ <data name="SpinLock_Exit_SynchronizationLockException" xml:space="preserve">
+ <value>The calling thread does not hold the lock.</value>
+ </data>
+ <data name="SpinLock_IsHeldByCurrentThread" xml:space="preserve">
+ <value>Thread tracking is disabled.</value>
+ </data>
+ <data name="SpinLock_TryEnter_ArgumentOutOfRange" xml:space="preserve">
+ <value>The timeout must be a value between -1 and Int32.MaxValue, inclusive.</value>
+ </data>
+ <data name="SpinLock_TryEnter_LockRecursionException" xml:space="preserve">
+ <value>The calling thread already holds the lock.</value>
+ </data>
+ <data name="SpinLock_TryReliableEnter_ArgumentException" xml:space="preserve">
+ <value>The tookLock argument must be set to false before calling this method.</value>
+ </data>
+ <data name="SpinWait_SpinUntil_ArgumentNull" xml:space="preserve">
+ <value>The condition argument is null.</value>
+ </data>
+ <data name="SpinWait_SpinUntil_TimeoutWrong" xml:space="preserve">
+ <value>The timeout must represent a value between -1 and Int32.MaxValue, inclusive.</value>
+ </data>
+ <data name="StackTrace_InFileLineNumber" xml:space="preserve">
+ <value>in {0}:line {1}</value>
+ </data>
+ <data name="StrongName_Name" xml:space="preserve">
+ <value>name = {0}</value>
+ </data>
+ <data name="StrongName_ToString" xml:space="preserve">
+ <value>StrongName - {0}{1}{2}</value>
+ </data>
+ <data name="StrongName_Version" xml:space="preserve">
+ <value>version = {0}</value>
+ </data>
+ <data name="Task_ContinueWith_ESandLR" xml:space="preserve">
+ <value>The specified TaskContinuationOptions combined LongRunning and ExecuteSynchronously. Synchronous continuations should not be long running.</value>
+ </data>
+ <data name="Task_ContinueWith_NotOnAnything" xml:space="preserve">
+ <value>The specified TaskContinuationOptions excluded all continuation kinds.</value>
+ </data>
+ <data name="Task_ctor_LRandSR" xml:space="preserve">
+ <value>(Internal)An attempt was made to create a LongRunning SelfReplicating task.</value>
+ </data>
+ <data name="Task_Delay_InvalidDelay" xml:space="preserve">
+ <value>The value needs to translate in milliseconds to -1 (signifying an infinite timeout), 0 or a positive integer less than or equal to Int32.MaxValue.</value>
+ </data>
+ <data name="Task_Delay_InvalidMillisecondsDelay" xml:space="preserve">
+ <value>The value needs to be either -1 (signifying an infinite timeout), 0 or a positive integer.</value>
+ </data>
+ <data name="Task_Dispose_NotCompleted" xml:space="preserve">
+ <value>A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled).</value>
+ </data>
+ <data name="Task_FromAsync_LongRunning" xml:space="preserve">
+ <value>It is invalid to specify TaskCreationOptions.LongRunning in calls to FromAsync.</value>
+ </data>
+ <data name="Task_FromAsync_PreferFairness" xml:space="preserve">
+ <value>It is invalid to specify TaskCreationOptions.PreferFairness in calls to FromAsync.</value>
+ </data>
+ <data name="Task_FromAsync_SelfReplicating" xml:space="preserve">
+ <value>It is invalid to specify TaskCreationOptions.SelfReplicating in calls to FromAsync.</value>
+ </data>
+ <data name="Task_FromAsync_TaskManagerShutDown" xml:space="preserve">
+ <value>FromAsync was called with a TaskManager that had already shut down.</value>
+ </data>
+ <data name="Task_MultiTaskContinuation_EmptyTaskList" xml:space="preserve">
+ <value>The tasks argument contains no tasks.</value>
+ </data>
+ <data name="Task_MultiTaskContinuation_FireOptions" xml:space="preserve">
+ <value>It is invalid to exclude specific continuation kinds for continuations off of multiple tasks.</value>
+ </data>
+ <data name="Task_MultiTaskContinuation_NullTask" xml:space="preserve">
+ <value>The tasks argument included a null value.</value>
+ </data>
+ <data name="Task_RunSynchronously_AlreadyStarted" xml:space="preserve">
+ <value>RunSynchronously may not be called on a task that was already started.</value>
+ </data>
+ <data name="Task_RunSynchronously_Continuation" xml:space="preserve">
+ <value>RunSynchronously may not be called on a continuation task.</value>
+ </data>
+ <data name="Task_RunSynchronously_Promise" xml:space="preserve">
+ <value>RunSynchronously may not be called on a task not bound to a delegate, such as the task returned from an asynchronous method.</value>
+ </data>
+ <data name="Task_RunSynchronously_TaskCompleted" xml:space="preserve">
+ <value>RunSynchronously may not be called on a task that has already completed.</value>
+ </data>
+ <data name="Task_Start_AlreadyStarted" xml:space="preserve">
+ <value>Start may not be called on a task that was already started.</value>
+ </data>
+ <data name="Task_Start_ContinuationTask" xml:space="preserve">
+ <value>Start may not be called on a continuation task.</value>
+ </data>
+ <data name="Task_Start_Promise" xml:space="preserve">
+ <value>Start may not be called on a promise-style task.</value>
+ </data>
+ <data name="Task_Start_TaskCompleted" xml:space="preserve">
+ <value>Start may not be called on a task that has completed.</value>
+ </data>
+ <data name="Task_ThrowIfDisposed" xml:space="preserve">
+ <value>The task has been disposed.</value>
+ </data>
+ <data name="Task_WaitMulti_NullTask" xml:space="preserve">
+ <value>The tasks array included at least one null element.</value>
+ </data>
+ <data name="TaskAwaiter_TaskNotCompleted" xml:space="preserve">
+ <value>The awaited task has not yet completed.</value>
+ </data>
+ <data name="TaskCanceledException_ctor_DefaultMessage" xml:space="preserve">
+ <value>A task was canceled.</value>
+ </data>
+ <data name="TaskCompletionSourceT_TrySetException_NoExceptions" xml:space="preserve">
+ <value>The exceptions collection was empty.</value>
+ </data>
+ <data name="TaskCompletionSourceT_TrySetException_NullException" xml:space="preserve">
+ <value>The exceptions collection included at least one null element.</value>
+ </data>
+ <data name="TaskExceptionHolder_UnhandledException" xml:space="preserve">
+ <value>A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.</value>
+ </data>
+ <data name="TaskExceptionHolder_UnknownExceptionType" xml:space="preserve">
+ <value>(Internal)Expected an Exception or an IEnumerable<Exception></value>
+ </data>
+ <data name="TaskScheduler_ExecuteTask_TaskAlreadyExecuted" xml:space="preserve">
+ <value>ExecuteTask may not be called for a task which was already executed.</value>
+ </data>
+ <data name="TaskScheduler_ExecuteTask_WrongTaskScheduler" xml:space="preserve">
+ <value>ExecuteTask may not be called for a task which was previously queued to a different TaskScheduler.</value>
+ </data>
+ <data name="TaskScheduler_FromCurrentSynchronizationContext_NoCurrent" xml:space="preserve">
+ <value>The current SynchronizationContext may not be used as a TaskScheduler.</value>
+ </data>
+ <data name="TaskScheduler_InconsistentStateAfterTryExecuteTaskInline" xml:space="preserve">
+ <value>The TryExecuteTaskInline call to the underlying scheduler succeeded, but the task body was not invoked.</value>
+ </data>
+ <data name="TaskSchedulerException_ctor_DefaultMessage" xml:space="preserve">
+ <value>An exception was thrown by a TaskScheduler.</value>
+ </data>
+ <data name="TaskT_ctor_SelfReplicating" xml:space="preserve">
+ <value>It is invalid to specify TaskCreationOptions.SelfReplicating for a Task<TResult>.</value>
+ </data>
+ <data name="TaskT_DebuggerNoResult" xml:space="preserve">
+ <value>{Not yet computed}</value>
+ </data>
+ <data name="TaskT_SetException_HasAnInitializer" xml:space="preserve">
+ <value>A task's Exception may only be set directly if the task was created without a function.</value>
+ </data>
+ <data name="TaskT_TransitionToFinal_AlreadyCompleted" xml:space="preserve">
+ <value>An attempt was made to transition a task to a final state when it had already completed.</value>
+ </data>
+ <data name="Threading_AbandonedMutexException" xml:space="preserve">
+ <value>The wait completed due to an abandoned mutex.</value>
+ </data>
+ <data name="Threading_WaitHandleCannotBeOpenedException" xml:space="preserve">
+ <value>No handle of the given name exists.</value>
+ </data>
+ <data name="Threading_WaitHandleCannotBeOpenedException_InvalidHandle" xml:space="preserve">
+ <value>A WaitHandle with system-wide name '{0}' cannot be created. A WaitHandle of a different type might have the same name.</value>
+ </data>
+ <data name="Threading_WaitHandleTooManyPosts" xml:space="preserve">
+ <value>The WaitHandle cannot be signaled because it would exceed its maximum count.</value>
+ </data>
+ <data name="Threading_SemaphoreFullException" xml:space="preserve">
+ <value>Adding the specified count to the semaphore would cause it to exceed its maximum count.</value>
+ </data>
+ <data name="ThreadLocal_Disposed" xml:space="preserve">
+ <value>The ThreadLocal object has been disposed.</value>
+ </data>
+ <data name="ThreadLocal_Value_RecursiveCallsToValue" xml:space="preserve">
+ <value>ValueFactory attempted to access the Value property of this instance.</value>
+ </data>
+ <data name="ThreadLocal_ValuesNotAvailable" xml:space="preserve">
+ <value>The ThreadLocal object is not tracking values. To use the Values property, use a ThreadLocal constructor that accepts the trackAllValues parameter and set the parameter to true.</value>
+ </data>
+ <data name="ThreadState_NoAbortRequested" xml:space="preserve">
+ <value>Unable to reset abort because no abort was requested.</value>
+ </data>
+ <data name="TimeZoneNotFound_MissingData" xml:space="preserve">
+ <value>The time zone ID '{0}' was not found on the local computer.</value>
+ </data>
+ <data name="TypeInitialization_Default" xml:space="preserve">
+ <value>Type constructor threw an exception.</value>
+ </data>
+ <data name="TypeInitialization_Type" xml:space="preserve">
+ <value>The type initializer for '{0}' threw an exception.</value>
+ </data>
+ <data name="TypeLibConverter_ImportedTypeLibProductName" xml:space="preserve">
+ <value>Assembly imported from type library '{0}'.</value>
+ </data>
+ <data name="TypeLoad_ResolveNestedType" xml:space="preserve">
+ <value>Could not resolve nested type '{0}' in type "{1}'.</value>
+ </data>
+ <data name="TypeLoad_ResolveType" xml:space="preserve">
+ <value>Could not resolve type '{0}'.</value>
+ </data>
+ <data name="TypeLoad_ResolveTypeFromAssembly" xml:space="preserve">
+ <value>Could not resolve type '{0}' in assembly '{1}'.</value>
+ </data>
+ <data name="UnauthorizedAccess_IODenied_NoPathName" xml:space="preserve">
+ <value>Access to the path is denied.</value>
+ </data>
+ <data name="UnauthorizedAccess_IODenied_Path" xml:space="preserve">
+ <value>Access to the path '{0}' is denied.</value>
+ </data>
+ <data name="UnauthorizedAccess_MemStreamBuffer" xml:space="preserve">
+ <value>MemoryStream's internal buffer cannot be accessed.</value>
+ </data>
+ <data name="UnauthorizedAccess_RegistryKeyGeneric_Key" xml:space="preserve">
+ <value>Access to the registry key '{0}' is denied.</value>
+ </data>
+ <data name="UnauthorizedAccess_RegistryNoWrite" xml:space="preserve">
+ <value>Cannot write to the registry key.</value>
+ </data>
+ <data name="UnauthorizedAccess_SystemDomain" xml:space="preserve">
+ <value>Cannot execute an assembly in the system domain.</value>
+ </data>
+ <data name="UnknownError_Num" xml:space="preserve">
+ <value>Unknown error "{0}".</value>
+ </data>
+ <data name="Url_ToString" xml:space="preserve">
+ <value>Url</value>
+ </data>
+ <data name="Verification_Exception" xml:space="preserve">
+ <value>Operation could destabilize the runtime.</value>
+ </data>
+ <data name="WeakReference_NoLongerValid" xml:space="preserve">
+ <value>The weak reference is no longer valid.</value>
+ </data>
+ <data name="Word_At" xml:space="preserve">
+ <value>at</value>
+ </data>
+ <data name="XML_Syntax_InvalidSyntaxInFile" xml:space="preserve">
+ <value>Invalid XML in file '{0}' near element '{1}'.</value>
+ </data>
+ <data name="XMLSyntax_ExpectedCloseBracket" xml:space="preserve">
+ <value>Expected > character.</value>
+ </data>
+ <data name="XMLSyntax_ExpectedSlashOrString" xml:space="preserve">
+ <value>Expected / character or string.</value>
+ </data>
+ <data name="XMLSyntax_InvalidSyntax" xml:space="preserve">
+ <value>Invalid syntax.</value>
+ </data>
+ <data name="XMLSyntax_InvalidSyntaxSatAssemTag" xml:space="preserve">
+ <value>Invalid XML in file "{0}" near element "{1}". The <satelliteassemblies> section only supports <assembly> tags.</value>
+ </data>
+ <data name="XMLSyntax_InvalidSyntaxSatAssemTagBadAttr" xml:space="preserve">
+ <value>Invalid XML in file "{0}" near "{1}" and "{2}". In the <satelliteassemblies> section, the <assembly> tag must have exactly 1 attribute called 'name', whose value is a fully-qualified assembly name.</value>
+ </data>
+ <data name="XMLSyntax_InvalidSyntaxSatAssemTagNoAttr" xml:space="preserve">
+ <value>Invalid XML in file "{0}". In the <satelliteassemblies> section, the <assembly> tag must have exactly 1 attribute called 'name', whose value is a fully-qualified assembly name.</value>
+ </data>
+ <data name="XMLSyntax_SyntaxError" xml:space="preserve">
+ <value>Invalid syntax on line {0}.</value>
+ </data>
+ <data name="XMLSyntax_SyntaxErrorEx" xml:space="preserve">
+ <value>Invalid syntax on line {0} - '{1}'.</value>
+ </data>
+ <data name="XMLSyntax_UnexpectedCloseBracket" xml:space="preserve">
+ <value>Unexpected > character.</value>
+ </data>
+ <data name="XMLSyntax_UnexpectedEndOfFile" xml:space="preserve">
+ <value>Unexpected end of file.</value>
+ </data>
+ <data name="Zone_ToString" xml:space="preserve">
+ <value>Zone - {0}</value>
+ </data>
+</root>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<MajorVersion>4</MajorVersion>
<MinorVersion>6</MinorVersion>
+ <ExcludeAssemblyInfoPartialFile>true</ExcludeAssemblyInfoPartialFile>
</PropertyGroup>
<ItemGroup>
<AssemblyInfoLines Include="[assembly: System.Resources.SatelliteContractVersion("$(AssemblyVersion)")]" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\JapaneseCalendar.Win32.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\TextInfo.Windows.cs" />
</ItemGroup>
- <ItemGroup>
- <Compile Include="$(BclSourcesRoot)\SR.cs" />
- </ItemGroup>
<ItemGroup Condition="'$(FeatureCoreFxGlobalization)' == 'true' and '$(TargetsUnix)' == 'true'">
<Compile Include="$(BclSourcesRoot)\System\Globalization\EncodingTable.Unix.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\EncodingDataItem.Unix.cs" />
<Compile Include="src\System\Runtime\RuntimeImports.cs" />
<Compile Include="src\System\ValueTuple.cs" />
</ItemGroup>
- <!-- Resources -->
- <ItemGroup>
- <SplitTextStringResource Include="$(BclSourcesRoot)\System.Private.CoreLib.txt">
- <ResFile>System.Private.CoreLib</ResFile>
- <ResGenDefines>$(DefineConstants)</ResGenDefines>
- </SplitTextStringResource>
- </ItemGroup>
<Import Project="shared\System.Private.CoreLib.Shared.projitems" Label="Shared" />
<PropertyGroup>
<CheckCDefines Condition="'$(CheckCDefines)'==''">true</CheckCDefines>
<!-- Use a different nativeresource file to avoid conflicts with mscorlib-->
<Win32Resource Condition="'$(GenerateNativeVersionInfo)'=='true'">$(IntermediateOutputPath)\System.Private.CoreLib.res</Win32Resource>
</PropertyGroup>
- <Import Project="GenerateSplitStringResources.targets" />
+ <!-- Import resources tools -->
+ <Import Condition="Exists('$(ToolsDir)\resources.targets')" Project="$(ToolsDir)\resources.targets" />
<Import Project="GenerateCompilerResponseFile.targets" />
</Project>
{
internal static Exception GetStreamIsClosed()
{
- return new ObjectDisposedException(null, SR.ObjectDisposed_StreamIsClosed);
+ return new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
}
internal static Exception GetEndOfFile()
/// </summary>
public IList<string> TransformNames => _transformNames;
}
-}
\ No newline at end of file
+}
None = 0,
RemoveEmptyEntries = 1
}
-}
\ No newline at end of file
+}
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
private static Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> CreateLongRef<T1, T2, T3, T4, T5, T6, T7, TRest>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) where TRest : ITuple =>
new Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>(item1, item2, item3, item4, item5, item6, item7, rest);
}
-}
\ No newline at end of file
+}
BCLDebug.Assert(false, message);
}
}
-}
\ No newline at end of file
+}
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
basekey = Registry.CurrentConfig;
break;
default:
- throw new ArgumentException(Environment.GetResourceString("Arg_RegInvalidKeyName", nameof(keyName)));
+ throw new ArgumentException(SR.Format(SR.Arg_RegInvalidKeyName, nameof(keyName)));
}
if (i == -1 || i == keyName.Length)
{
{
if (options < RegistryValueOptions.None || options > RegistryValueOptions.DoNotExpandEnvironmentNames)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)options), nameof(options));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)options), nameof(options));
}
bool doNotExpand = (options == RegistryValueOptions.DoNotExpandEnvironmentNames);
CheckPermission(RegistryInternalCheck.CheckValueReadPermission, name, false, RegistryKeyPermissionCheck.Default);
}
catch (OverflowException e)
{
- throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e);
+ throw new IOException(SR.Arg_RegGetOverflowBug, e);
}
}
char[] blob = new char[datasize / 2];
}
catch (OverflowException e)
{
- throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e);
+ throw new IOException(SR.Arg_RegGetOverflowBug, e);
}
}
char[] blob = new char[datasize / 2];
}
catch (OverflowException e)
{
- throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e);
+ throw new IOException(SR.Arg_RegGetOverflowBug, e);
}
}
char[] blob = new char[datasize / 2];
}
catch (OverflowException e)
{
- throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e);
+ throw new IOException(SR.Arg_RegGetOverflowBug, e);
}
blob[blob.Length - 1] = (char)0;
}
if (name != null && name.Length > MaxValueLength)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_RegValStrLenBug"));
+ throw new ArgumentException(SR.Arg_RegValStrLenBug);
}
if (!Enum.IsDefined(typeof(RegistryValueKind), valueKind))
- throw new ArgumentException(Environment.GetResourceString("Arg_RegBadKeyKind"), nameof(valueKind));
+ throw new ArgumentException(SR.Arg_RegBadKeyKind, nameof(valueKind));
EnsureWriteable();
else if (value is String[])
return RegistryValueKind.MultiString;
else
- throw new ArgumentException(Environment.GetResourceString("Arg_RegSetBadArrType", value.GetType().Name));
+ throw new ArgumentException(SR.Format(SR.Arg_RegSetBadArrType, value.GetType().Name));
}
else
return RegistryValueKind.String;
{
case Win32Native.ERROR_ACCESS_DENIED:
if (str != null)
- throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_RegistryKeyGeneric_Key", str));
+ throw new UnauthorizedAccessException(SR.Format(SR.UnauthorizedAccess_RegistryKeyGeneric_Key, str));
else
throw new UnauthorizedAccessException();
goto default;
case Win32Native.ERROR_FILE_NOT_FOUND:
- throw new IOException(Environment.GetResourceString("Arg_RegKeyNotFound"), errorCode);
+ throw new IOException(SR.Arg_RegKeyNotFound, errorCode);
default:
throw new IOException(Win32Native.GetMessage(errorCode), errorCode);
//
if (bytes == null || bytes.Length != 44)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidREG_TZI_FORMAT"), nameof(bytes));
+ throw new ArgumentException(SR.Argument_InvalidREG_TZI_FORMAT, nameof(bytes));
}
Bias = BitConverter.ToInt32(bytes, 0);
StandardBias = BitConverter.ToInt32(bytes, 4);
else
{
StringBuilderCache.Release(sb);
- return Environment.GetResourceString("UnknownError_Num", errorCode);
+ return SR.Format(SR.UnknownError_Num, errorCode);
}
}
+++ /dev/null
-using System;
-using System.Globalization;
-
-// CoreFX creates SR in the System namespace. While putting the CoreCLR SR adapter in the root
-// may be unconventional, it allows us to keep the shared code identical.
-
-internal static class SR
-{
- public static string Arg_ArrayZeroError
- {
- get { return Environment.GetResourceString("Arg_ArrayZeroError"); }
- }
-
- public static string Arg_ExternalException
- {
- get { return Environment.GetResourceString("Arg_ExternalException"); }
- }
-
- public static string Arg_HexStyleNotSupported
- {
- get { return Environment.GetResourceString("Arg_HexStyleNotSupported"); }
- }
-
- public static string Arg_InvalidHexStyle
- {
- get { return Environment.GetResourceString("Arg_InvalidHexStyle"); }
- }
-
- public static string Arg_OutOfMemoryException
- {
- get { return Environment.GetResourceString("Arg_OutOfMemoryException"); }
- }
-
- public static string ArgumentNull_Array
- {
- get { return Environment.GetResourceString("ArgumentNull_Array"); }
- }
-
- public static string ArgumentNull_ArrayValue
- {
- get { return Environment.GetResourceString("ArgumentNull_ArrayValue"); }
- }
-
- public static string ArgumentNull_Obj
- {
- get { return Environment.GetResourceString("ArgumentNull_Obj"); }
- }
-
- public static string ArgumentNull_String
- {
- get { return Environment.GetResourceString("ArgumentNull_String"); }
- }
-
- public static string ArgumentOutOfRange_AddValue
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_AddValue"); }
- }
-
- public static string ArgumentOutOfRange_BadHourMinuteSecond
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_BadHourMinuteSecond"); }
- }
-
- public static string ArgumentOutOfRange_BadYearMonthDay
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_BadYearMonthDay"); }
- }
-
- public static string ArgumentOutOfRange_Bounds_Lower_Upper
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper"); }
- }
-
- public static string ArgumentOutOfRange_CalendarRange
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_CalendarRange"); }
- }
-
- public static string ArgumentOutOfRange_Count
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_Count"); }
- }
-
- public static string ArgumentOutOfRange_Day
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_Day"); }
- }
-
- public static string ArgumentOutOfRange_Enum
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_Enum"); }
- }
-
- public static string ArgumentOutOfRange_Era
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_Era"); }
- }
-
- public static string ArgumentOutOfRange_Index
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_Index"); }
- }
-
- public static string ArgumentOutOfRange_IndexCountBuffer
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"); }
- }
-
- public static string ArgumentOutOfRange_InvalidEraValue
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"); }
- }
-
- public static string ArgumentOutOfRange_Month
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_Month"); }
- }
-
- public static string ArgumentOutOfRange_NeedNonNegNum
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"); }
- }
-
- public static string ArgumentOutOfRange_NeedPosNum
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"); }
- }
-
- public static string Arg_ArgumentOutOfRangeException
- {
- get { return Environment.GetResourceString("Arg_ArgumentOutOfRangeException"); }
- }
-
- public static string ArgumentOutOfRange_OffsetLength
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_OffsetLength"); }
- }
-
- public static string ArgumentOutOfRange_Range
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_Range"); }
- }
-
- public static string Argument_CompareOptionOrdinal
- {
- get { return Environment.GetResourceString("Argument_CompareOptionOrdinal"); }
- }
-
- public static string Argument_ConflictingDateTimeRoundtripStyles
- {
- get { return Environment.GetResourceString("Argument_ConflictingDateTimeRoundtripStyles"); }
- }
-
- public static string Argument_ConflictingDateTimeStyles
- {
- get { return Environment.GetResourceString("Argument_ConflictingDateTimeStyles"); }
- }
-
- public static string Argument_CultureIetfNotSupported
- {
- get { return Environment.GetResourceString("Argument_CultureIetfNotSupported"); }
- }
-
- public static string Argument_CultureInvalidIdentifier
- {
- get { return Environment.GetResourceString("Argument_CultureInvalidIdentifier"); }
- }
-
- public static string Argument_CultureNotSupported
- {
- get { return Environment.GetResourceString("Argument_CultureNotSupported"); }
- }
-
- public static string Argument_CultureIsNeutral
- {
- get { return Environment.GetResourceString("Argument_CultureIsNeutral"); }
- }
-
- public static string Argument_CustomCultureCannotBePassedByNumber
- {
- get { return Environment.GetResourceString("Argument_CustomCultureCannotBePassedByNumber"); }
- }
-
- public static string Argument_EmptyDecString
- {
- get { return Environment.GetResourceString("Argument_EmptyDecString"); }
- }
-
- public static string Argument_IdnBadBidi
- {
- get { return Environment.GetResourceString("Argument_IdnBadBidi"); }
- }
-
- public static string Argument_IdnBadLabelSize
- {
- get { return Environment.GetResourceString("Argument_IdnBadLabelSize"); }
- }
-
- public static string Argument_IdnBadNameSize
- {
- get { return Environment.GetResourceString("Argument_IdnBadNameSize"); }
- }
-
- public static string Argument_IdnBadPunycode
- {
- get { return Environment.GetResourceString("Argument_IdnBadPunycode"); }
- }
-
- public static string Argument_IdnBadStd3
- {
- get { return Environment.GetResourceString("Argument_IdnBadStd3"); }
- }
-
- public static string Argument_IdnIllegalName
- {
- get { return Environment.GetResourceString("Argument_IdnIllegalName"); }
- }
-
- public static string Argument_InvalidArrayLength
- {
- get { return Environment.GetResourceString("Argument_InvalidArrayLength"); }
- }
-
- public static string Argument_InvalidCalendar
- {
- get { return Environment.GetResourceString("Argument_InvalidCalendar"); }
- }
-
- public static string Argument_InvalidCharSequence
- {
- get { return Environment.GetResourceString("Argument_InvalidCharSequence"); }
- }
-
- public static string Argument_InvalidCharSequenceNoIndex
- {
- get { return Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"); }
- }
-
- public static string Argument_InvalidCultureName
- {
- get { return Environment.GetResourceString("Argument_InvalidCultureName"); }
- }
-
- public static string Argument_InvalidDateTimeStyles
- {
- get { return Environment.GetResourceString("Argument_InvalidDateTimeStyles"); }
- }
-
- public static string Argument_InvalidDigitSubstitution
- {
- get { return Environment.GetResourceString("Argument_InvalidDigitSubstitution"); }
- }
-
- public static string Argument_InvalidFlag
- {
- get { return Environment.GetResourceString("Argument_InvalidFlag"); }
- }
-
- public static string Argument_InvalidGroupSize
- {
- get { return Environment.GetResourceString("Argument_InvalidGroupSize"); }
- }
-
- public static string Argument_InvalidNativeDigitCount
- {
- get { return Environment.GetResourceString("Argument_InvalidNativeDigitCount"); }
- }
-
- public static string Argument_InvalidNativeDigitValue
- {
- get { return Environment.GetResourceString("Argument_InvalidNativeDigitValue"); }
- }
-
- public static string Argument_InvalidNeutralRegionName
- {
- get { return Environment.GetResourceString("Argument_InvalidNeutralRegionName"); }
- }
-
- public static string Argument_InvalidNumberStyles
- {
- get { return Environment.GetResourceString("Argument_InvalidNumberStyles"); }
- }
-
- public static string Argument_InvalidResourceCultureName
- {
- get { return Environment.GetResourceString("Argument_InvalidResourceCultureName"); }
- }
-
- public static string Argument_NoEra
- {
- get { return Environment.GetResourceString("Argument_NoEra"); }
- }
-
- public static string Argument_NoRegionInvariantCulture
- {
- get { return Environment.GetResourceString("Argument_NoRegionInvariantCulture"); }
- }
-
- public static string Argument_OneOfCulturesNotSupported
- {
- get { return Environment.GetResourceString("Argument_OneOfCulturesNotSupported"); }
- }
-
- public static string Argument_OnlyMscorlib
- {
- get { return Environment.GetResourceString("Argument_OnlyMscorlib"); }
- }
-
- public static string Argument_ResultCalendarRange
- {
- get { return Environment.GetResourceString("Argument_ResultCalendarRange"); }
- }
-
- public static string Format_BadFormatSpecifier
- {
- get { return Environment.GetResourceString("Format_BadFormatSpecifier"); }
- }
-
- public static string InvalidOperation_DateTimeParsing
- {
- get { return Environment.GetResourceString("InvalidOperation_DateTimeParsing"); }
- }
-
- public static string InvalidOperation_EnumEnded
- {
- get { return Environment.GetResourceString("InvalidOperation_EnumEnded"); }
- }
-
- public static string InvalidOperation_EnumNotStarted
- {
- get { return Environment.GetResourceString("InvalidOperation_EnumNotStarted"); }
- }
-
- public static string InvalidOperation_ReadOnly
- {
- get { return Environment.GetResourceString("InvalidOperation_ReadOnly"); }
- }
-
- public static string Overflow_TimeSpanTooLong
- {
- get { return Environment.GetResourceString("Overflow_TimeSpanTooLong"); }
- }
-
- public static string Serialization_MemberOutOfRange
- {
- get { return Environment.GetResourceString("Serialization_MemberOutOfRange"); }
- }
-
- public static string Arg_InvalidHandle
- {
- get { return Environment.GetResourceString("Arg_InvalidHandle"); }
- }
-
- public static string ObjectDisposed_FileClosed
- {
- get { return Environment.GetResourceString("ObjectDisposed_FileClosed"); }
- }
-
- public static string Arg_HandleNotAsync
- {
- get { return Environment.GetResourceString("Arg_HandleNotAsync"); }
- }
-
- public static string ArgumentNull_Path
- {
- get { return Environment.GetResourceString("ArgumentNull_Path"); }
- }
-
- public static string Argument_EmptyPath
- {
- get { return Environment.GetResourceString("Argument_EmptyPath"); }
- }
-
- public static string Argument_InvalidFileModeAndAccessCombo
- {
- get { return Environment.GetResourceString("Argument_InvalidFileMode&AccessCombo"); }
- }
-
- public static string Argument_InvalidAppendMode
- {
- get { return Environment.GetResourceString("Argument_InvalidAppendMode"); }
- }
-
- public static string ArgumentNull_Buffer
- {
- get { return Environment.GetResourceString("ArgumentNull_Buffer"); }
- }
-
- public static string Argument_InvalidOffLen
- {
- get { return Environment.GetResourceString("Argument_InvalidOffLen"); }
- }
-
- public static string IO_UnknownFileName
- {
- get { return Environment.GetResourceString("IO_UnknownFileName"); }
- }
-
- public static string IO_FileStreamHandlePosition
- {
- get { return Environment.GetResourceString("IO.IO_FileStreamHandlePosition"); }
- }
-
- public static string NotSupported_FileStreamOnNonFiles
- {
- get { return Environment.GetResourceString("NotSupported_FileStreamOnNonFiles"); }
- }
-
- public static string IO_BindHandleFailed
- {
- get { return Environment.GetResourceString("IO.IO_BindHandleFailed"); }
- }
-
- public static string Arg_HandleNotSync
- {
- get { return Environment.GetResourceString("Arg_HandleNotSync"); }
- }
-
- public static string IO_SetLengthAppendTruncate
- {
- get { return Environment.GetResourceString("IO.IO_SetLengthAppendTruncate"); }
- }
-
- public static string ArgumentOutOfRange_FileLengthTooBig
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_FileLengthTooBig"); }
- }
-
- public static string Argument_InvalidSeekOrigin
- {
- get { return Environment.GetResourceString("Argument_InvalidSeekOrigin"); }
- }
-
- public static string IO_SeekAppendOverwrite
- {
- get { return Environment.GetResourceString("IO.IO_SeekAppendOverwrite"); }
- }
-
- public static string IO_FileTooLongOrHandleNotSync
- {
- get { return Environment.GetResourceString("IO_FileTooLongOrHandleNotSync"); }
- }
-
- public static string IndexOutOfRange_IORaceCondition
- {
- get { return Environment.GetResourceString("IndexOutOfRange_IORaceCondition"); }
- }
-
- public static string IO_FileNotFound
- {
- get { return Environment.GetResourceString("IO.FileNotFound"); }
- }
-
- public static string IO_FileNotFound_FileName
- {
- get { return Environment.GetResourceString("IO.FileNotFound_FileName"); }
- }
-
- public static string IO_PathNotFound_NoPathName
- {
- get { return Environment.GetResourceString("IO.PathNotFound_NoPathName"); }
- }
-
- public static string IO_PathNotFound_Path
- {
- get { return Environment.GetResourceString("IO.PathNotFound_Path"); }
- }
-
- public static string UnauthorizedAccess_IODenied_NoPathName
- {
- get { return Environment.GetResourceString("UnauthorizedAccess_IODenied_NoPathName"); }
- }
-
- public static string UnauthorizedAccess_IODenied_Path
- {
- get { return Environment.GetResourceString("UnauthorizedAccess_IODenied_Path"); }
- }
-
- public static string IO_AlreadyExists_Name
- {
- get { return Environment.GetResourceString("IO.IO_AlreadyExists_Name"); }
- }
-
- public static string IO_PathTooLong
- {
- get { return Environment.GetResourceString("IO.PathTooLong"); }
- }
-
- public static string IO_SharingViolation_NoFileName
- {
- get { return Environment.GetResourceString("IO.IO_SharingViolation_NoFileName"); }
- }
-
- public static string IO_SharingViolation_File
- {
- get { return Environment.GetResourceString("IO.IO_SharingViolation_File"); }
- }
-
- public static string IO_FileExists_Name
- {
- get { return Environment.GetResourceString("IO.IO_FileExists_Name"); }
- }
-
- public static string NotSupported_UnwritableStream
- {
- get { return Environment.GetResourceString("NotSupported_UnwritableStream"); }
- }
-
- public static string NotSupported_UnreadableStream
- {
- get { return Environment.GetResourceString("NotSupported_UnreadableStream"); }
- }
-
- public static string NotSupported_UnseekableStream
- {
- get { return Environment.GetResourceString("NotSupported_UnseekableStream"); }
- }
-
- public static string IO_EOF_ReadBeyondEOF
- {
- get { return Environment.GetResourceString("IO.EOF_ReadBeyondEOF"); }
- }
-
- public static string Argument_InvalidHandle
- {
- get { return Environment.GetResourceString("Argument_InvalidHandle"); }
- }
-
- public static string Argument_AlreadyBoundOrSyncHandle
- {
- get { return Environment.GetResourceString("Argument_AlreadyBoundOrSyncHandle"); }
- }
-
- public static string Argument_PreAllocatedAlreadyAllocated
- {
- get { return Environment.GetResourceString("Argument_PreAllocatedAlreadyAllocated"); }
- }
-
- public static string Argument_NativeOverlappedAlreadyFree
- {
- get { return Environment.GetResourceString("Argument_NativeOverlappedAlreadyFree"); }
- }
-
- public static string Argument_NativeOverlappedWrongBoundHandle
- {
- get { return Environment.GetResourceString("Argument_NativeOverlappedWrongBoundHandle"); }
- }
-
- public static string InvalidOperation_NativeOverlappedReused
- {
- get { return Environment.GetResourceString("InvalidOperation_NativeOverlappedReused"); }
- }
-
- public static string ArgumentOutOfRange_Length
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_Length"); }
- }
-
- public static string ArgumentOutOfRange_IndexString
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_IndexString"); }
- }
-
- public static string ArgumentOutOfRange_Capacity
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_Capacity"); }
- }
-
- public static string Arg_CryptographyException
- {
- get { return Environment.GetResourceString("Arg_CryptographyException"); }
- }
-
- public static string ArgumentException_BufferNotFromPool
- {
- get { return Environment.GetResourceString("ArgumentException_BufferNotFromPool"); }
- }
-
- public static string Argument_InvalidPathChars
- {
- get { return Environment.GetResourceString("Argument_InvalidPathChars"); }
- }
-
- public static string Argument_PathFormatNotSupported
- {
- get { return Environment.GetResourceString("Argument_PathFormatNotSupported"); }
- }
-
- public static string Arg_PathIllegal
- {
- get { return Environment.GetResourceString("Arg_PathIllegal"); }
- }
-
- public static string Arg_PathIllegalUNC
- {
- get { return Environment.GetResourceString("Arg_PathIllegalUNC"); }
- }
-
- public static string Arg_InvalidSearchPattern
- {
- get { return Environment.GetResourceString("Arg_InvalidSearchPattern"); }
- }
-
- public static string InvalidOperation_Cryptography
- {
- get { return Environment.GetResourceString("InvalidOperation_Cryptography"); }
- }
-
- public static string Format(string formatString, params object[] args)
- {
- return string.Format(CultureInfo.CurrentCulture, formatString, args);
- }
-
- internal static string ArgumentException_ValueTupleIncorrectType
- {
- get { return Environment.GetResourceString("ArgumentException_ValueTupleIncorrectType"); }
- }
-
- internal static string ArgumentException_ValueTupleLastArgumentNotATuple
- {
- get { return Environment.GetResourceString("ArgumentException_ValueTupleLastArgumentNotATuple"); }
- }
-
- internal static string SpinLock_TryEnter_ArgumentOutOfRange
- {
- get { return Environment.GetResourceString("SpinLock_TryEnter_ArgumentOutOfRange"); }
- }
-
- internal static string SpinLock_TryReliableEnter_ArgumentException
- {
- get { return Environment.GetResourceString("SpinLock_TryReliableEnter_ArgumentException"); }
- }
-
- internal static string SpinLock_TryEnter_LockRecursionException
- {
- get { return Environment.GetResourceString("SpinLock_TryEnter_LockRecursionException"); }
- }
-
- internal static string SpinLock_Exit_SynchronizationLockException
- {
- get { return Environment.GetResourceString("SpinLock_Exit_SynchronizationLockException"); }
- }
-
- internal static string SpinLock_IsHeldByCurrentThread
- {
- get { return Environment.GetResourceString("SpinLock_IsHeldByCurrentThread"); }
- }
-
- internal static string ObjectDisposed_StreamIsClosed
- {
- get { return Environment.GetResourceString("ObjectDisposed_StreamIsClosed"); }
- }
-
- internal static string Arg_SystemException
- {
- get { return Environment.GetResourceString("Arg_SystemException"); }
- }
-
- internal static string Arg_StackOverflowException
- {
- get { return Environment.GetResourceString("Arg_StackOverflowException"); }
- }
-
- internal static string Arg_DataMisalignedException
- {
- get { return Environment.GetResourceString("Arg_DataMisalignedException"); }
- }
-
- internal static string Arg_ExecutionEngineException
- {
- get { return Environment.GetResourceString("Arg_ExecutionEngineException"); }
- }
-
- internal static string Arg_AccessException
- {
- get { return Environment.GetResourceString("Arg_AccessException"); }
- }
-
- internal static string Arg_AccessViolationException
- {
- get { return Environment.GetResourceString("Arg_AccessViolationException"); }
- }
-
- internal static string Arg_ApplicationException
- {
- get { return Environment.GetResourceString("Arg_ApplicationException"); }
- }
-
- internal static string Arg_ArgumentException
- {
- get { return Environment.GetResourceString("Arg_ArgumentException"); }
- }
-
- internal static string Arg_ParamName_Name
- {
- get { return Environment.GetResourceString("Arg_ParamName_Name"); }
- }
-
- internal static string ArgumentNull_Generic
- {
- get { return Environment.GetResourceString("ArgumentNull_Generic"); }
- }
-
- internal static string Arg_ArithmeticException
- {
- get { return Environment.GetResourceString("Arg_ArithmeticException"); }
- }
-
- internal static string Arg_ArrayTypeMismatchException
- {
- get { return Environment.GetResourceString("Arg_ArrayTypeMismatchException"); }
- }
-
- internal static string Arg_DivideByZero
- {
- get { return Environment.GetResourceString("Arg_DivideByZero"); }
- }
-
- internal static string Arg_DuplicateWaitObjectException
- {
- get { return Environment.GetResourceString("Arg_DuplicateWaitObjectException"); }
- }
-
- internal static string Arg_EntryPointNotFoundException
- {
- get { return Environment.GetResourceString("Arg_EntryPointNotFoundException"); }
- }
-
- internal static string Arg_FieldAccessException
- {
- get { return Environment.GetResourceString("Arg_FieldAccessException"); }
- }
-
- internal static string Arg_FormatException
- {
- get { return Environment.GetResourceString("Arg_FormatException"); }
- }
-
- internal static string Arg_IndexOutOfRangeException
- {
- get { return Environment.GetResourceString("Arg_IndexOutOfRangeException"); }
- }
-
- internal static string Arg_InsufficientExecutionStackException
- {
- get { return Environment.GetResourceString("Arg_InsufficientExecutionStackException"); }
- }
-
- internal static string Arg_InvalidCastException
- {
- get { return Environment.GetResourceString("Arg_InvalidCastException"); }
- }
-
- internal static string Arg_InvalidOperationException
- {
- get { return Environment.GetResourceString("Arg_InvalidOperationException"); }
- }
-
- internal static string InvalidProgram_Default
- {
- get { return Environment.GetResourceString("InvalidProgram_Default"); }
- }
-
- internal static string Arg_MethodAccessException
- {
- get { return Environment.GetResourceString("Arg_MethodAccessException"); }
- }
-
- internal static string Arg_MulticastNotSupportedException
- {
- get { return Environment.GetResourceString("Arg_MulticastNotSupportedException"); }
- }
-
- internal static string Arg_NotFiniteNumberException
- {
- get { return Environment.GetResourceString("Arg_NotFiniteNumberException"); }
- }
-
- internal static string Arg_NotImplementedException
- {
- get { return Environment.GetResourceString("Arg_NotImplementedException"); }
- }
-
- internal static string Arg_NotSupportedException
- {
- get { return Environment.GetResourceString("Arg_NotSupportedException"); }
- }
-
- internal static string Arg_NullReferenceException
- {
- get { return Environment.GetResourceString("Arg_NullReferenceException"); }
- }
-
- internal static string ObjectDisposed_Generic
- {
- get { return Environment.GetResourceString("ObjectDisposed_Generic"); }
- }
-
- internal static string ObjectDisposed_ObjectName_Name
- {
- get { return Environment.GetResourceString("ObjectDisposed_ObjectName_Name"); }
- }
-
- internal static string Arg_OverflowException
- {
- get { return Environment.GetResourceString("Arg_OverflowException"); }
- }
-
- internal static string Arg_PlatformNotSupported
- {
- get { return Environment.GetResourceString("Arg_PlatformNotSupported"); }
- }
-
- internal static string Arg_RankException
- {
- get { return Environment.GetResourceString("Arg_RankException"); }
- }
-
- internal static string Arg_TimeoutException
- {
- get { return Environment.GetResourceString("Arg_TimeoutException"); }
- }
-
- internal static string Arg_TypeAccessException
- {
- get { return Environment.GetResourceString("Arg_TypeAccessException"); }
- }
-
- internal static string TypeInitialization_Default
- {
- get { return Environment.GetResourceString("TypeInitialization_Default"); }
- }
-
- internal static string TypeInitialization_Type
- {
- get { return Environment.GetResourceString("TypeInitialization_Type"); }
- }
-
- internal static string Arg_UnauthorizedAccessException
- {
- get { return Environment.GetResourceString("Arg_UnauthorizedAccessException"); }
- }
-
- internal static string ArgumentOutOfRange_GenericPositive
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"); }
- }
-
- internal static string ArgumentOutOfRange_LengthTooLarge
- {
- get { return Environment.GetResourceString("ArgumentOutOfRange_LengthTooLarge"); }
- }
-
- internal static string Arg_ArrayPlusOffTooSmall
- {
- get { return Environment.GetResourceString("Arg_ArrayPlusOffTooSmall"); }
- }
-
- internal static string Arg_KeyNotFound =>
- Environment.GetResourceString("Arg_KeyNotFound");
-
- internal static string PlatformNotSupported_OSXFileLocking =>
- Environment.GetResourceString("PlatformNotSupported_OSXFileLocking");
-
- internal static string UnknownError_Num
- {
- get { return Environment.GetResourceString("UnknownError_Num"); }
- }
-
- internal static string Lazy_ctor_ModeInvalid
- {
- get { return Environment.GetResourceString("Lazy_ctor_ModeInvalid"); }
- }
-
- internal static string Lazy_Value_RecursiveCallsToValue
- {
- get { return Environment.GetResourceString("Lazy_Value_RecursiveCallsToValue"); }
- }
-
- internal static string Lazy_CreateValue_NoParameterlessCtorForT
- {
- get { return Environment.GetResourceString("Lazy_CreateValue_NoParameterlessCtorForT"); }
- }
-
- internal static string Lazy_ToString_ValueNotCreated
- {
- get { return Environment.GetResourceString("Lazy_ToString_ValueNotCreated"); }
- }
-
- internal static string Serialization_NonSerType
- {
- get { return Environment.GetResourceString("Serialization_NonSerType"); }
- }
-
-
- internal static string NotSupported_SubclassOverride
- {
- get { return Environment.GetResourceString("NotSupported_SubclassOverride"); }
- }
-
- internal static string InvalidCast_IConvertible =>
- Environment.GetResourceString("InvalidCast_IConvertible");
-
- internal static string InvalidCast_DBNull =>
- Environment.GetResourceString("InvalidCast_DBNull");
-
- internal static string InvalidCast_Empty =>
- Environment.GetResourceString("InvalidCast_Empty");
-
- internal static string InvalidCast_FromTo =>
- Environment.GetResourceString("InvalidCast_FromTo");
-
- internal static string Arg_UnknownTypeCode =>
- Environment.GetResourceString("Arg_UnknownTypeCode");
-
- internal static string InvalidCast_CannotCastNullToValueType =>
- Environment.GetResourceString("InvalidCast_CannotCastNullToValueType");
-
- internal static string Overflow_Char =>
- Environment.GetResourceString("Overflow_Char");
-
- internal static string Overflow_Byte =>
- Environment.GetResourceString("Overflow_Byte");
-
- internal static string Overflow_SByte =>
- Environment.GetResourceString("Overflow_SByte");
-
- internal static string Overflow_Int16 =>
- Environment.GetResourceString("Overflow_Int16");
-
- internal static string Overflow_UInt16 =>
- Environment.GetResourceString("Overflow_UInt16");
-
- internal static string Overflow_Int32 =>
- Environment.GetResourceString("Overflow_Int32");
-
- internal static string Overflow_UInt32 =>
- Environment.GetResourceString("Overflow_UInt32");
-
- internal static string Overflow_Int64 =>
- Environment.GetResourceString("Overflow_Int64");
-
- internal static string Overflow_UInt64 =>
- Environment.GetResourceString("Overflow_UInt64");
-
- internal static string Arg_InvalidBase =>
- Environment.GetResourceString("Arg_InvalidBase");
-
- internal static string ArgumentOutOfRange_OffsetOut =>
- Environment.GetResourceString("ArgumentOutOfRange_OffsetOut");
-
- internal static string Format_BadBase64Char =>
- Environment.GetResourceString("Format_BadBase64Char");
-
- internal static string Format_BadBase64CharArrayLength =>
- Environment.GetResourceString("Format_BadBase64CharArrayLength");
-
- internal static string Format_NeedSingleChar =>
- Environment.GetResourceString("Format_BadBase64CharArrayLength");
-
- internal static string Arg_EnumIllegalVal =>
- Environment.GetResourceString("Arg_EnumIllegalVal");
-
- internal static string InvalidOperation_NoPublicAddMethod =>
- Environment.GetResourceString("InvalidOperation_NoPublicAddMethod");
-
- internal static string InvalidOperation_NoPublicRemoveMethod =>
- Environment.GetResourceString("InvalidOperation_NoPublicRemoveMethod");
-
- internal static string InvalidOperation_NotSupportedOnWinRTEvent =>
- Environment.GetResourceString("InvalidOperation_NotSupportedOnWinRTEvent");
-
- internal static string NotSupported_AbstractNonCLS =>
- Environment.GetResourceString("NotSupported_AbstractNonCLS");
-
- internal static string Serialization_InsufficientState =>
- Environment.GetResourceString("Serialization_InsufficientState");
-
- internal static string Serialization_BadParameterInfo =>
- Environment.GetResourceString("Serialization_BadParameterInfo");
-
- internal static string Serialization_NoParameterInfo =>
- Environment.GetResourceString("Serialization_NoParameterInfo");
-
- internal static string InvalidFilterCriteriaException_CritString =>
- Environment.GetResourceString("InvalidFilterCriteriaException_CritString");
-
- internal static string NotSupported_NoTypeInfo =>
- Environment.GetResourceString("NotSupported_NoTypeInfo");
-
- internal static string PlatformNotSupported_ReflectionOnly =>
- Environment.GetResourceString("PlatformNotSupported_ReflectionOnly");
-
- internal static string Arg_EnumAndObjectMustBeSameType =>
- Environment.GetResourceString("Arg_EnumAndObjectMustBeSameType");
-
- internal static string Arg_EnumUnderlyingTypeAndObjectMustBeSameType =>
- Environment.GetResourceString("Arg_EnumUnderlyingTypeAndObjectMustBeSameType");
-
- internal static string Arg_MustBeEnum =>
- Environment.GetResourceString("Arg_MustBeEnum");
-
- internal static string Arg_MustBeEnumBaseTypeOrEnum =>
- Environment.GetResourceString("Arg_MustBeEnumBaseTypeOrEnum");
-
- internal static string Arg_NotGenericParameter =>
- Environment.GetResourceString("Arg_NotGenericParameter");
-
- internal static string Argument_InvalidEnum =>
- Environment.GetResourceString("Argument_InvalidEnum");
-
- internal static string InvalidFilterCriteriaException_CritInt =>
- Environment.GetResourceString("InvalidFilterCriteriaException_CritInt");
-
- internal static string InvalidOperation_UnknownEnumType =>
- Environment.GetResourceString("InvalidOperation_UnknownEnumType");
-
- internal static string Arg_SecurityException =>
- Environment.GetResourceString("Arg_SecurityException");
-}
+++ /dev/null
-; Licensed to the .NET Foundation under one or more agreements.
-; The .NET Foundation licenses this file to you under the MIT license.
-; See the LICENSE file in the project root for more information.
-
-; These are the managed resources for mscorlib.dll.
-; See those first three bytes in the file? This is in UTF-8. Leave the
-; Unicode byte order mark (U+FEFF) written in UTF-8 at the start of this file.
-
-; For resource info, see the ResourceManager documentation and the ResGen tool,
-; which is a managed app using ResourceWriter.
-; ResGen now supports limited preprocessing of txt files, you can use
-; #if SYMBOL and #if !SYMBOL to control what sets of resources are included in
-; the resulting resources.
-
-; The naming scheme is: [Namespace.] ExceptionName _ Reason
-; We'll suppress "System." where possible.
-; Examples:
-; Argument_Null
-; Reflection.TargetInvokation_someReason
-
-; Usage Notes:
-; * Keep exceptions in alphabetical order by package
-; * A single space may exist on either side of the equal sign.
-; * Follow the naming conventions.
-; * Any lines starting with a '#' or ';' are ignored
-; * Equal signs aren't legal characters for keys, but may occur in values.
-; * Correctly punctuate all sentences. Most resources should end in a period.
-; Remember, your mother will probably read some of these messages.
-; * You may use " (quote), \n and \t. Use \\ for a single '\' character.
-; * String inserts work. i.e., BadNumber_File = Wrong number in file "{0}".
-
-; Real words, used by code like Environment.StackTrace
-#if INCLUDE_RUNTIME
-Word_At = at
-StackTrace_InFileLineNumber = in {0}:line {1}
-UnknownError_Num = Unknown error "{0}".
-AllocatedFrom = Allocated from:
-
-; Note this one is special, used as a divider between stack traces!
-Exception_EndOfInnerExceptionStack = --- End of inner exception stack trace ---
-Exception_WasThrown = Exception of type '{0}' was thrown.
-
-; The following are used in the implementation of ExceptionDispatchInfo
-Exception_EndStackTraceFromPreviousThrow = --- End of stack trace from previous location where exception was thrown ---
-
-Arg_ParamName_Name = Parameter name: {0}
-ArgumentOutOfRange_ActualValue = Actual value was {0}.
-
-NoDebugResources = [{0}]\r\nArguments: {1}\r\nDebugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version={2}&File={3}&Key={4}
-#endif // INCLUDE_RUNTIME
-
-#if INCLUDE_DEBUG
-
-; For code contracts
-AssumptionFailed = Assumption failed.
-AssumptionFailed_Cnd = Assumption failed: {0}
-AssertionFailed = Assertion failed.
-AssertionFailed_Cnd = Assertion failed: {0}
-PreconditionFailed = Precondition failed.
-PreconditionFailed_Cnd = Precondition failed: {0}
-PostconditionFailed = Postcondition failed.
-PostconditionFailed_Cnd = Postcondition failed: {0}
-PostconditionOnExceptionFailed = Postcondition failed after throwing an exception.
-PostconditionOnExceptionFailed_Cnd = Postcondition failed after throwing an exception: {0}
-InvariantFailed = Invariant failed.
-InvariantFailed_Cnd = Invariant failed: {0}
-MustUseCCRewrite = An assembly (probably "{1}") must be rewritten using the code contracts binary rewriter (CCRewrite) because it is calling Contract.{0} and the CONTRACTS_FULL symbol is defined. Remove any explicit definitions of the CONTRACTS_FULL symbol from your project and rebuild. CCRewrite can be downloaded from http://go.microsoft.com/fwlink/?LinkID=169180. \r\nAfter the rewriter is installed, it can be enabled in Visual Studio from the project's Properties page on the Code Contracts pane. Ensure that "Perform Runtime Contract Checking" is enabled, which will define CONTRACTS_FULL.
-
-; AccessException
-Acc_CreateGeneric = Cannot create a type for which Type.ContainsGenericParameters is true.
-Acc_CreateAbst = Cannot create an abstract class.
-Acc_CreateInterface = Cannot create an instance of an interface.
-Acc_NotClassInit = Type initializer was not callable.
-Acc_CreateGenericEx = Cannot create an instance of {0} because Type.ContainsGenericParameters is true.
-Acc_CreateArgIterator = Cannot dynamically create an instance of ArgIterator.
-Acc_CreateAbstEx = Cannot create an instance of {0} because it is an abstract class.
-Acc_CreateInterfaceEx = Cannot create an instance of {0} because it is an interface.
-Acc_CreateVoid = Cannot dynamically create an instance of System.Void.
-Acc_ReadOnly = Cannot set a constant field.
-Acc_RvaStatic = SkipVerification permission is needed to modify an image-based (RVA) static field.
-Access_Void = Cannot create an instance of void.
-
-; ArgumentException
-Arg_TypedReference_Null = The TypedReference must be initialized.
-Argument_AddingDuplicate__ = Item has already been added. Key in dictionary: '{0}' Key being added: '{1}'
-Argument_AddingDuplicate = An item with the same key has already been added.
-Argument_AddingDuplicateWithKey = An item with the same key has already been added. Key: {0}
-Argument_MethodDeclaringTypeGenericLcg = Method '{0}' has a generic declaring type '{1}'. Explicitly provide the declaring type to GetTokenFor.
-Argument_MethodDeclaringTypeGeneric = Cannot resolve method {0} because the declaring type of the method handle {1} is generic. Explicitly provide the declaring type to GetMethodFromHandle.
-Argument_FieldDeclaringTypeGeneric = Cannot resolve field {0} because the declaring type of the field handle {1} is generic. Explicitly provide the declaring type to GetFieldFromHandle.
-Argument_ApplicationTrustShouldHaveIdentity = An ApplicationTrust must have an application identity before it can be persisted.
-Argument_ConversionOverflow = Conversion buffer overflow.
-Argument_CodepageNotSupported = {0} is not a supported code page.
-Argument_CultureNotSupported = Culture is not supported.
-Argument_CultureInvalidIdentifier = {0} is an invalid culture identifier.
-Argument_OneOfCulturesNotSupported = Culture name {0} or {1} is not supported.
-Argument_CultureIetfNotSupported = Culture IETF Name {0} is not a recognized IETF name.
-Argument_CultureIsNeutral = Culture ID {0} (0x{0:X4}) is a neutral culture; a region cannot be created from it.
-Argument_InvalidNeutralRegionName = The region name {0} should not correspond to neutral culture; a specific culture name is required.
-Argument_InvalidGenericInstArray = Generic arguments must be provided for each generic parameter and each generic argument must be a RuntimeType.
-Argument_GenericArgsCount = The number of generic arguments provided doesn't equal the arity of the generic type definition.
-Argument_CultureInvalidFormat = Culture '{0}' is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture.
-Argument_CompareOptionOrdinal = CompareOption.Ordinal cannot be used with other options.
-Argument_CustomCultureCannotBePassedByNumber = Customized cultures cannot be passed by LCID, only by name.
-Argument_EncodingConversionOverflowChars = The output char buffer is too small to contain the decoded characters, encoding '{0}' fallback '{1}'.
-Argument_EncodingConversionOverflowBytes = The output byte buffer is too small to contain the encoded data, encoding '{0}' fallback '{1}'.
-Argument_EncoderFallbackNotEmpty = Must complete Convert() operation or call Encoder.Reset() before calling GetBytes() or GetByteCount(). Encoder '{0}' fallback '{1}'.
-Argument_EmptyFileName = Empty file name is not legal.
-Argument_EmptyPath = Empty path name is not legal.
-Argument_EmptyName = Empty name is not legal.
-Argument_ImplementIComparable = At least one object must implement IComparable.
-Argument_InvalidType = The type of arguments passed into generic comparer methods is invalid.
-Argument_InvalidTypeForCA=Cannot build type parameter for custom attribute with a type that does not support the AssemblyQualifiedName property. The type instance supplied was of type '{0}'.
-Argument_IllegalEnvVarName = Environment variable name cannot contain equal character.
-Argument_IllegalAppId = Application identity does not have same number of components as manifest paths.
-Argument_IllegalAppBase = The application base specified is not valid.
-Argument_UnableToParseManifest = Unexpected error while parsing the specified manifest.
-Argument_IllegalAppIdMismatch = Application identity does not match identities in manifests.
-Argument_InvalidAppId = Invalid identity: no deployment or application identity specified.
-Argument_InvalidGenericArg = The generic type parameter was not valid
-Argument_InvalidArrayLength = Length of the array must be {0}.
-Argument_InvalidArrayType = Target array type is not compatible with the type of items in the collection.
-Argument_InvalidAppendMode = Append access can be requested only in write-only mode.
-Argument_InvalidEnumValue = The value '{0}' is not valid for this usage of the type {1}.
-Argument_EnumIsNotIntOrShort = The underlying type of enum argument must be Int32 or Int16.
-Argument_InvalidEnum = The Enum type should contain one and only one instance field.
-Argument_InvalidKeyStore = '{0}' is not a valid KeyStore name.
-Argument_InvalidFileMode&AccessCombo = Combining FileMode: {0} with FileAccess: {1} is invalid.
-Argument_InvalidFileMode&RightsCombo = Combining FileMode: {0} with FileSystemRights: {1} is invalid.
-Argument_InvalidFileModeTruncate&RightsCombo = Combining FileMode: {0} with FileSystemRights: {1} is invalid. FileMode.Truncate is valid only when used with FileSystemRights.Write.
-Argument_InvalidFlag = Value of flags is invalid.
-Argument_InvalidAnyFlag = No flags can be set.
-Argument_InvalidHandle = The handle is invalid.
-Argument_InvalidRegistryKeyPermissionCheck = The specified RegistryKeyPermissionCheck value is invalid.
-Argument_InvalidRegistryOptionsCheck = The specified RegistryOptions value is invalid.
-Argument_InvalidRegistryViewCheck = The specified RegistryView value is invalid.
-Argument_InvalidSubPath = The directory specified, '{0}', is not a subdirectory of '{1}'.
-Argument_NoRegionInvariantCulture = There is no region associated with the Invariant Culture (Culture ID: 0x7F).
-Argument_ResultCalendarRange = The result is out of the supported range for this calendar. The result should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive.
-Argument_ResultIslamicCalendarRange = The date is out of the supported range for the Islamic calendar. The date should be greater than July 18th, 622 AD (Gregorian date).
-Argument_NeverValidGenericArgument = The type '{0}' may not be used as a type argument.
-Argument_NotEnoughGenArguments = The type or method has {1} generic parameter(s), but {0} generic argument(s) were provided. A generic argument must be provided for each generic parameter.
-Argument_NullFullTrustAssembly = A null StrongName was found in the full trust assembly list.
-Argument_GenConstraintViolation = GenericArguments[{0}], '{1}', on '{2}' violates the constraint of type '{3}'.
-Argument_InvalidToken = Token {0:x} is not valid in the scope of module {1}.
-Argument_InvalidTypeToken = Token {0:x} is not a valid Type token.
-Argument_ResolveType = Token {0:x} is not a valid Type token in the scope of module {1}.
-Argument_ResolveMethod = Token {0:x} is not a valid MethodBase token in the scope of module {1}.
-Argument_ResolveField = Token {0:x} is not a valid FieldInfo token in the scope of module {1}.
-Argument_ResolveMember = Token {0:x} is not a valid MemberInfo token in the scope of module {1}.
-Argument_ResolveString = Token {0:x} is not a valid string token in the scope of module {1}.
-Argument_ResolveModuleType = Token {0} resolves to the special module type representing this module.
-Argument_ResolveMethodHandle = Type handle '{0}' and method handle with declaring type '{1}' are incompatible. Get RuntimeMethodHandle and declaring RuntimeTypeHandle off the same MethodBase.
-Argument_ResolveFieldHandle = Type handle '{0}' and field handle with declaring type '{1}' are incompatible. Get RuntimeFieldHandle and declaring RuntimeTypeHandle off the same FieldInfo.
-Argument_ResourceScopeWrongDirection = Resource type in the ResourceScope enum is going from a more restrictive resource type to a more general one. From: "{0}" To: "{1}"
-Argument_BadResourceScopeTypeBits = Unknown value for the ResourceScope: {0} Too many resource type bits may be set.
-Argument_BadResourceScopeVisibilityBits = Unknown value for the ResourceScope: {0} Too many resource visibility bits may be set.
-Argument_WaitHandleNameTooLong = The name can be no more than {0} characters in length.
-Argument_EnumTypeDoesNotMatch = The argument type, '{0}', is not the same as the enum type '{1}'.
-InvalidOperation_MethodBuilderBaked = The signature of the MethodBuilder can no longer be modified because an operation on the MethodBuilder caused the methodDef token to be created. For example, a call to SetCustomAttribute requires the methodDef token to emit the CustomAttribute token.
-InvalidOperation_GenericParametersAlreadySet = The generic parameters are already defined on this MethodBuilder.
-Arg_AccessException = Cannot access member.
-Arg_AppDomainUnloadedException = Attempted to access an unloaded AppDomain.
-Arg_ApplicationException = Error in the application.
-Arg_ArgumentOutOfRangeException = Specified argument was out of the range of valid values.
-Arg_ArithmeticException = Overflow or underflow in the arithmetic operation.
-Arg_ArrayLengthsDiffer = Array lengths must be the same.
-Arg_ArrayPlusOffTooSmall = Destination array is not long enough to copy all the items in the collection. Check array index and length.
-Arg_ArrayTypeMismatchException = Attempted to access an element as a type incompatible with the array.
-Arg_BadDecimal = Read an invalid decimal value from the buffer.
-Arg_BadImageFormatException = Format of the executable (.exe) or library (.dll) is invalid.
-Argument_BadImageFormatExceptionResolve = A BadImageFormatException has been thrown while parsing the signature. This is likely due to lack of a generic context. Ensure genericTypeArguments and genericMethodArguments are provided and contain enough context.
-Arg_BufferTooSmall = Not enough space available in the buffer.
-Arg_CATypeResolutionFailed = Failed to resolve type from string "{0}" which was embedded in custom attribute blob.
-Arg_CannotHaveNegativeValue = String cannot contain a minus sign if the base is not 10.
-Arg_CannotUnloadAppDomainException = Attempt to unload the AppDomain failed.
-Arg_CannotMixComparisonInfrastructure = The usage of IKeyComparer and IHashCodeProvider/IComparer interfaces cannot be mixed; use one or the other.
-Arg_ContextMarshalException = Attempted to marshal an object across a context boundary.
-Arg_DataMisalignedException = A datatype misalignment was detected in a load or store instruction.
-Arg_DevicesNotSupported = FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\\\.\\" in the path.
-Arg_DuplicateWaitObjectException = Duplicate objects in argument.
-Arg_EntryPointNotFoundException = Entry point was not found.
-Arg_DllNotFoundException = Dll was not found.
-Arg_ExecutionEngineException = Internal error in the runtime.
-Arg_FieldAccessException = Attempted to access a field that is not accessible by the caller.
-Arg_FileIsDirectory_Name = The target file "{0}" is a directory, not a file.
-Arg_FormatException = One of the identified items was in an invalid format.
-Arg_IndexOutOfRangeException = Index was outside the bounds of the array.
-Arg_InsufficientExecutionStackException = Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space.
-Arg_InvalidCastException = Specified cast is not valid.
-Arg_InvalidOperationException = Operation is not valid due to the current state of the object.
-Arg_CorruptedCustomCultureFile = The file of the custom culture {0} is corrupt. Try to unregister this culture.
-Arg_InvokeMember = InvokeMember can be used only for COM objects.
-Arg_InvalidNeutralResourcesLanguage_Asm_Culture = The NeutralResourcesLanguageAttribute on the assembly "{0}" specifies an invalid culture name: "{1}".
-Arg_InvalidNeutralResourcesLanguage_FallbackLoc = The NeutralResourcesLanguageAttribute specifies an invalid or unrecognized ultimate resource fallback location: "{0}".
-Arg_InvalidSatelliteContract_Asm_Ver = Satellite contract version attribute on the assembly '{0}' specifies an invalid version: {1}.
-Arg_MethodAccessException = Attempt to access the method failed.
-Arg_MethodAccessException_WithMethodName = Attempt to access the method "{0}" on type "{1}" failed.
-Arg_MethodAccessException_WithCaller = Attempt by security transparent method '{0}' to access security critical method '{1}' failed.
-Arg_MissingFieldException = Attempted to access a non-existing field.
-Arg_MissingMemberException = Attempted to access a missing member.
-Arg_MissingMethodException = Attempted to access a missing method.
-Arg_MulticastNotSupportedException = Attempted to add multiple callbacks to a delegate that does not support multicast.
-Arg_NotFiniteNumberException = Number encountered was not a finite quantity.
-Arg_NotSupportedException = Specified method is not supported.
-Arg_UnboundGenParam = Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.
-Arg_UnboundGenField = Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true.
-Arg_NotGenericParameter = Method may only be called on a Type for which Type.IsGenericParameter is true.
-Arg_GenericParameter = Method must be called on a Type for which Type.IsGenericParameter is false.
-Arg_NotGenericTypeDefinition = {0} is not a GenericTypeDefinition. MakeGenericType may only be called on a type for which Type.IsGenericTypeDefinition is true.
-Arg_NotGenericMethodDefinition = {0} is not a GenericMethodDefinition. MakeGenericMethod may only be called on a method for which MethodBase.IsGenericMethodDefinition is true.
-Arg_BadLiteralFormat = Encountered an invalid type for a default value.
-Arg_MissingActivationArguments = The AppDomainSetup must specify the activation arguments for this call.
-Argument_BadParameterTypeForCAB = Cannot emit a CustomAttribute with argument of type {0}.
-Argument_InvalidMemberForNamedArgument = The member must be either a field or a property.
-Argument_InvalidTypeName = The name of the type is invalid.
-
-; Note - don't change the NullReferenceException default message. This was
-; negotiated carefully with the VB team to avoid saying "null" or "nothing".
-Arg_NullReferenceException = Object reference not set to an instance of an object.
-
-Arg_AccessViolationException = Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
-Arg_OverflowException = Arithmetic operation resulted in an overflow.
-Arg_PathGlobalRoot = Paths that begin with \\\\?\\GlobalRoot are internal to the kernel and should not be opened by managed applications.
-Arg_PathIllegal = The path is not of a legal form.
-Arg_PathIllegalUNC = The UNC path should be of the form \\\\server\\share.
-Arg_RankException = Attempted to operate on an array with the incorrect number of dimensions.
-Arg_RankMultiDimNotSupported = Only single dimensional arrays are supported for the requested action.
-Arg_NonZeroLowerBound = The lower bound of target array must be zero.
-Arg_RegSubKeyValueAbsent = No value exists with that name.
-Arg_ResourceFileUnsupportedVersion = The ResourceReader class does not know how to read this version of .resources files. Expected version: {0} This file: {1}
-Arg_ResourceNameNotExist = The specified resource name "{0}" does not exist in the resource file.
-Arg_SecurityException = Security error.
-Arg_SerializationException = Serialization error.
-Arg_StackOverflowException = Operation caused a stack overflow.
-Arg_SurrogatesNotAllowedAsSingleChar = Unicode surrogate characters must be written out as pairs together in the same call, not individually. Consider passing in a character array instead.
-Arg_SynchronizationLockException = Object synchronization method was called from an unsynchronized block of code.
-Arg_RWLockRestoreException = ReaderWriterLock.RestoreLock was called without releasing all locks acquired since the call to ReleaseLock.
-Arg_SystemException = System error.
-Arg_TimeoutException = The operation has timed out.
-Arg_UnauthorizedAccessException = Attempted to perform an unauthorized operation.
-Arg_ArgumentException = Value does not fall within the expected range.
-Arg_DirectoryNotFoundException = Attempted to access a path that is not on the disk.
-Arg_DriveNotFoundException = Attempted to access a drive that is not available.
-Arg_EndOfStreamException = Attempted to read past the end of the stream.
-Arg_HexStyleNotSupported = The number style AllowHexSpecifier is not supported on floating point data types.
-Arg_IOException = I/O error occurred.
-Arg_InvalidHexStyle = With the AllowHexSpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be a subset of those in HexNumber.
-Arg_KeyNotFound = The given key was not present in the dictionary.
-Argument_InvalidNumberStyles = An undefined NumberStyles value is being used.
-Argument_InvalidDateTimeStyles = An undefined DateTimeStyles value is being used.
-Argument_InvalidTimeSpanStyles = An undefined TimeSpanStyles value is being used.
-Argument_DateTimeOffsetInvalidDateTimeStyles = The DateTimeStyles value 'NoCurrentDateDefault' is not allowed when parsing DateTimeOffset.
-Argument_NativeResourceAlreadyDefined = Native resource has already been defined.
-Argument_BadObjRef = Invalid ObjRef provided to '{0}'.
-Argument_InvalidCultureName = Culture name '{0}' is not supported.
-Argument_NameTooLong = The name '{0}' is too long to be a Culture or Region name, which is limited to {1} characters.
-Argument_NameContainsInvalidCharacters = The name '{0}' contains characters that are not valid for a Culture or Region.
-Argument_InvalidRegionName = Region name '{0}' is not supported.
-Argument_CannotCreateTypedReference = Cannot use function evaluation to create a TypedReference object.
-Arg_ArrayZeroError = Array must not be of length zero.
-Arg_BogusIComparer = Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: '{0}'.
-Arg_CreatInstAccess = Cannot specify both CreateInstance and another access type.
-Arg_CryptographyException = Error occurred during a cryptographic operation.
-Arg_DateTimeRange = Combination of arguments to the DateTime constructor is out of the legal range.
-Arg_DecBitCtor = Decimal byte array constructor requires an array of length four containing valid decimal bytes.
-Arg_DlgtTargMeth = Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type.
-Arg_DlgtTypeMis = Delegates must be of the same type.
-Arg_DlgtNullInst = Delegate to an instance method cannot have null 'this'.
-Arg_DllInitFailure = One machine may not have remote administration enabled, or both machines may not be running the remote registry service.
-Arg_EmptyArray = Array may not be empty.
-Arg_EmptyOrNullArray = Array may not be empty or null.
-Arg_EmptyCollection = Collection must not be empty.
-Arg_EmptyOrNullString = String may not be empty or null.
-Argument_ItemNotExist = The specified item does not exist in this KeyedCollection.
-Argument_EncodingNotSupported = '{0}' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
-Argument_FallbackBufferNotEmpty = Cannot change fallback when buffer is not empty. Previous Convert() call left data in the fallback buffer.
-Argument_InvalidCodePageConversionIndex = Unable to translate Unicode character \\u{0:X4} at index {1} to specified code page.
-Argument_InvalidCodePageBytesIndex = Unable to translate bytes {0} at index {1} from specified code page to Unicode.
-Argument_RecursiveFallback = Recursive fallback not allowed for character \\u{0:X4}.
-Argument_RecursiveFallbackBytes = Recursive fallback not allowed for bytes {0}.
-Arg_EnumAndObjectMustBeSameType = Object must be the same type as the enum. The type passed in was '{0}'; the enum type was '{1}'.
-Arg_EnumIllegalVal = Illegal enum value: {0}.
-Arg_EnumNotSingleFlag = Must set exactly one flag.
-Arg_EnumAtLeastOneFlag = Must set at least one flag.
-Arg_EnumUnderlyingTypeAndObjectMustBeSameType = Enum underlying type and the object must be same type or object must be a String. Type passed in was '{0}'; the enum underlying type was '{1}'.
-Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType = Enum underlying type and the object must be same type or object. Type passed in was '{0}'; the enum underlying type was '{1}'.
-Arg_EnumMustHaveUnderlyingValueField = All enums must have an underlying value__ field.
-Arg_COMAccess = Must specify property Set or Get or method call for a COM Object.
-Arg_COMPropSetPut = Only one of the following binding flags can be set: BindingFlags.SetProperty, BindingFlags.PutDispProperty, BindingFlags.PutRefDispProperty.
-Arg_FldSetGet = Cannot specify both Get and Set on a field.
-Arg_PropSetGet = Cannot specify both Get and Set on a property.
-Arg_CannotBeNaN = TimeSpan does not accept floating point Not-a-Number values.
-Arg_FldGetPropSet = Cannot specify both GetField and SetProperty.
-Arg_FldSetPropGet = Cannot specify both SetField and GetProperty.
-Arg_FldSetInvoke = Cannot specify Set on a Field and Invoke on a method.
-Arg_FldGetArgErr = No arguments can be provided to Get a field value.
-Arg_FldSetArgErr = Only the field value can be specified to set a field value.
-Arg_GetMethNotFnd = Property Get method was not found.
-Arg_GuidArrayCtor = Byte array for GUID must be exactly {0} bytes long.
-Arg_HandleNotAsync = Handle does not support asynchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened synchronously (that is, it was not opened for overlapped I/O).
-Arg_HandleNotSync = Handle does not support synchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened asynchronously (that is, it was opened explicitly for overlapped I/O).
-Arg_HTCapacityOverflow = Hashtable's capacity overflowed and went negative. Check load factor, capacity and the current size of the table.
-Arg_IndexMustBeInt = All indexes must be of type Int32.
-Arg_InvalidConsoleColor = The ConsoleColor enum value was not defined on that enum. Please use a defined color from the enum.
-Arg_InvalidFileAttrs = Invalid File or Directory attributes value.
-Arg_InvalidHandle = Invalid handle.
-Arg_InvalidTypeInSignature = The signature Type array contains some invalid type (i.e. null, void)
-Arg_InvalidTypeInRetType = The return Type contains some invalid type (i.e. null, ByRef)
-Arg_EHClauseNotFilter = This ExceptionHandlingClause is not a filter.
-Arg_EHClauseNotClause = This ExceptionHandlingClause is not a clause.
-Arg_ReflectionOnlyCA = It is illegal to reflect on the custom attributes of a Type loaded via ReflectionOnlyGetType (see Assembly.ReflectionOnly) -- use CustomAttributeData instead.
-Arg_ReflectionOnlyInvoke = It is illegal to invoke a method on a Type loaded via ReflectionOnlyGetType.
-Arg_ReflectionOnlyField = It is illegal to get or set the value on a field on a Type loaded via ReflectionOnlyGetType.
-Arg_MemberInfoNullModule = The Module object containing the member cannot be null.
-Arg_ParameterInfoNullMember = The MemberInfo object defining the parameter cannot be null.
-Arg_ParameterInfoNullModule = The Module object containing the parameter cannot be null.
-Arg_AssemblyNullModule = The manifest module of the assembly cannot be null.
-Arg_LongerThanSrcArray = Source array was not long enough. Check the source index, length, and the array's lower bounds.
-Arg_LongerThanDestArray = Destination array was not long enough. Check the destination index, length, and the array's lower bounds.
-Arg_LowerBoundsMustMatch = The arrays' lower bounds must be identical.
-Arg_MustBeBoolean = Object must be of type Boolean.
-Arg_MustBeByte = Object must be of type Byte.
-Arg_MustBeChar = Object must be of type Char.
-Arg_MustBeDateTime = Object must be of type DateTime.
-Arg_MustBeDateTimeOffset = Object must be of type DateTimeOffset.
-Arg_MustBeDecimal = Object must be of type Decimal.
-Arg_MustBeDelegate = Type must derive from Delegate.
-Arg_MustBeDouble = Object must be of type Double.
-Arg_MustBeDriveLetterOrRootDir = Object must be a root directory ("C:\\") or a drive letter ("C").
-Arg_MustBeEnum = Type provided must be an Enum.
-Arg_MustBeEnumBaseTypeOrEnum = The value passed in must be an enum base or an underlying type for an enum, such as an Int32.
-Arg_MustBeGuid = Object must be of type GUID.
-Arg_MustBeIdentityReferenceType = Type must be an IdentityReference, such as NTAccount or SecurityIdentifier.
-Arg_MustBeInterface = Type passed must be an interface.
-Arg_MustBeInt16 = Object must be of type Int16.
-Arg_MustBeInt32 = Object must be of type Int32.
-Arg_MustBeInt64 = Object must be of type Int64.
-Arg_MustBePrimArray = Object must be an array of primitives.
-Arg_MustBePointer = Type must be a Pointer.
-Arg_MustBeStatic = Method must be a static method.
-Arg_MustBeString = Object must be of type String.
-Arg_MustBeStringPtrNotAtom = The pointer passed in as a String must not be in the bottom 64K of the process's address space.
-Arg_MustBeSByte = Object must be of type SByte.
-Arg_MustBeSingle = Object must be of type Single.
-Arg_MustBeTimeSpan = Object must be of type TimeSpan.
-Arg_MustBeType = Type must be a type provided by the runtime.
-Arg_MustBeUInt16 = Object must be of type UInt16.
-Arg_MustBeUInt32 = Object must be of type UInt32.
-Arg_MustBeUInt64 = Object must be of type UInt64.
-Arg_MustBeVersion = Object must be of type Version.
-Arg_MustBeTrue = Argument must be true.
-Arg_MustAllBeRuntimeType = At least one type argument is not a runtime type.
-Arg_NamedParamNull = Named parameter value must not be null.
-Arg_NamedParamTooBig = Named parameter array cannot be bigger than argument array.
-Arg_Need1DArray = Array was not a one-dimensional array.
-Arg_Need2DArray = Array was not a two-dimensional array.
-Arg_Need3DArray = Array was not a three-dimensional array.
-Arg_NeedAtLeast1Rank = Must provide at least one rank.
-Arg_NoDefCTor = No parameterless constructor defined for this object.
-Arg_BitArrayTypeUnsupported = Only supported array types for CopyTo on BitArrays are Boolean[], Int32[] and Byte[].
-Arg_DivideByZero = Attempted to divide by zero.
-Arg_NoAccessSpec = Must specify binding flags describing the invoke operation required (BindingFlags.InvokeMethod CreateInstance GetField SetField GetProperty SetProperty).
-Arg_NoStaticVirtual = Method cannot be both static and virtual.
-Arg_NotFoundIFace = Interface not found.
-Arg_ObjObjEx = Object of type '{0}' cannot be converted to type '{1}'.
-Arg_ObjObj = Object type cannot be converted to target type.
-Arg_FieldDeclTarget = Field '{0}' defined on type '{1}' is not a field on the target object which is of type '{2}'.
-Arg_OleAutDateInvalid = Not a legal OleAut date.
-Arg_OleAutDateScale = OleAut date did not convert to a DateTime correctly.
-Arg_PlatformNotSupported = Operation is not supported on this platform.
-Arg_PlatformSecureString = SecureString is only supported on Windows 2000 SP3 and higher platforms.
-Arg_ParmCnt = Parameter count mismatch.
-Arg_ParmArraySize = Must specify one or more parameters.
-Arg_Path2IsRooted = Second path fragment must not be a drive or UNC name.
-Arg_PathIsVolume = Path must not be a drive.
-Arg_PrimWiden = Cannot widen from source type to target type either because the source type is a not a primitive type or the conversion cannot be accomplished.
-Arg_NullIndex = Arrays indexes must be set to an object instance.
-Arg_VarMissNull = Missing parameter does not have a default value.
-Arg_PropSetInvoke = Cannot specify Set on a property and Invoke on a method.
-Arg_PropNotFound = Could not find the specified property.
-Arg_RankIndices = Indices length does not match the array rank.
-Arg_RanksAndBounds = Number of lengths and lowerBounds must match.
-Arg_RegSubKeyAbsent = Cannot delete a subkey tree because the subkey does not exist.
-Arg_RemoveArgNotFound = Cannot remove the specified item because it was not found in the specified Collection.
-Arg_RegKeyDelHive = Cannot delete a registry hive's subtree.
-Arg_RegKeyNoRemoteConnect = No remote connection to '{0}' while trying to read the registry.
-Arg_RegKeyOutOfRange = Registry HKEY was out of the legal range.
-Arg_RegKeyNotFound = The specified registry key does not exist.
-Arg_RegKeyStrLenBug = Registry key names should not be greater than 255 characters.
-Arg_RegValStrLenBug = Registry value names should not be greater than 16,383 characters.
-Arg_RegBadKeyKind = The specified RegistryValueKind is an invalid value.
-Arg_RegGetOverflowBug = RegistryKey.GetValue does not allow a String that has a length greater than Int32.MaxValue.
-Arg_RegSetMismatchedKind = The type of the value object did not match the specified RegistryValueKind or the object could not be properly converted.
-Arg_RegSetBadArrType = RegistryKey.SetValue does not support arrays of type '{0}'. Only Byte[] and String[] are supported.
-Arg_RegSetStrArrNull = RegistryKey.SetValue does not allow a String[] that contains a null String reference.
-Arg_RegInvalidKeyName = Registry key name must start with a valid base key name.
-Arg_ResMgrNotResSet = Type parameter must refer to a subclass of ResourceSet.
-Arg_SetMethNotFnd = Property set method not found.
-Arg_TypeRefPrimitve = TypedReferences cannot be redefined as primitives.
-Arg_UnknownTypeCode = Unknown TypeCode value.
-Arg_VersionString = Version string portion was too short or too long.
-Arg_NoITypeInfo = Specified TypeInfo was invalid because it did not support the ITypeInfo interface.
-Arg_NoITypeLib = Specified TypeLib was invalid because it did not support the ITypeLib interface.
-Arg_NoImporterCallback = Specified type library importer callback was invalid because it did not support the ITypeLibImporterNotifySink interface.
-Arg_ImporterLoadFailure = The type library importer encountered an error during type verification. Try importing without class members.
-Arg_InvalidBase = Invalid Base.
-Arg_EnumValueNotFound = Requested value '{0}' was not found.
-Arg_EnumLitValueNotFound = Literal value was not found.
-Arg_MustContainEnumInfo = Must specify valid information for parsing in the string.
-Arg_InvalidSearchPattern = Search pattern cannot contain ".." to move up directories and can be contained only internally in file/directory names, as in "a..b".
-Arg_NegativeArgCount = Argument count must not be negative.
-Arg_InvalidAccessEntry = Specified access entry is invalid because it is unrestricted. The global flags should be specified instead.
-Arg_InvalidFileName = Specified file name was invalid.
-Arg_InvalidFileExtension = Specified file extension was not a valid extension.
-Arg_COMException = Error HRESULT E_FAIL has been returned from a call to a COM component.
-Arg_ExternalException = External component has thrown an exception.
-Arg_InvalidComObjectException = Attempt has been made to use a COM object that does not have a backing class factory.
-Arg_InvalidOleVariantTypeException = Specified OLE variant was invalid.
-Arg_MarshalDirectiveException = Marshaling directives are invalid.
-Arg_MarshalAsAnyRestriction = AsAny cannot be used on return types, ByRef parameters, ArrayWithOffset, or parameters passed from unmanaged to managed.
-Arg_NDirectBadObject = No PInvoke conversion exists for value passed to Object-typed parameter.
-Arg_SafeArrayTypeMismatchException = Specified array was not of the expected type.
-Arg_VTableCallsNotSupportedException = Attempted to make an early bound call on a COM dispatch-only interface.
-Arg_SafeArrayRankMismatchException = Specified array was not of the expected rank.
-Arg_AmbiguousMatchException = Ambiguous match found.
-Arg_CustomAttributeFormatException = Binary format of the specified custom attribute was invalid.
-Arg_InvalidFilterCriteriaException = Specified filter criteria was invalid.
-Arg_TypeLoadNullStr = A null or zero length string does not represent a valid Type.
-Arg_TargetInvocationException = Exception has been thrown by the target of an invocation.
-Arg_TargetParameterCountException = Number of parameters specified does not match the expected number.
-Arg_TypeAccessException = Attempt to access the type failed.
-Arg_TypeLoadException = Failure has occurred while loading a type.
-Arg_TypeUnloadedException = Type had been unloaded.
-Arg_ThreadStateException = Thread was in an invalid state for the operation being executed.
-Arg_ThreadStartException = Thread failed to start.
-Arg_WrongAsyncResult = IAsyncResult object did not come from the corresponding async method on this type.
-Arg_WrongType = The value "{0}" is not of type "{1}" and cannot be used in this generic collection.
-Argument_InvalidArgumentForComparison = Type of argument is not compatible with the generic comparer.
-Argument_ALSInvalidCapacity = Specified capacity must not be less than the current capacity.
-Argument_ALSInvalidSlot = Specified slot number was invalid.
-Argument_IdnIllegalName = Decoded string is not a valid IDN name.
-Argument_IdnBadBidi = Left to right characters may not be mixed with right to left characters in IDN labels.
-Argument_IdnBadLabelSize = IDN labels must be between 1 and 63 characters long.
-Argument_IdnBadNameSize = IDN names must be between 1 and {0} characters long.
-Argument_IdnBadPunycode = Invalid IDN encoded string.
-Argument_IdnBadStd3 = Label contains character '{0}' not allowed with UseStd3AsciiRules
-Arg_InvalidANSIString = The ANSI string passed in could not be converted from the default ANSI code page to Unicode.
-Arg_InvalidUTF8String = The UTF8 string passed in could not be converted to Unicode.
-Argument_InvalidCharSequence = Invalid Unicode code point found at index {0}.
-Argument_InvalidCharSequenceNoIndex = String contains invalid Unicode code points.
-Argument_InvalidCalendar = Not a valid calendar for the given culture.
-Argument_InvalidNormalizationForm = Invalid or unsupported normalization form.
-Argument_InvalidPathChars = Illegal characters in path.
-Argument_InvalidOffLen = Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
-Argument_InvalidSeekOrigin = Invalid seek origin.
-Argument_SeekOverflow = The specified seek offset '{0}' would result in a negative Stream position.
-Argument_InvalidUnity = Invalid Unity type.
-Argument_LongEnvVarName = Environment variable name cannot contain 1024 or more characters.
-Argument_LongEnvVarValue = Environment variable name or value is too long.
-Argument_StringFirstCharIsZero = The first char in the string is the null character.
-Argument_OnlyMscorlib = Only mscorlib's assembly is valid.
-Argument_PathEmpty = Path cannot be the empty string or all whitespace.
-Argument_PathFormatNotSupported = The given path's format is not supported.
-Argument_PathUriFormatNotSupported = URI formats are not supported.
-Argument_TypeNameTooLong = Type name was too long. The fully qualified type name must be less than 1,024 characters.
-Argument_StreamNotReadable = Stream was not readable.
-Argument_StreamNotWritable = Stream was not writable.
-Argument_InvalidNumberOfMembers = MemberData contains an invalid number of members.
-Argument_InvalidValue = Value was invalid.
-Argument_InvalidKey = Key was invalid.
-Argument_MinMaxValue = '{0}' cannot be greater than {1}.
-Argument_InvalidGroupSize = Every element in the value array should be between one and nine, except for the last element, which can be zero.
-Argument_MustHaveAttributeBaseClass = Type passed in must be derived from System.Attribute or System.Attribute itself.
-Argument_NoUninitializedStrings = Uninitialized Strings cannot be created.
-Argument_UnequalMembers = Supplied MemberInfo does not match the expected type.
-Argument_BadFormatSpecifier = Format specifier was invalid.
-Argument_InvalidHighSurrogate = Found a high surrogate char without a following low surrogate at index: {0}. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters.
-Argument_InvalidLowSurrogate = Found a low surrogate char without a preceding high surrogate at index: {0}. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters.
-Argument_UnmatchingSymScope = Non-matching symbol scope.
-Argument_NotInExceptionBlock = Not currently in an exception block.
-Argument_BadExceptionCodeGen = Incorrect code generation for exception block.
-Argument_NotExceptionType = Does not extend Exception.
-Argument_DuplicateResourceName = Duplicate resource name within an assembly.
-Argument_BadPersistableModuleInTransientAssembly = Cannot have a persistable module in a transient assembly.
-Argument_InvalidPermissionState = Invalid permission state.
-Argument_UnrestrictedIdentityPermission = Identity permissions cannot be unrestricted.
-Argument_WrongType = Operation on type '{0}' attempted with target of incorrect type.
-Argument_IllegalZone = Illegal security permission zone specified.
-Argument_HasToBeArrayClass = Must be an array type.
-Argument_InvalidDirectory = Invalid directory, '{0}'.
-Argument_DataLengthDifferent = Parameters 'members' and 'data' must have the same length.
-Argument_SigIsFinalized = Completed signature cannot be modified.
-Argument_ArraysInvalid = Array or pointer types are not valid.
-Argument_GenericsInvalid = Generic types are not valid.
-Argument_LargeInteger = Integer or token was too large to be encoded.
-Argument_BadSigFormat = Incorrect signature format.
-Argument_UnmatchedMethodForLocal = Local passed in does not belong to this ILGenerator.
-Argument_DuplicateName = Tried to add NamedPermissionSet with non-unique name.
-Argument_InvalidXMLElement = Invalid XML. Missing required tag <{0}> for type '{1}'.
-Argument_InvalidXMLMissingAttr = Invalid XML. Missing required attribute '{0}'.
-Argument_CannotGetTypeTokenForByRef = Cannot get TypeToken for a ByRef type.
-Argument_NotASimpleNativeType = The UnmanagedType passed to DefineUnmanagedMarshal is not a simple type. None of the following values may be used: UnmanagedType.ByValTStr, UnmanagedType.SafeArray, UnmanagedType.ByValArray, UnmanagedType.LPArray, UnmanagedType.CustomMarshaler.
-Argument_NotACustomMarshaler = Not a custom marshal.
-Argument_NoUnmanagedElementCount = Unmanaged marshal does not have ElementCount.
-Argument_NoNestedMarshal = Only LPArray or SafeArray has nested unmanaged marshal.
-Argument_InvalidXML = Invalid Xml.
-Argument_NoUnderlyingCCW = The object has no underlying COM data associated with it.
-Argument_BadFieldType = Bad field type in defining field.
-Argument_InvalidXMLBadVersion = Invalid Xml - can only parse elements of version one.
-Argument_NotAPermissionElement = 'elem' was not a permission element.
-Argument_NPMSInvalidName = Name can be neither null nor empty.
-Argument_InvalidElementTag = Invalid element tag '{0}'.
-Argument_InvalidElementText = Invalid element text '{0}'.
-Argument_InvalidElementName = Invalid element name '{0}'.
-Argument_InvalidElementValue = Invalid element value '{0}'.
-Argument_AttributeNamesMustBeUnique = Attribute names must be unique.
-Argument_InvalidHexFormat = Improperly formatted hex string.
-Argument_InvalidSite = Invalid site.
-Argument_InterfaceMap = 'this' type cannot be an interface itself.
-Argument_ArrayGetInterfaceMap = Interface maps for generic interfaces on arrays cannot be retrieved.
-Argument_InvalidName = Invalid name.
-Argument_InvalidDirectoryOnUrl = Invalid directory on URL.
-Argument_InvalidUrl = Invalid URL.
-Argument_InvalidKindOfTypeForCA = This type cannot be represented as a custom attribute.
-Argument_MustSupplyContainer = When supplying a FieldInfo for fixing up a nested type, a valid ID for that containing object must also be supplied.
-Argument_MustSupplyParent = When supplying the ID of a containing object, the FieldInfo that identifies the current field within that object must also be supplied.
-Argument_NoClass = Element does not specify a class.
-Argument_WrongElementType = '{0}' element required.
-Argument_UnableToGeneratePermissionSet = Unable to generate permission set; input XML may be malformed.
-Argument_NoEra = No Era was supplied.
-Argument_AssemblyAlreadyFullTrust = Assembly was already fully trusted.
-Argument_AssemblyNotFullTrust = Assembly was not fully trusted.
-Argument_AssemblyWinMD = Assembly must not be a Windows Runtime assembly.
-Argument_MemberAndArray = Cannot supply both a MemberInfo and an Array to indicate the parent of a value type.
-Argument_ObjNotComObject = The object's type must be __ComObject or derived from __ComObject.
-Argument_ObjIsWinRTObject = The object's type must not be a Windows Runtime type.
-Argument_TypeNotComObject = The type must be __ComObject or be derived from __ComObject.
-Argument_TypeIsWinRTType = The type must not be a Windows Runtime type.
-Argument_CantCallSecObjFunc = Cannot evaluate a security function.
-Argument_StructMustNotBeValueClass = The structure must not be a value class.
-Argument_NoSpecificCulture = Please select a specific culture, such as zh-CN, zh-HK, zh-TW, zh-MO, zh-SG.
-Argument_InvalidResourceCultureName = The given culture name '{0}' cannot be used to locate a resource file. Resource filenames must consist of only letters, numbers, hyphens or underscores.
-Argument_InvalidParamInfo = Invalid type for ParameterInfo member in Attribute class.
-Argument_EmptyDecString = Decimal separator cannot be the empty string.
-Argument_OffsetOfFieldNotFound = Field passed in is not a marshaled member of the type '{0}'.
-Argument_EmptyStrongName = StrongName cannot have an empty string for the assembly name.
-Argument_NotSerializable = Argument passed in is not serializable.
-Argument_EmptyApplicationName = ApplicationId cannot have an empty string for the name.
-Argument_NoDomainManager = The domain manager specified by the host could not be instantiated.
-Argument_NoMain = Main entry point not defined.
-Argument_InvalidDateTimeKind = Invalid DateTimeKind value.
-Argument_ConflictingDateTimeStyles = The DateTimeStyles values AssumeLocal and AssumeUniversal cannot be used together.
-Argument_ConflictingDateTimeRoundtripStyles = The DateTimeStyles value RoundtripKind cannot be used with the values AssumeLocal, AssumeUniversal or AdjustToUniversal.
-Argument_InvalidDigitSubstitution = The DigitSubstitution property must be of a valid member of the DigitShapes enumeration. Valid entries include Context, NativeNational or None.
-Argument_InvalidNativeDigitCount = The NativeDigits array must contain exactly ten members.
-Argument_InvalidNativeDigitValue = Each member of the NativeDigits array must be a single text element (one or more UTF16 code points) with a Unicode Nd (Number, Decimal Digit) property indicating it is a digit.
-ArgumentException_InvalidAceBinaryForm = The binary form of an ACE object is invalid.
-ArgumentException_InvalidAclBinaryForm = The binary form of an ACL object is invalid.
-ArgumentException_InvalidSDSddlForm = The SDDL form of a security descriptor object is invalid.
-Argument_InvalidSafeHandle = The SafeHandle is invalid.
-Argument_CannotPrepareAbstract = Abstract methods cannot be prepared.
-Argument_ArrayTooLarge = The input array length must not exceed Int32.MaxValue / {0}. Otherwise BitArray.Length would exceed Int32.MaxValue.
-Argument_RelativeUrlMembershipCondition = UrlMembershipCondition requires an absolute URL.
-Argument_EmptyWaithandleArray = Waithandle array may not be empty.
-Argument_InvalidSafeBufferOffLen = Offset and length were greater than the size of the SafeBuffer.
-Argument_NotEnoughBytesToRead = There are not enough bytes remaining in the accessor to read at this position.
-Argument_NotEnoughBytesToWrite = There are not enough bytes remaining in the accessor to write at this position.
-Argument_OffsetAndLengthOutOfBounds = Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
-Argument_OffsetAndCapacityOutOfBounds = Offset and capacity were greater than the size of the view.
-Argument_UnmanagedMemAccessorWrapAround = The UnmanagedMemoryAccessor capacity and offset would wrap around the high end of the address space.
-Argument_UnrecognizedLoaderOptimization = Unrecognized LOADER_OPTIMIZATION property value. Supported values may include "SingleDomain", "MultiDomain", "MultiDomainHost", and "NotSpecified".
-ArgumentException_NotAllCustomSortingFuncsDefined = Implementations of all the NLS functions must be provided.
-ArgumentException_MinSortingVersion = The runtime does not support a version of "{0}" less than {1}.
-Argument_PreAllocatedAlreadyAllocated = 'preAllocated' is already in use.
-Argument_NativeOverlappedWrongBoundHandle = 'overlapped' was not allocated by this ThreadPoolBoundHandle instance.
-Argument_NativeOverlappedAlreadyFree = 'overlapped' has already been freed.
-Argument_AlreadyBoundOrSyncHandle = 'handle' has already been bound to the thread pool, or was not opened for asynchronous I/O.
-Argument_InvalidTypeWithPointersNotSupported = Cannot use type '{0}'. Only value types without pointers or references are supported.
-Argument_DestinationTooShort = Destination is too short.
-
-;
-; =====================================================
-; Reflection Emit resource strings
-Arugment_EmitMixedContext1 = Type '{0}' was loaded in the ReflectionOnly context but the AssemblyBuilder was not created as AssemblyBuilderAccess.ReflectionOnly.
-Arugment_EmitMixedContext2 = Type '{0}' was not loaded in the ReflectionOnly context but the AssemblyBuilder was created as AssemblyBuilderAccess.ReflectionOnly.
-Argument_BadSizeForData = Data size must be > 0 and < 0x3f0000
-Argument_InvalidLabel = Invalid Label.
-Argument_RedefinedLabel = Label multiply defined.
-Argument_UnclosedExceptionBlock = The IL Generator cannot be used while there are unclosed exceptions.
-Argument_MissingDefaultConstructor = was missing default constructor.
-Argument_TooManyFinallyClause = Exception blocks may have at most one finally clause.
-Argument_NotInTheSameModuleBuilder = The argument passed in was not from the same ModuleBuilder.
-Argument_BadCurrentLocalVariable = Bad current local variable for setting symbol information.
-Argument_DuplicateModuleName = Duplicate dynamic module name within an assembly.
-Argument_DuplicateTypeName = Duplicate type name within an assembly.
-Argument_InvalidAssemblyName = Assembly names may not begin with whitespace or contain the characters '/', or '\\' or ':'.
-Argument_InvalidGenericInstantiation = The given generic instantiation was invalid.
-Argument_DuplicatedFileName = Duplicate file names.
-Argument_GlobalFunctionHasToBeStatic = Global members must be static.
-Argument_BadPInvokeOnInterface = PInvoke methods cannot exist on interfaces.
-Argument_BadPInvokeMethod = PInvoke methods must be static and native and cannot be abstract.
-Argument_MethodRedefined = Method has been already defined.
-Argument_BadTypeAttrAbstractNFinal = Bad type attributes. A type cannot be both abstract and final.
-Argument_BadTypeAttrNestedVisibilityOnNonNestedType = Bad type attributes. Nested visibility flag set on a non-nested type.
-Argument_BadTypeAttrNonNestedVisibilityNestedType = Bad type attributes. Non-nested visibility flag set on a nested type.
-Argument_BadTypeAttrInvalidLayout = Bad type attributes. Invalid layout attribute specified.
-Argument_BadTypeAttrReservedBitsSet = Bad type attributes. Reserved bits set on the type.
-Argument_BadFieldSig = Field signatures do not have return types.
-Argument_ShouldOnlySetVisibilityFlags = Should only set visibility flags when creating EnumBuilder.
-Argument_BadNestedTypeFlags = Visibility of interfaces must be one of the following: NestedAssembly, NestedFamANDAssem, NestedFamily, NestedFamORAssem, NestedPrivate or NestedPublic.
-Argument_ShouldNotSpecifyExceptionType = Should not specify exception type for catch clause for filter block.
-Argument_BadLabel = Bad label in ILGenerator.
-Argument_BadLabelContent = Bad label content in ILGenerator.
-Argument_EmitWriteLineType = EmitWriteLine does not support this field or local type.
-Argument_ConstantNull = Null is not a valid constant value for this type.
-Argument_ConstantDoesntMatch = Constant does not match the defined type.
-Argument_ConstantNotSupported = {0} is not a supported constant type.
-Argument_BadConstructor = Cannot have private or static constructor.
-Argument_BadConstructorCallConv = Constructor must have standard calling convention.
-Argument_BadPropertyForConstructorBuilder = Property must be on the same type of the given ConstructorInfo.
-Argument_NotAWritableProperty = Not a writable property.
-Argument_BadFieldForConstructorBuilder = Field must be on the same type of the given ConstructorInfo.
-Argument_BadAttributeOnInterfaceMethod = Interface method must be abstract and virtual.
-ArgumentException_BadMethodImplBody = MethodOverride's body must be from this type.
-Argument_BadParameterCountsForConstructor = Parameter count does not match passed in argument value count.
-Argument_BadParameterTypeForConstructor = Passed in argument value at index {0} does not match the parameter type.
-Argument_BadTypeInCustomAttribute = An invalid type was used as a custom attribute constructor argument, field or property.
-Argument_DateTimeBadBinaryData = The binary data must result in a DateTime with ticks between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
-Argument_VerStringTooLong = The unmanaged Version information is too large to persist.
-Argument_UnknownUnmanagedCallConv = Unknown unmanaged calling convention for function signature.
-Argument_BadConstantValue = Bad default value.
-Argument_IllegalName = Illegal name.
-Argument_cvtres_NotFound = Cannot find cvtres.exe
-Argument_BadCAForUnmngRSC = Bad '{0}' while generating unmanaged resource information.
-Argument_MustBeInterfaceMethod = The MemberInfo must be an interface method.
-Argument_CORDBBadVarArgCallConv = Cannot evaluate a VarArgs function.
-Argument_CORDBBadMethod = Cannot find the method on the object instance.
-Argument_InvalidOpCodeOnDynamicMethod = Ldtoken, Ldftn and Ldvirtftn OpCodes cannot target DynamicMethods.
-Argument_InvalidTypeForDynamicMethod = Invalid type owner for DynamicMethod.
-Argument_NeedGenericMethodDefinition = Method must represent a generic method definition on a generic type definition.
-Argument_MethodNeedGenericDeclaringType = The specified method cannot be dynamic or global and must be declared on a generic type definition.
-Argument_ConstructorNeedGenericDeclaringType = The specified constructor must be declared on a generic type definition.
-Argument_FieldNeedGenericDeclaringType = The specified field must be declared on a generic type definition.
-Argument_InvalidMethodDeclaringType = The specified method must be declared on the generic type definition of the specified type.
-Argument_InvalidConstructorDeclaringType = The specified constructor must be declared on the generic type definition of the specified type.
-Argument_InvalidFieldDeclaringType = The specified field must be declared on the generic type definition of the specified type.
-Argument_NeedNonGenericType = The specified Type must not be a generic type definition.
-Argument_MustBeTypeBuilder = 'type' must contain a TypeBuilder as a generic argument.
-Argument_CannotSetParentToInterface = Cannot set parent to an interface.
-Argument_MismatchedArrays = Two arrays, {0} and {1}, must be of the same size.
-Argument_NeedNonGenericObject = The specified object must not be an instance of a generic type.
-Argument_NeedStructWithNoRefs = The specified Type must be a struct containing no references.
-Argument_NotMethodCallOpcode = The specified opcode cannot be passed to EmitCall.
-
-; =====================================================
-;
-Argument_ModuleAlreadyLoaded = The specified module has already been loaded.
-Argument_MustHaveLayoutOrBeBlittable = The specified structure must be blittable or have layout information.
-Argument_NotSimpleFileName = The filename must not include a path specification.
-Argument_TypeMustBeVisibleFromCom = The specified type must be visible from COM.
-Argument_TypeMustBeComCreatable = The type must be creatable from COM.
-Argument_TypeMustNotBeComImport = The type must not be imported from COM.
-Argument_PolicyFileDoesNotExist = The requested policy file does not exist.
-Argument_NonNullObjAndCtx = Either obj or ctx must be null.
-Argument_NoModuleFileExtension = Module file name '{0}' must have file extension.
-Argument_TypeDoesNotContainMethod = Type does not contain the given method.
-Argument_StringZeroLength = String cannot be of zero length.
-Argument_MustBeString = String is too long or has invalid contents.
-Argument_AbsolutePathRequired = Absolute path information is required.
-Argument_ManifestFileDoesNotExist = The specified manifest file does not exist.
-Argument_MustBeRuntimeType = Type must be a runtime Type object.
-Argument_TypeNotValid = The Type object is not valid.
-Argument_MustBeRuntimeMethodInfo = MethodInfo must be a runtime MethodInfo object.
-Argument_MustBeRuntimeFieldInfo = FieldInfo must be a runtime FieldInfo object.
-Argument_InvalidFieldInfo = The FieldInfo object is not valid.
-Argument_InvalidConstructorInfo = The ConstructorInfo object is not valid.
-Argument_MustBeRuntimeAssembly = Assembly must be a runtime Assembly object.
-Argument_MustBeRuntimeModule = Module must be a runtime Module object.
-Argument_MustBeRuntimeParameterInfo = ParameterInfo must be a runtime ParameterInfo object.
-Argument_InvalidParameterInfo = The ParameterInfo object is not valid.
-Argument_MustBeRuntimeReflectionObject = The object must be a runtime Reflection object.
-Argument_InvalidMarshalByRefObject = The MarshalByRefObject is not valid.
-Argument_TypedReferenceInvalidField = Field in TypedReferences cannot be static or init only.
-Argument_HandleLeak = Cannot pass a GCHandle across AppDomains.
-Argument_ArgumentZero = Argument cannot be zero.
-Argument_ImproperType = Improper types in collection.
-Argument_NotAMembershipCondition = The type does not implement IMembershipCondition
-Argument_NotAPermissionType = The type does not implement IPermission
-Argument_NotACodeGroupType = The type does not inherit from CodeGroup
-Argument_NotATP = Type must be a TransparentProxy
-Argument_AlreadyACCW = The object already has a CCW associated with it.
-Argument_OffsetLocalMismatch = The UTC Offset of the local dateTime parameter does not match the offset argument.
-Argument_OffsetUtcMismatch = The UTC Offset for Utc DateTime instances must be 0.
-Argument_UTCOutOfRange = The UTC time represented when the offset is applied must be between year 0 and 10,000.
-Argument_OffsetOutOfRange = Offset must be within plus or minus 14 hours.
-Argument_OffsetPrecision = Offset must be specified in whole minutes.
-Argument_FlagNotSupported = One or more flags are not supported.
-Argument_MustBeFalse = Argument must be initialized to false
-Argument_ToExclusiveLessThanFromExclusive = fromInclusive must be less than or equal to toExclusive.
-Argument_FrameworkNameTooShort=FrameworkName cannot have less than two components or more than three components.
-Argument_FrameworkNameInvalid=FrameworkName is invalid.
-Argument_FrameworkNameMissingVersion=FrameworkName version component is missing.
-#if FEATURE_COMINTEROP
-Argument_TypeNotActivatableViaWindowsRuntime = Type '{0}' does not have an activation factory because it is not activatable by Windows Runtime.
-Argument_WinRTSystemRuntimeType = Cannot marshal type '{0}' to Windows Runtime. Only 'System.RuntimeType' is supported.
-Argument_Unexpected_TypeSource = Unexpected TypeKind when marshaling Windows.Foundation.TypeName.
-#endif // FEATURE_COMINTEROP
-
-; ArgumentNullException
-ArgumentNull_Array = Array cannot be null.
-ArgumentNull_ArrayValue = Found a null value within an array.
-ArgumentNull_ArrayElement = At least one element in the specified array was null.
-ArgumentNull_Assembly = Assembly cannot be null.
-ArgumentNull_AssemblyName = AssemblyName cannot be null.
-ArgumentNull_AssemblyNameName = AssemblyName.Name cannot be null or an empty string.
-ArgumentNull_Buffer = Buffer cannot be null.
-ArgumentNull_Collection = Collection cannot be null.
-ArgumentNull_CultureInfo = CultureInfo cannot be null.
-ArgumentNull_Dictionary = Dictionary cannot be null.
-ArgumentNull_FileName = File name cannot be null.
-ArgumentNull_Key = Key cannot be null.
-ArgumentNull_Graph = Object Graph cannot be null.
-ArgumentNull_Path = Path cannot be null.
-ArgumentNull_Stream = Stream cannot be null.
-ArgumentNull_String = String reference not set to an instance of a String.
-ArgumentNull_Type = Type cannot be null.
-ArgumentNull_Obj = Object cannot be null.
-ArgumentNull_GUID = GUID cannot be null.
-ArgumentNull_NullMember = Member at position {0} was null.
-ArgumentNull_Generic = Value cannot be null.
-ArgumentNull_WithParamName = Parameter '{0}' cannot be null.
-ArgumentNull_Child = Cannot have a null child.
-ArgumentNull_SafeHandle = SafeHandle cannot be null.
-ArgumentNull_CriticalHandle = CriticalHandle cannot be null.
-ArgumentNull_TypedRefType = Type in TypedReference cannot be null.
-ArgumentNull_ApplicationTrust = The application trust cannot be null.
-ArgumentNull_TypeRequiredByResourceScope = The type parameter cannot be null when scoping the resource's visibility to Private or Assembly.
-ArgumentNull_Waithandles = The waitHandles parameter cannot be null.
-
-; ArgumentOutOfRangeException
-ArgumentOutOfRange_AddressSpace = The number of bytes cannot exceed the virtual address space on a 32 bit machine.
-ArgumentOutOfRange_ArrayLB = Number was less than the array's lower bound in the first dimension.
-ArgumentOutOfRange_ArrayLBAndLength = Higher indices will exceed Int32.MaxValue because of large lower bound and/or length.
-ArgumentOutOfRange_ArrayLength = The length of the array must be between {0} and {1}, inclusive.
-ArgumentOutOfRange_ArrayLengthMultiple = The length of the array must be a multiple of {0}.
-ArgumentOutOfRange_ArrayListInsert = Insertion index was out of range. Must be non-negative and less than or equal to size.
-ArgumentOutOfRange_ArrayTooSmall = Destination array is not long enough to copy all the required data. Check array length and offset.
-ArgumentOutOfRange_BeepFrequency = Console.Beep's frequency must be between {0} and {1}.
-ArgumentOutOfRange_BiggerThanCollection = Larger than collection size.
-ArgumentOutOfRange_Bounds_Lower_Upper = Argument must be between {0} and {1}.
-ArgumentOutOfRange_Count = Count must be positive and count must refer to a location within the string/array/collection.
-ArgumentOutOfRange_CalendarRange = Specified time is not supported in this calendar. It should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive.
-ArgumentOutOfRange_ConsoleBufferBoundaries = The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
-ArgumentOutOfRange_ConsoleBufferLessThanWindowSize = The console buffer size must not be less than the current size and position of the console window, nor greater than or equal to Int16.MaxValue.
-ArgumentOutOfRange_ConsoleWindowBufferSize = The new console window size would force the console buffer size to be too large.
-ArgumentOutOfRange_ConsoleTitleTooLong = The console title is too long.
-ArgumentOutOfRange_ConsoleWindowPos = The window position must be set such that the current window size fits within the console's buffer, and the numbers must not be negative.
-ArgumentOutOfRange_ConsoleWindowSize_Size = The value must be less than the console's current maximum window size of {0} in that dimension. Note that this value depends on screen resolution and the console font.
-ArgumentOutOfRange_ConsoleKey = Console key values must be between 0 and 255.
-ArgumentOutOfRange_CursorSize = The cursor size is invalid. It must be a percentage between 1 and 100.
-ArgumentOutOfRange_BadYearMonthDay = Year, Month, and Day parameters describe an un-representable DateTime.
-ArgumentOutOfRange_BadHourMinuteSecond = Hour, Minute, and Second parameters describe an un-representable DateTime.
-ArgumentOutOfRange_DateArithmetic = The added or subtracted value results in an un-representable DateTime.
-ArgumentOutOfRange_DateTimeBadMonths = Months value must be between +/-120000.
-ArgumentOutOfRange_DateTimeBadYears = Years value must be between +/-10000.
-ArgumentOutOfRange_DateTimeBadTicks = Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
-ArgumentOutOfRange_Day = Day must be between 1 and {0} for month {1}.
-ArgumentOutOfRange_DecimalRound = Decimal can only round to between 0 and 28 digits of precision.
-ArgumentOutOfRange_DecimalScale = Decimal's scale value must be between 0 and 28, inclusive.
-ArgumentOutOfRange_Era = Time value was out of era range.
-ArgumentOutOfRange_Enum = Enum value was out of legal range.
-ArgumentOutOfRange_FileLengthTooBig = Specified file length was too large for the file system.
-ArgumentOutOfRange_FileTimeInvalid = Not a valid Win32 FileTime.
-ArgumentOutOfRange_GetByteCountOverflow = Too many characters. The resulting number of bytes is larger than what can be returned as an int.
-ArgumentOutOfRange_GetCharCountOverflow = Too many bytes. The resulting number of chars is larger than what can be returned as an int.
-ArgumentOutOfRange_HashtableLoadFactor = Load factor needs to be between 0.1 and 1.0.
-ArgumentOutOfRange_HugeArrayNotSupported = Arrays larger than 2GB are not supported.
-ArgumentOutOfRange_InvalidHighSurrogate = A valid high surrogate character is between 0xd800 and 0xdbff, inclusive.
-ArgumentOutOfRange_InvalidLowSurrogate = A valid low surrogate character is between 0xdc00 and 0xdfff, inclusive.
-ArgumentOutOfRange_InvalidEraValue = Era value was not valid.
-ArgumentOutOfRange_InvalidUserDefinedAceType = User-defined ACEs must not have a well-known ACE type.
-ArgumentOutOfRange_InvalidUTF32 = A valid UTF32 value is between 0x000000 and 0x10ffff, inclusive, and should not include surrogate codepoint values (0x00d800 ~ 0x00dfff).
-ArgumentOutOfRange_Index = Index was out of range. Must be non-negative and less than the size of the collection.
-ArgumentOutOfRange_IndexString = Index was out of range. Must be non-negative and less than the length of the string.
-ArgumentOutOfRange_StreamLength = Stream length must be non-negative and less than 2^31 - 1 - origin.
-ArgumentOutOfRange_LessEqualToIntegerMaxVal = Argument must be less than or equal to 2^31 - 1 milliseconds.
-ArgumentOutOfRange_Month = Month must be between one and twelve.
-ArgumentOutOfRange_MustBeNonNegInt32 = Value must be non-negative and less than or equal to Int32.MaxValue.
-ArgumentOutOfRange_NeedNonNegNum = Non-negative number required.
-ArgumentOutOfRange_NeedNonNegOrNegative1 = Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
-ArgumentOutOfRange_NeedPosNum = Positive number required.
-ArgumentOutOfRange_NegativeCapacity = Capacity must be positive.
-ArgumentOutOfRange_NegativeCount = Count cannot be less than zero.
-ArgumentOutOfRange_NegativeLength = Length cannot be less than zero.
-ArgumentOutOfRange_NegFileSize = Length must be non-negative.
-ArgumentOutOfRange_ObjectID = objectID cannot be less than or equal to zero.
-ArgumentOutOfRange_SmallCapacity = capacity was less than the current size.
-ArgumentOutOfRange_QueueGrowFactor = Queue grow factor must be between {0} and {1}.
-ArgumentOutOfRange_RoundingDigits = Rounding digits must be between 0 and 15, inclusive.
-ArgumentOutOfRange_StartIndex = StartIndex cannot be less than zero.
-ArgumentOutOfRange_MustBePositive = '{0}' must be greater than zero.
-ArgumentOutOfRange_MustBeNonNegNum = '{0}' must be non-negative.
-ArgumentOutOfRange_LengthGreaterThanCapacity = The length cannot be greater than the capacity.
-ArgumentOutOfRange_ListInsert = Index must be within the bounds of the List.
-ArgumentOutOfRange_StartIndexLessThanLength = startIndex must be less than length of string.
-ArgumentOutOfRange_StartIndexLargerThanLength = startIndex cannot be larger than length of string.
-ArgumentOutOfRange_EndIndexStartIndex = endIndex cannot be greater than startIndex.
-ArgumentOutOfRange_IndexCount = Index and count must refer to a location within the string.
-ArgumentOutOfRange_IndexCountBuffer = Index and count must refer to a location within the buffer.
-ArgumentOutOfRange_IndexLength = Index and length must refer to a location within the string.
-ArgumentOutOfRange_InvalidThreshold = The specified threshold for creating dictionary is out of range.
-ArgumentOutOfRange_Capacity = Capacity exceeds maximum capacity.
-ArgumentOutOfRange_Length = The specified length exceeds maximum capacity of SecureString.
-ArgumentOutOfRange_LengthTooLarge = The specified length exceeds the maximum value of {0}.
-ArgumentOutOfRange_SmallMaxCapacity = MaxCapacity must be one or greater.
-ArgumentOutOfRange_GenericPositive = Value must be positive.
-ArgumentOutOfRange_Range = Valid values are between {0} and {1}, inclusive.
-ArgumentOutOfRange_AddValue = Value to add was out of range.
-ArgumentOutOfRange_OffsetLength = Offset and length must refer to a position in the string.
-ArgumentOutOfRange_OffsetOut = Either offset did not refer to a position in the string, or there is an insufficient length of destination character array.
-ArgumentOutOfRange_PartialWCHAR = Pointer startIndex and length do not refer to a valid string.
-ArgumentOutOfRange_ParamSequence = The specified parameter index is not in range.
-ArgumentOutOfRange_Version = Version's parameters must be greater than or equal to zero.
-ArgumentOutOfRange_TimeoutTooLarge = Time-out interval must be less than 2^32-2.
-ArgumentOutOfRange_UIntPtrMax-1 = The length of the buffer must be less than the maximum UIntPtr value for your platform.
-ArgumentOutOfRange_UnmanagedMemStreamLength = UnmanagedMemoryStream length must be non-negative and less than 2^63 - 1 - baseAddress.
-ArgumentOutOfRange_UnmanagedMemStreamWrapAround = The UnmanagedMemoryStream capacity would wrap around the high end of the address space.
-ArgumentOutOfRange_PeriodTooLarge = Period must be less than 2^32-2.
-ArgumentOutOfRange_Year = Year must be between 1 and 9999.
-ArgumentOutOfRange_BinaryReaderFillBuffer = The number of bytes requested does not fit into BinaryReader's internal buffer.
-ArgumentOutOfRange_PositionLessThanCapacityRequired = The position may not be greater or equal to the capacity of the accessor.
-
-; ArithmeticException
-Arithmetic_NaN = Function does not accept floating point Not-a-Number values.
-
-; ArrayTypeMismatchException
-ArrayTypeMismatch_CantAssignType = Source array type cannot be assigned to destination array type.
-ArrayTypeMismatch_ConstrainedCopy = Array.ConstrainedCopy will only work on array types that are provably compatible, without any form of boxing, unboxing, widening, or casting of each array element. Change the array types (i.e., copy a Derived[] to a Base[]), or use a mitigation strategy in the CER for Array.Copy's less powerful reliability contract, such as cloning the array or throwing away the potentially corrupt destination array.
-
-; BadImageFormatException
-BadImageFormat_ResType&SerBlobMismatch = The type serialized in the .resources file was not the same type that the .resources file said it contained. Expected '{0}' but read '{1}'.
-BadImageFormat_ResourcesIndexTooLong = Corrupt .resources file. String for name index '{0}' extends past the end of the file.
-BadImageFormat_ResourcesNameTooLong = Corrupt .resources file. Resource name extends past the end of the file.
-BadImageFormat_ResourcesNameInvalidOffset = Corrupt .resources file. Invalid offset '{0}' into name section.
-BadImageFormat_ResourcesHeaderCorrupted = Corrupt .resources file. Unable to read resources from this file because of invalid header information. Try regenerating the .resources file.
-BadImageFormat_ResourceNameCorrupted = Corrupt .resources file. A resource name extends past the end of the stream.
-BadImageFormat_ResourceNameCorrupted_NameIndex = Corrupt .resources file. The resource name for name index {0} extends past the end of the stream.
-BadImageFormat_ResourceDataLengthInvalid = Corrupt .resources file. The specified data length '{0}' is not a valid position in the stream.
-BadImageFormat_TypeMismatch = Corrupt .resources file. The specified type doesn't match the available data in the stream.
-BadImageFormat_InvalidType = Corrupt .resources file. The specified type doesn't exist.
-BadImageFormat_ResourcesIndexInvalid = Corrupt .resources file. The resource index '{0}' is outside the valid range.
-BadImageFormat_StreamPositionInvalid = Corrupt .resources file. The specified position '{0}' is not a valid position in the stream.
-BadImageFormat_ResourcesDataInvalidOffset = Corrupt .resources file. Invalid offset '{0}' into data section.
-BadImageFormat_NegativeStringLength = Corrupt .resources file. String length must be non-negative.
-BadImageFormat_ParameterSignatureMismatch = The parameters and the signature of the method don't match.
-BadImageFormat_BadILFormat = Bad IL format.
-
-; Cryptography
-; These strings still appear in bcl.small but should go away eventually
-Cryptography_CSSM_Error = Error 0x{0} from the operating system security framework: '{1}'.
-Cryptography_CSSM_Error_Unknown = Error 0x{0} from the operating system security framework.
-Cryptography_InvalidDSASignatureSize = Length of the DSA signature was not 40 bytes.
-Cryptography_InvalidHandle = {0} is an invalid handle.
-Cryptography_InvalidOID = Object identifier (OID) is unknown.
-Cryptography_OAEPDecoding = Error occurred while decoding OAEP padding.
-Cryptography_PasswordDerivedBytes_InvalidIV = The Initialization vector should have the same length as the algorithm block size in bytes.
-Cryptography_SSE_InvalidDataSize = Length of the data to encrypt is invalid.
-Cryptography_X509_ExportFailed = The certificate export operation failed.
-Cryptography_X509_InvalidContentType = Invalid content type.
-Cryptography_CryptoStream_FlushFinalBlockTwice = FlushFinalBlock() method was called twice on a CryptoStream. It can only be called once.
-Cryptography_HashKeySet = Hash key cannot be changed after the first write to the stream.
-Cryptography_HashNotYetFinalized = Hash must be finalized before the hash value is retrieved.
-Cryptography_InsufficientBuffer = Input buffer contains insufficient data.
-Cryptography_InvalidBlockSize = Specified block size is not valid for this algorithm.
-Cryptography_InvalidCipherMode = Specified cipher mode is not valid for this algorithm.
-Cryptography_InvalidIVSize = Specified initialization vector (IV) does not match the block size for this algorithm.
-Cryptography_InvalidKeySize = Specified key is not a valid size for this algorithm.
-Cryptography_PasswordDerivedBytes_FewBytesSalt = Salt is not at least eight bytes.
-Cryptography_PKCS7_InvalidPadding = Padding is invalid and cannot be removed.
-Cryptography_UnknownHashAlgorithm='{0}' is not a known hash algorithm.
-
-; EventSource
-EventSource_ToString = EventSource({0}, {1})
-EventSource_EventSourceGuidInUse = An instance of EventSource with Guid {0} already exists.
-EventSource_KeywordNeedPowerOfTwo = Value {0} for keyword {1} needs to be a power of 2.
-EventSource_UndefinedKeyword = Use of undefined keyword value {0} for event {1}.
-EventSource_UnsupportedEventTypeInManifest = Unsupported type {0} in event source.
-EventSource_ListenerNotFound = Listener not found.
-EventSource_ListenerCreatedInsideCallback = Creating an EventListener inside a EventListener callback.
-EventSource_AttributeOnNonVoid = Event attribute placed on method {0} which does not return 'void'.
-EventSource_NeedPositiveId = Event IDs must be positive integers.
-EventSource_ReservedOpcode = Opcode values less than 11 are reserved for system use.
-EventSource_ReservedKeywords = Keywords values larger than 0x0000100000000000 are reserved for system use
-EventSource_PayloadTooBig=The payload for a single event is too large.
-EventSource_NoFreeBuffers=No Free Buffers available from the operating system (e.g. event rate too fast).
-EventSource_NullInput=Null passed as a event argument.
-EventSource_TooManyArgs=Too many arguments.
-EventSource_SessionIdError=Bit position in AllKeywords ({0}) must equal the command argument named "EtwSessionKeyword" ({1}).
-EventSource_EnumKindMismatch = The type of {0} is not expected in {1}.
-EventSource_MismatchIdToWriteEvent = Event {0} is givien event ID {1} but {2} was passed to WriteEvent.
-EventSource_EventIdReused = Event {0} has ID {1} which is already in use.
-EventSource_EventNameReused = Event name {0} used more than once. If you wish to overload a method, the overloaded method should have a NonEvent attribute.
-EventSource_UndefinedChannel = Use of undefined channel value {0} for event {1}.
-EventSource_UndefinedOpcode = Use of undefined opcode value {0} for event {1}.
-ArgumentOutOfRange_MaxArgExceeded = The total number of parameters must not exceed {0}.
-ArgumentOutOfRange_MaxStringsExceeded = The number of String parameters must not exceed {0}.
-ArgumentOutOfRange_NeedValidId = The ID parameter must be in the range {0} through {1}.
-EventSource_NeedGuid = The Guid of an EventSource must be non zero.
-EventSource_NeedName = The name of an EventSource must not be null.
-EventSource_EtwAlreadyRegistered = The provider has already been registered with the operating system.
-EventSource_ListenerWriteFailure = An error occurred when writing to a listener.
-EventSource_TypeMustDeriveFromEventSource = Event source types must derive from EventSource.
-EventSource_TypeMustBeSealedOrAbstract = Event source types must be sealed or abstract.
-EventSource_TaskOpcodePairReused = Event {0} (with ID {1}) has the same task/opcode pair as event {2} (with ID {3}).
-EventSource_EventMustHaveTaskIfNonDefaultOpcode = Event {0} (with ID {1}) has a non-default opcode but not a task.
-EventSource_EventNameDoesNotEqualTaskPlusOpcode = Event {0} (with ID {1}) has a name that is not the concatenation of its task name and opcode.
-EventSource_PeriodIllegalInProviderName = Period character ('.') is illegal in an ETW provider name ({0}).
-EventSource_IllegalOpcodeValue = Opcode {0} has a value of {1} which is outside the legal range (11-238).
-EventSource_OpcodeCollision = Opcodes {0} and {1} are defined with the same value ({2}).
-EventSource_IllegalTaskValue = Task {0} has a value of {1} which is outside the legal range (1-65535).
-EventSource_TaskCollision = Tasks {0} and {1} are defined with the same value ({2}).
-EventSource_IllegalKeywordsValue = Keyword {0} has a value of {1} which is outside the legal range (0-0x0000080000000000).
-EventSource_KeywordCollision = Keywords {0} and {1} are defined with the same value ({2}).
-EventSource_EventChannelOutOfRange = Channel {0} has a value of {1} which is outside the legal range (16-254).
-EventSource_ChannelTypeDoesNotMatchEventChannelValue = Channel {0} does not match event channel value {1}.
-EventSource_MaxChannelExceeded = Attempt to define more than the maximum limit of 8 channels for a provider.
-EventSource_DuplicateStringKey = Multiple definitions for string "{0}".
-EventSource_EventWithAdminChannelMustHaveMessage = Event {0} specifies an Admin channel {1}. It must specify a Message property.
-EventSource_UnsupportedMessageProperty = Event {0} specifies an illegal or unsupported formatting message ("{1}").
-EventSource_AbstractMustNotDeclareKTOC = Abstract event source must not declare {0} nested type.
-EventSource_AbstractMustNotDeclareEventMethods = Abstract event source must not declare event methods ({0} with ID {1}).
-EventSource_EventMustNotBeExplicitImplementation = Event method {0} (with ID {1}) is an explicit interface method implementation. Re-write method as implicit implementation.
-EventSource_EventParametersMismatch = Event {0} was called with {1} argument(s), but it is defined with {2} parameter(s).
-EventSource_InvalidCommand = Invalid command value.
-EventSource_InvalidEventFormat = Can't specify both etw event format flags.
-EventSource_AddScalarOutOfRange = Getting out of bounds during scalar addition.
-EventSource_PinArrayOutOfRange = Pins are out of range.
-EventSource_DataDescriptorsOutOfRange = Data descriptors are out of range.
-EventSource_NotSupportedArrayOfNil = Arrays of Nil are not supported.
-EventSource_NotSupportedArrayOfBinary = Arrays of Binary are not supported.
-EventSource_NotSupportedArrayOfNullTerminatedString = Arrays of null-terminated string are not supported.
-EventSource_TooManyFields = Too many fields in structure.
-EventSource_RecursiveTypeDefinition = Recursive type definition is not supported.
-EventSource_NotSupportedEnumType = Enum type {0} underlying type {1} is not supported for serialization.
-EventSource_NonCompliantTypeError = The API supports only anonymous types or types decorated with the EventDataAttribute. Non-compliant type: {0} dataType.
-EventSource_NotSupportedNestedArraysEnums = Nested arrays/enumerables are not supported.
-EventSource_IncorrentlyAuthoredTypeInfo = Incorrectly-authored TypeInfo - a type should be serialized as one field or as one group
-EventSource_NotSupportedCustomSerializedData = Enumerables of custom-serialized data are not supported
-EventSource_StopsFollowStarts = An event with stop suffix must follow a corresponding event with a start suffix.
-EventSource_NoRelatedActivityId = EventSource expects the first parameter of the Event method to be of type Guid and to be named "relatedActivityId" when calling WriteEventWithRelatedActivityId.
-EventSource_VarArgsParameterMismatch = The parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly.
-
-; ExecutionEngineException
-ExecutionEngine_InvalidAttribute = Attribute cannot have multiple definitions.
-ExecutionEngine_MissingSecurityDescriptor = Unable to retrieve security descriptor for this frame.
-
-;;ExecutionContext
-ExecutionContext_UndoFailed = Undo operation on a component context threw an exception
-ExecutionContext_ExceptionInAsyncLocalNotification = An exception was not handled in an AsyncLocal<T> notification callback.
-
-
-; FieldAccessException
-FieldAccess_InitOnly = InitOnly (aka ReadOnly) fields can only be initialized in the type/instance constructor.
-
-; FormatException
-Format_AttributeUsage = Duplicate AttributeUsageAttribute found on attribute type {0}.
-Format_Bad7BitInt32 = Too many bytes in what should have been a 7 bit encoded Int32.
-Format_BadBase = Invalid digits for the specified base.
-Format_BadBase64Char = The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
-Format_BadBase64CharArrayLength = Invalid length for a Base-64 char array or string.
-Format_BadBoolean = String was not recognized as a valid Boolean.
-Format_BadDateTime = String was not recognized as a valid DateTime.
-Format_BadDateTimeCalendar = The DateTime represented by the string is not supported in calendar {0}.
-Format_BadDayOfWeek = String was not recognized as a valid DateTime because the day of week was incorrect.
-Format_DateOutOfRange = The DateTime represented by the string is out of range.
-Format_BadDatePattern = Could not determine the order of year, month, and date from '{0}'.
-Format_BadFormatSpecifier = Format specifier was invalid.
-Format_BadTimeSpan = String was not recognized as a valid TimeSpan.
-Format_BadQuote = Cannot find a matching quote character for the character '{0}'.
-Format_EmptyInputString = Input string was either empty or contained only whitespace.
-Format_ExtraJunkAtEnd = Additional non-parsable characters are at the end of the string.
-Format_GuidBrace = Expected {0xdddddddd, etc}.
-Format_GuidComma = Could not find a comma, or the length between the previous token and the comma was zero (i.e., '0x,'etc.).
-Format_GuidBraceAfterLastNumber = Could not find a brace, or the length between the previous token and the brace was zero (i.e., '0x,'etc.).
-Format_GuidDashes = Dashes are in the wrong position for GUID parsing.
-Format_GuidEndBrace = Could not find the ending brace.
-Format_GuidHexPrefix = Expected hex 0x in '{0}'.
-Format_GuidInvLen = Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
-Format_GuidInvalidChar = Guid string should only contain hexadecimal characters.
-Format_GuidUnrecognized = Unrecognized Guid format.
-Format_InvalidEnumFormatSpecification = Format String can be only "G", "g", "X", "x", "F", "f", "D" or "d".
-Format_InvalidGuidFormatSpecification = Format String can be only "D", "d", "N", "n", "P", "p", "B", "b", "X" or "x".
-Format_InvalidString = Input string was not in a correct format.
-Format_IndexOutOfRange = Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
-Format_UnknowDateTimeWord = The string was not recognized as a valid DateTime. There is an unknown word starting at index {0}.
-Format_NeedSingleChar = String must be exactly one character long.
-Format_NoParsibleDigits = Could not find any recognizable digits.
-Format_RepeatDateTimePattern = DateTime pattern '{0}' appears more than once with different values.
-Format_StringZeroLength = String cannot have zero length.
-Format_TwoTimeZoneSpecifiers = The String being parsed cannot contain two TimeZone specifiers.
-Format_UTCOutOfRange= The UTC representation of the date falls outside the year range 1-9999.
-Format_OffsetOutOfRange=The time zone offset must be within plus or minus 14 hours.
-Format_MissingIncompleteDate=There must be at least a partial date with a year present in the input.
-
-; IndexOutOfRangeException
-IndexOutOfRange_ArrayRankIndex = Array does not have that many dimensions.
-IndexOutOfRange_IORaceCondition = Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
-IndexOutOfRange_UMSPosition = Unmanaged memory stream position was beyond the capacity of the stream.
-
-; InsufficientMemoryException
-InsufficientMemory_MemFailPoint = Insufficient available memory to meet the expected demands of an operation at this time. Please try again later.
-InsufficientMemory_MemFailPoint_TooBig = Insufficient memory to meet the expected demands of an operation, and this system is likely to never satisfy this request. If this is a 32 bit system, consider booting in 3 GB mode.
-InsufficientMemory_MemFailPoint_VAFrag = Insufficient available memory to meet the expected demands of an operation at this time, possibly due to virtual address space fragmentation. Please try again later.
-
-
-; InvalidCastException
-InvalidCast_DBNull = Object cannot be cast to DBNull.
-InvalidCast_DownCastArrayElement = At least one element in the source array could not be cast down to the destination array type.
-InvalidCast_Empty = Object cannot be cast to Empty.
-InvalidCast_FromDBNull = Object cannot be cast from DBNull to other types.
-InvalidCast_FromTo = Invalid cast from '{0}' to '{1}'.
-InvalidCast_IConvertible = Object must implement IConvertible.
-InvalidCast_OATypeMismatch = OleAut reported a type mismatch.
-InvalidCast_StoreArrayElement = Object cannot be stored in an array of this type.
-InvalidCast_CannotCoerceByRefVariant = Object cannot be coerced to the original type of the ByRef VARIANT it was obtained from.
-InvalidCast_CannotCastNullToValueType = Null object cannot be converted to a value type.
-#if FEATURE_COMINTEROP
-InvalidCast_WinRTIPropertyValueElement = Object in an IPropertyValue is of type '{0}', which cannot be converted to a '{1}'.
-InvalidCast_WinRTIPropertyValueCoersion = Object in an IPropertyValue is of type '{0}' with value '{1}', which cannot be converted to a '{2}'.
-InvalidCast_WinRTIPropertyValueArrayCoersion = Object in an IPropertyValue is of type '{0}' which cannot be convereted to a '{1}' due to array element '{2}': {3}.
-#endif // FEATURE_COMINTEROP
-
-; InvalidOperationException
-InvalidOperation_ActivationArgsAppTrustMismatch = The activation arguments and application trust for the AppDomain must correspond to the same application identity.
-InvalidOperation_AddContextFrozen = Attempted to add properties to a frozen context.
-InvalidOperation_AppDomainSandboxAPINeedsExplicitAppBase = This API requires the ApplicationBase to be specified explicitly in the AppDomainSetup parameter.
-InvalidOperation_CantCancelCtrlBreak = Applications may not prevent control-break from terminating their process.
-InvalidOperation_CalledTwice = The method cannot be called twice on the same instance.
-InvalidOperation_CollectionCorrupted = A prior operation on this collection was interrupted by an exception. Collection's state is no longer trusted.
-InvalidOperation_CriticalTransparentAreMutuallyExclusive = SecurityTransparent and SecurityCritical attributes cannot be applied to the assembly scope at the same time.
-InvalidOperation_ExceptionStateCrossAppDomain = Thread.ExceptionState cannot access an ExceptionState from a different AppDomain.
-InvalidOperation_DebuggerLaunchFailed = Debugger unable to launch.
-InvalidOperation_ApartmentStateSwitchFailed = Failed to set the specified COM apartment state.
-InvalidOperation_EmptyQueue = Queue empty.
-InvalidOperation_EmptyStack = Stack empty.
-InvalidOperation_CannotRemoveFromStackOrQueue = Removal is an invalid operation for Stack or Queue.
-InvalidOperation_EnumEnded = Enumeration already finished.
-InvalidOperation_EnumFailedVersion = Collection was modified; enumeration operation may not execute.
-InvalidOperation_EnumNotStarted = Enumeration has not started. Call MoveNext.
-InvalidOperation_EnumOpCantHappen = Enumeration has either not started or has already finished.
-InvalidOperation_ModifyRONumFmtInfo = Unable to modify a read-only NumberFormatInfo object.
-InvalidOperation_MustBeSameThread = This operation must take place on the same thread on which the object was created.
-InvalidOperation_MustRevertPrivilege = Must revert the privilege prior to attempting this operation.
-InvalidOperation_ReadOnly = Instance is read-only.
-InvalidOperation_RegRemoveSubKey = Registry key has subkeys and recursive removes are not supported by this method.
-InvalidOperation_IComparerFailed = Failed to compare two elements in the array.
-InvalidOperation_InternalState = Invalid internal state.
-InvalidOperation_DuplicatePropertyName = Another property by this name already exists.
-InvalidOperation_NotCurrentDomain = You can only define a dynamic assembly on the current AppDomain.
-InvalidOperation_ContextAlreadyFrozen = Context is already frozen.
-InvalidOperation_WriteOnce = This property has already been set and cannot be modified.
-InvalidOperation_MethodBaked = Type definition of the method is complete.
-InvalidOperation_MethodHasBody = Method already has a body.
-InvalidOperation_ModificationOfNonCanonicalAcl = This access control list is not in canonical form and therefore cannot be modified.
-InvalidOperation_Method = This method is not supported by the current object.
-InvalidOperation_NativeOverlappedReused = NativeOverlapped cannot be reused for multiple operations.
-InvalidOperation_NotADebugModule = Not a debug ModuleBuilder.
-InvalidOperation_NoMultiModuleAssembly = You cannot have more than one dynamic module in each dynamic assembly in this version of the runtime.
-InvalidOperation_OpenLocalVariableScope = Local variable scope was not properly closed.
-InvalidOperation_SetVolumeLabelFailed = Volume labels can only be set for writable local volumes.
-InvalidOperation_SetData = An additional permission should not be supplied for setting loader information.
-InvalidOperation_SetData_OnlyOnce = SetData can only be used to set the value of a given name once.
-InvalidOperation_SetData_OnlyLocationURI = SetData cannot be used to set the value for '{0}'.
-InvalidOperation_TypeHasBeenCreated = Unable to change after type has been created.
-InvalidOperation_TypeNotCreated = Type has not been created.
-InvalidOperation_NoUnderlyingTypeOnEnum = Underlying type information on enumeration is not specified.
-InvalidOperation_ResMgrBadResSet_Type = '{0}': ResourceSet derived classes must provide a constructor that takes a String file name and a constructor that takes a Stream.
-InvalidOperation_AssemblyHasBeenSaved = Assembly '{0}' has been saved.
-InvalidOperation_ModuleHasBeenSaved = Module '{0}' has been saved.
-InvalidOperation_CannotAlterAssembly = Unable to alter assembly information.
-InvalidOperation_BadTransientModuleReference = Unable to make a reference to a transient module from a non-transient module.
-InvalidOperation_BadILGeneratorUsage = ILGenerator usage is invalid.
-InvalidOperation_BadInstructionOrIndexOutOfBound = MSIL instruction is invalid or index is out of bounds.
-InvalidOperation_ShouldNotHaveMethodBody = Method body should not exist.
-InvalidOperation_EntryMethodNotDefinedInAssembly = Entry method is not defined in the same assembly.
-InvalidOperation_CantSaveTransientAssembly = Cannot save a transient assembly.
-InvalidOperation_BadResourceContainer = Unable to add resource to transient module or transient assembly.
-InvalidOperation_CantInstantiateAbstractClass = Instances of abstract classes cannot be created.
-InvalidOperation_CantInstantiateFunctionPointer = Instances of function pointers cannot be created.
-InvalidOperation_BadTypeAttributesNotAbstract = Type must be declared abstract if any of its methods are abstract.
-InvalidOperation_BadInterfaceNotAbstract = Interface must be declared abstract.
-InvalidOperation_ConstructorNotAllowedOnInterface = Interface cannot have constructors.
-InvalidOperation_BadMethodBody = Method '{0}' cannot have a method body.
-InvalidOperation_MetaDataError = Metadata operation failed.
-InvalidOperation_BadEmptyMethodBody = Method '{0}' does not have a method body.
-InvalidOperation_EndInvokeCalledMultiple = EndInvoke can only be called once for each asynchronous operation.
-InvalidOperation_EndReadCalledMultiple = EndRead can only be called once for each asynchronous operation.
-InvalidOperation_EndWriteCalledMultiple = EndWrite can only be called once for each asynchronous operation.
-InvalidOperation_AsmLoadedForReflectionOnly = Assembly has been loaded as ReflectionOnly. This API requires an assembly capable of execution.
-InvalidOperation_NoAsmName = Assembly does not have an assembly name. In order to be registered for use by COM, an assembly must have a valid assembly name.
-InvalidOperation_NoAsmCodeBase = Assembly does not have a code base.
-InvalidOperation_HandleIsNotInitialized = Handle is not initialized.
-InvalidOperation_HandleIsNotPinned = Handle is not pinned.
-InvalidOperation_SlotHasBeenFreed = LocalDataStoreSlot storage has been freed.
-InvalidOperation_GlobalsHaveBeenCreated = Type definition of the global function has been completed.
-InvalidOperation_NotAVarArgCallingConvention = Calling convention must be VarArgs.
-InvalidOperation_CannotImportGlobalFromDifferentModule = Unable to import a global method or field from a different module.
-InvalidOperation_NonStaticComRegFunction = COM register function must be static.
-InvalidOperation_NonStaticComUnRegFunction = COM unregister function must be static.
-InvalidOperation_InvalidComRegFunctionSig = COM register function must have a System.Type parameter and a void return type.
-InvalidOperation_InvalidComUnRegFunctionSig = COM unregister function must have a System.Type parameter and a void return type.
-InvalidOperation_MultipleComRegFunctions = Type '{0}' has more than one COM registration function.
-InvalidOperation_MultipleComUnRegFunctions = Type '{0}' has more than one COM unregistration function.
-InvalidOperation_MustCallInitialize = You must call Initialize on this object instance before using it.
-InvalidOperation_MustLockForReadOrWrite = Object must be locked for read or write.
-InvalidOperation_MustLockForWrite = Object must be locked for read.
-InvalidOperation_NoValue = Nullable object must have a value.
-InvalidOperation_ResourceNotStream_Name = Resource '{0}' was not a Stream - call GetObject instead.
-InvalidOperation_ResourceNotString_Name = Resource '{0}' was not a String - call GetObject instead.
-InvalidOperation_ResourceNotString_Type = Resource was of type '{0}' instead of String - call GetObject instead.
-InvalidOperation_ResourceWriterSaved = The resource writer has already been closed and cannot be edited.
-InvalidOperation_UnderlyingArrayListChanged = This range in the underlying list is invalid. A possible cause is that elements were removed.
-InvalidOperation_AnonymousCannotImpersonate = An anonymous identity cannot perform an impersonation.
-InvalidOperation_DefaultConstructorILGen = Unable to access ILGenerator on a constructor created with DefineDefaultConstructor.
-InvalidOperation_DefaultConstructorDefineBody = The method body of the default constructor cannot be changed.
-InvalidOperation_ComputerName = Computer name could not be obtained.
-InvalidOperation_MismatchedAsyncResult = The IAsyncResult object provided does not match this delegate.
-InvalidOperation_PIAMustBeStrongNamed = Primary interop assemblies must be strongly named.
-InvalidOperation_HashInsertFailed = Hashtable insert failed. Load factor too high. The most common cause is multiple threads writing to the Hashtable simultaneously.
-InvalidOperation_UnknownEnumType = Unknown enum type.
-InvalidOperation_GetVersion = OSVersion's call to GetVersionEx failed.
-InvalidOperation_DateTimeParsing = Internal Error in DateTime and Calendar operations.
-InvalidOperation_UserDomainName = UserDomainName native call failed.
-InvalidOperation_WaitOnTransparentProxy = Cannot wait on a transparent proxy.
-InvalidOperation_NoPublicAddMethod = Cannot add the event handler since no public add method exists for the event.
-InvalidOperation_NoPublicRemoveMethod = Cannot remove the event handler since no public remove method exists for the event.
-InvalidOperation_NotSupportedOnWinRTEvent = Adding or removing event handlers dynamically is not supported on WinRT events.
-InvalidOperation_ConsoleKeyAvailableOnFile = Cannot see if a key has been pressed when either application does not have a console or when console input has been redirected from a file. Try Console.In.Peek.
-InvalidOperation_ConsoleReadKeyOnFile = Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
-InvalidOperation_ThreadWrongThreadStart = The thread was created with a ThreadStart delegate that does not accept a parameter.
-InvalidOperation_ThreadAPIsNotSupported = Use CompressedStack.(Capture/Run) or ExecutionContext.(Capture/Run) APIs instead.
-InvalidOperation_NotNewCaptureContext = Cannot apply a context that has been marshaled across AppDomains, that was not acquired through a Capture operation or that has already been the argument to a Set call.
-InvalidOperation_NullContext = Cannot call Set on a null context
-InvalidOperation_CannotCopyUsedContext = Only newly captured contexts can be copied
-InvalidOperation_CannotUseSwitcherOtherThread = Undo operation must be performed on the thread where the corresponding context was Set.
-InvalidOperation_SwitcherCtxMismatch = The Undo operation encountered a context that is different from what was applied in the corresponding Set operation. The possible cause is that a context was Set on the thread and not reverted(undone).
-InvalidOperation_CannotOverrideSetWithoutRevert = Must override both HostExecutionContextManager.SetHostExecutionContext and HostExecutionContextManager.Revert.
-InvalidOperation_CannotUseAFCOtherThread = AsyncFlowControl object must be used on the thread where it was created.
-InvalidOperation_CannotRestoreUnsupressedFlow = Cannot restore context flow when it is not suppressed.
-InvalidOperation_CannotSupressFlowMultipleTimes = Context flow is already suppressed.
-InvalidOperation_CannotUseAFCMultiple = AsyncFlowControl object can be used only once to call Undo().
-InvalidOperation_AsyncFlowCtrlCtxMismatch = AsyncFlowControl objects can be used to restore flow only on a Context that had its flow suppressed.
-InvalidOperation_TimeoutsNotSupported = Timeouts are not supported on this stream.
-InvalidOperation_Overlapped_Pack = Cannot pack a packed Overlapped again.
-InvalidOperation_OnlyValidForDS = Adding ACEs with Object Flags and Object GUIDs is only valid for directory-object ACLs.
-InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple = Either the IAsyncResult object did not come from the corresponding async method on this type, or EndRead was called multiple times with the same IAsyncResult.
-InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple = Either the IAsyncResult object did not come from the corresponding async method on this type, or EndWrite was called multiple times with the same IAsyncResult.
-InvalidOperation_WrongAsyncResultOrEndCalledMultiple = Either the IAsyncResult object did not come from the corresponding async method on this type, or the End method was called multiple times with the same IAsyncResult.
-InvalidOperation_NoSecurityDescriptor = The object does not contain a security descriptor.
-InvalidOperation_NotAllowedInReflectionOnly = The requested operation is invalid in the ReflectionOnly context.
-InvalidOperation_NotAllowedInDynamicMethod = The requested operation is invalid for DynamicMethod.
-InvalidOperation_PropertyInfoNotAvailable = This API does not support PropertyInfo tokens.
-InvalidOperation_EventInfoNotAvailable = This API does not support EventInfo tokens.
-InvalidOperation_UnexpectedWin32Error = Unexpected error when calling an operating system function. The returned error code is 0x{0:x}.
-InvalidOperation_AssertTransparentCode = Cannot perform CAS Asserts in Security Transparent methods
-InvalidOperation_NullModuleHandle = The requested operation is invalid when called on a null ModuleHandle.
-InvalidOperation_NotWithConcurrentGC = This API is not available when the concurrent GC is enabled.
-InvalidOperation_WithoutARM = This API is not available when AppDomain Resource Monitoring is not turned on.
-InvalidOperation_NotGenericType = This operation is only valid on generic types.
-InvalidOperation_TypeCannotBeBoxed = The given type cannot be boxed.
-InvalidOperation_HostModifiedSecurityState = The security state of an AppDomain was modified by an AppDomainManager configured with the NoSecurityChanges flag.
-InvalidOperation_StrongNameKeyPairRequired = A strong name key pair is required to emit a strong-named dynamic assembly.
-#if FEATURE_COMINTEROP
-InvalidOperation_EventTokenTableRequiresDelegate = Type '{0}' is not a delegate type. EventTokenTable may only be used with delegate types.
-#endif // FEATURE_COMINTEROP
-InvalidOperation_NullArray = The underlying array is null.
-;system.security.claims
-InvalidOperation_ClaimCannotBeRemoved = The Claim '{0}' was not able to be removed. It is either not part of this Identity or it is a claim that is owned by the Principal that contains this Identity. For example, the Principal will own the claim when creating a GenericPrincipal with roles. The roles will be exposed through the Identity that is passed in the constructor, but not actually owned by the Identity. Similar logic exists for a RolePrincipal.
-InvalidOperationException_ActorGraphCircular = Actor cannot be set so that circular directed graph will exist chaining the subjects together.
-InvalidOperation_AsyncIOInProgress = The stream is currently in use by a previous operation on the stream.
-InvalidOperation_APIInvalidForCurrentContext = The API '{0}' cannot be used on the current platform. See http://go.microsoft.com/fwlink/?LinkId=248273 for more information.
-
-; InvalidProgramException
-InvalidProgram_Default = Common Language Runtime detected an invalid program.
-
-; Verification Exception
-Verification_Exception = Operation could destabilize the runtime.
-
-; IL stub marshaler exceptions
-Marshaler_StringTooLong = Marshaler restriction: Excessively long string.
-
-; Missing (General)
-MissingConstructor_Name = Constructor on type '{0}' not found.
-MissingField = Field not found.
-MissingField_Name = Field '{0}' not found.
-MissingMember = Member not found.
-MissingMember_Name = Member '{0}' not found.
-MissingMethod_Name = Method '{0}' not found.
-MissingModule = Module '{0}' not found.
-MissingType = Type '{0}' not found.
-
-; MissingManifestResourceException
-Arg_MissingManifestResourceException = Unable to find manifest resource.
-MissingManifestResource_LooselyLinked = Could not find a manifest resource entry called "{0}" in assembly "{1}". Please check spelling, capitalization, and build rules to ensure "{0}" is being linked into the assembly.
-MissingManifestResource_NoNeutralAsm = Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "{0}" was correctly embedded or linked into assembly "{1}" at compile time, or that all the satellite assemblies required are loadable and fully signed.
-MissingManifestResource_NoNeutralDisk = Could not find any resources appropriate for the specified culture (or the neutral culture) on disk.
-MissingManifestResource_MultipleBlobs = A case-insensitive lookup for resource file "{0}" in assembly "{1}" found multiple entries. Remove the duplicates or specify the exact case.
-MissingManifestResource_ResWFileNotLoaded = Unable to load resources for resource file "{0}" in package "{1}".
-MissingManifestResource_NoPRIresources = Unable to open Package Resource Index.
-
-; MissingMember
-MissingMemberTypeRef = FieldInfo does not match the target Type.
-MissingMemberNestErr = TypedReference can only be made on nested value Types.
-
-; MissingSatelliteAssemblyException
-MissingSatelliteAssembly_Default = Resource lookup fell back to the ultimate fallback resources in a satellite assembly, but that satellite either was not found or could not be loaded. Please consider reinstalling or repairing the application.
-MissingSatelliteAssembly_Culture_Name = The satellite assembly named "{1}" for fallback culture "{0}" either could not be found or could not be loaded. This is generally a setup problem. Please consider reinstalling or repairing the application.
-
-; MulticastNotSupportedException
-Multicast_Combine = Delegates that are not of type MulticastDelegate may not be combined.
-
-; NotImplementedException
-Arg_NotImplementedException = The method or operation is not implemented.
-NotImplemented_ResourcesLongerThan2^63 = Resource files longer than 2^63 bytes are not currently implemented.
-
-; NotSupportedException
-NotSupported_NYI = This feature is not currently implemented.
-NotSupported_AbstractNonCLS = This non-CLS method is not implemented.
-NotSupported_ChangeType = ChangeType operation is not supported.
-NotSupported_ByRefLike = Cannot create boxed ByRef-like values.
-NotSupported_ByRefLike[] = Cannot create arrays of ByRef-like values.
-NotSupported_OpenType = Cannot create arrays of open type.
-NotSupported_DBNullSerial = Only one DBNull instance may exist, and calls to DBNull deserialization methods are not allowed.
-NotSupported_DelegateSerHolderSerial = DelegateSerializationHolder objects are designed to represent a delegate during serialization and are not serializable themselves.
-NotSupported_DelegateCreationFromPT = Application code cannot use Activator.CreateInstance to create types that derive from System.Delegate. Delegate.CreateDelegate can be used instead.
-NotSupported_EncryptionNeedsNTFS = File encryption support only works on NTFS partitions.
-NotSupported_FileStreamOnNonFiles = FileStream was asked to open a device that was not a file. For support for devices like 'com1:' or 'lpt1:', call CreateFile, then use the FileStream constructors that take an OS handle as an IntPtr.
-NotSupported_FixedSizeCollection = Collection was of a fixed size.
-NotSupported_KeyCollectionSet = Mutating a key collection derived from a dictionary is not allowed.
-NotSupported_ValueCollectionSet = Mutating a value collection derived from a dictionary is not allowed.
-NotSupported_MemStreamNotExpandable = Memory stream is not expandable.
-NotSupported_ObsoleteResourcesFile = Found an obsolete .resources file in assembly '{0}'. Rebuild that .resources file then rebuild that assembly.
-NotSupported_OleAutBadVarType = The given Variant type is not supported by this OleAut function.
-NotSupported_PopulateData = This Surrogate does not support PopulateData().
-NotSupported_ReadOnlyCollection = Collection is read-only.
-NotSupported_RangeCollection = The specified operation is not supported on Ranges.
-NotSupported_SortedListNestedWrite = This operation is not supported on SortedList nested types because they require modifying the original SortedList.
-NotSupported_SubclassOverride = Derived classes must provide an implementation.
-NotSupported_TypeCannotDeserialized = Direct deserialization of type '{0}' is not supported.
-NotSupported_UnreadableStream = Stream does not support reading.
-NotSupported_UnseekableStream = Stream does not support seeking.
-NotSupported_UnwritableStream = Stream does not support writing.
-NotSupported_CannotWriteToBufferedStreamIfReadBufferCannotBeFlushed = Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream.
-NotSupported_Method = Method is not supported.
-NotSupported_Constructor = Object cannot be created through this constructor.
-NotSupported_DynamicModule = The invoked member is not supported in a dynamic module.
-NotSupported_TypeNotYetCreated = The invoked member is not supported before the type is created.
-NotSupported_SymbolMethod = Not supported in an array method of a type definition that is not complete.
-NotSupported_NotDynamicModule = The MethodRental.SwapMethodBody method can only be called to swap the method body of a method in a dynamic module.
-NotSupported_DynamicAssembly = The invoked member is not supported in a dynamic assembly.
-NotSupported_NotAllTypesAreBaked = Type '{0}' was not completed.
-NotSupported_CannotSaveModuleIndividually = Unable to save a ModuleBuilder if it was created underneath an AssemblyBuilder. Call Save on the AssemblyBuilder instead.
-NotSupported_MaxWaitHandles = The number of WaitHandles must be less than or equal to 64.
-NotSupported_IllegalOneByteBranch = Illegal one-byte branch at position: {0}. Requested branch was: {1}.
-NotSupported_OutputStreamUsingTypeBuilder = Output streams do not support TypeBuilders.
-NotSupported_ValueClassCM = Custom marshalers for value types are not currently supported.
-NotSupported_Void[] = Arrays of System.Void are not supported.
-NotSupported_NoParentDefaultConstructor = Parent does not have a default constructor. The default constructor must be explicitly defined.
-NotSupported_NonReflectedType = Not supported in a non-reflected type.
-NotSupported_GlobalFunctionNotBaked = The type definition of the global function is not completed.
-NotSupported_SecurityPermissionUnion = Union is not implemented.
-NotSupported_UnitySerHolder = The UnitySerializationHolder object is designed to transmit information about other types and is not serializable itself.
-NotSupported_UnknownTypeCode = TypeCode '{0}' was not valid.
-NotSupported_WaitAllSTAThread = WaitAll for multiple handles on a STA thread is not supported.
-NotSupported_SignalAndWaitSTAThread = SignalAndWait on a STA thread is not supported.
-NotSupported_CreateInstanceWithTypeBuilder = CreateInstance cannot be used with an object of type TypeBuilder.
-NotSupported_NonUrlAttrOnMBR = UrlAttribute is the only attribute supported for MarshalByRefObject.
-NotSupported_ActivAttrOnNonMBR = Activation Attributes are not supported for types not deriving from MarshalByRefObject.
-NotSupported_ActivAttr = Activation Attributes are not supported.
-NotSupported_ActivForCom = Activation Attributes not supported for COM Objects.
-NotSupported_NoCodepageData = No data is available for encoding {0}. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
-NotSupported_CodePage50229 = The ISO-2022-CN Encoding (Code page 50229) is not supported.
-NotSupported_DynamicAssemblyNoRunAccess = Cannot execute code on a dynamic assembly without run access.
-NotSupported_IDispInvokeDefaultMemberWithNamedArgs = Invoking default method with named arguments is not supported.
-NotSupported_Type = Type is not supported.
-NotSupported_GetMethod = The 'get' method is not supported on this property.
-NotSupported_SetMethod = The 'set' method is not supported on this property.
-NotSupported_DeclarativeUnion = Declarative unionizing of these permissions is not supported.
-NotSupported_StringComparison = The string comparison type passed in is currently not supported.
-NotSupported_WrongResourceReader_Type = This .resources file should not be read with this reader. The resource reader type is "{0}".
-NotSupported_MustBeModuleBuilder = Module argument must be a ModuleBuilder.
-NotSupported_CallToVarArg = Vararg calling convention not supported.
-NotSupported_TooManyArgs = Stack size too deep. Possibly too many arguments.
-NotSupported_DeclSecVarArg = Assert, Deny, and PermitOnly are not supported on methods with a Vararg calling convention.
-NotSupported_AmbiguousIdentity = The operation is ambiguous because the permission represents multiple identities.
-NotSupported_DynamicMethodFlags = Wrong MethodAttributes or CallingConventions for DynamicMethod. Only public, static, standard supported
-NotSupported_GlobalMethodSerialization = Serialization of global methods (including implicit serialization via the use of asynchronous delegates) is not supported.
-NotSupported_InComparableType = A type must implement IComparable<T> or IComparable to support comparison.
-NotSupported_ManagedActivation = Cannot create uninitialized instances of types requiring managed activation.
-NotSupported_ByRefReturn = ByRef return value not supported in reflection invocation.
-NotSupported_DelegateMarshalToWrongDomain = Delegates cannot be marshaled from native code into a domain other than their home domain.
-NotSupported_ResourceObjectSerialization = Cannot read resources that depend on serialization.
-NotSupported_One = The arithmetic type '{0}' cannot represent the number one.
-NotSupported_Zero = The arithmetic type '{0}' cannot represent the number zero.
-NotSupported_MaxValue = The arithmetic type '{0}' does not have a maximum value.
-NotSupported_MinValue = The arithmetic type '{0}' does not have a minimum value.
-NotSupported_PositiveInfinity = The arithmetic type '{0}' cannot represent positive infinity.
-NotSupported_NegativeInfinity = The arithmetic type '{0}' cannot represent negative infinity.
-NotSupported_UmsSafeBuffer = This operation is not supported for an UnmanagedMemoryStream created from a SafeBuffer.
-NotSupported_Reading = Accessor does not support reading.
-NotSupported_Writing = Accessor does not support writing.
-NotSupported_UnsafePointer = This accessor was created with a SafeBuffer; use the SafeBuffer to gain access to the pointer.
-NotSupported_CollectibleCOM = COM Interop is not supported for collectible types.
-NotSupported_CollectibleAssemblyResolve = Resolving to a collectible assembly is not supported.
-NotSupported_CollectibleBoundNonCollectible = A non-collectible assembly may not reference a collectible assembly.
-NotSupported_CollectibleDelegateMarshal = Delegate marshaling for types within collectible assemblies is not supported.
-NotSupported_NonStaticMethod = Non-static methods with NativeCallableAttribute are not supported.
-NotSupported_NativeCallableTarget = Methods with NativeCallableAttribute cannot be used as delegate target.
-NotSupported_GenericMethod = Generic methods with NativeCallableAttribute are not supported.
-NotSupported_NonBlittableTypes = Non-blittable parameter types are not supported for NativeCallable methods.
-
-NotSupported_UserDllImport = DllImport cannot be used on user-defined methods.
-NotSupported_UserCOM = COM Interop is not supported for user-defined types.
-
-#if FEATURE_APPX
-NotSupported_AppX = {0} is not supported in AppX.
-LoadOfFxAssemblyNotSupported_AppX = {0} of .NET Framework assemblies is not supported in AppX.
-#endif
-#if FEATURE_COMINTEROP
-NotSupported_WinRT_PartialTrust = Windows Runtime is not supported in partial trust.
-#endif // FEATURE_COMINTEROP
-; ReflectionTypeLoadException
-ReflectionTypeLoad_LoadFailed = Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
-#if FEATURE_COMINTEROP
-NotSupported_PIAInAppxProcess = A Primary Interop Assembly is not supported in AppX.
-#endif
-NotSupported_AssemblyLoadCodeBase = Assembly.Load with a Codebase is not supported.
-NotSupported_AssemblyLoadFromHash = Assembly.LoadFrom with hashValue is not supported.
-NotSupported_CannotCallEqualsOnSpan = Equals() on Span and ReadOnlySpan is not supported. Use operator== instead.
-NotSupported_CannotCallGetHashCodeOnSpan = GetHashCode() on Span and ReadOnlySpan is not supported.
-NotSupported_ReflectionOnlyLoad = Assembly.ReflectionOnlyLoad is not supported.
-NotSupported_ReflectionOnlyGetType = Type.ReflectionOnlyGetType is not supported.
-
-; TypeLoadException
-TypeLoad_ResolveType = Could not resolve type '{0}'.
-TypeLoad_ResolveTypeFromAssembly = Could not resolve type '{0}' in assembly '{1}'.
-TypeLoad_ResolveNestedType = Could not resolve nested type '{0}' in type "{1}'.
-FileNotFound_ResolveAssembly = Could not resolve assembly '{0}'.
-
-; NullReferenceException
-NullReference_This = The pointer for this method was null.
-
-; ObjectDisposedException
-ObjectDisposed_Generic = Cannot access a disposed object.
-ObjectDisposed_FileClosed = Cannot access a closed file.
-ObjectDisposed_ObjectName_Name = Object name: '{0}'.
-ObjectDisposed_ReaderClosed = Cannot read from a closed TextReader.
-ObjectDisposed_ResourceSet = Cannot access a closed resource set.
-ObjectDisposed_RegKeyClosed = Cannot access a closed registry key.
-ObjectDisposed_StreamClosed = Cannot access a closed Stream.
-ObjectDisposed_WriterClosed = Cannot write to a closed TextWriter.
-ObjectDisposed_ViewAccessorClosed = Cannot access a closed accessor.
-
-; OperationCanceledException
-OperationCanceled = The operation was canceled.
-
-; OutOfMemoryException
-OutOfMemory_GCHandleMDA = The GCHandle MDA has run out of available cookies.
-
-; OverflowException
-Overflow_Byte = Value was either too large or too small for an unsigned byte.
-Overflow_Char = Value was either too large or too small for a character.
-Overflow_Currency = Value was either too large or too small for a Currency.
-Overflow_Decimal = Value was either too large or too small for a Decimal.
-Overflow_Int16 = Value was either too large or too small for an Int16.
-Overflow_Int32 = Value was either too large or too small for an Int32.
-Overflow_Int64 = Value was either too large or too small for an Int64.
-Overflow_NegateTwosCompNum = Negating the minimum value of a twos complement number is invalid.
-Overflow_NegativeUnsigned = The string was being parsed as an unsigned number and could not have a negative sign.
-Overflow_SByte = Value was either too large or too small for a signed byte.
-Overflow_Single = Value was either too large or too small for a Single.
-Overflow_Double = Value was either too large or too small for a Double.
-Overflow_TimeSpanTooLong = TimeSpan overflowed because the duration is too long.
-Overflow_TimeSpanElementTooLarge = The TimeSpan could not be parsed because at least one of the numeric components is out of range or contains too many digits.
-Overflow_Duration = The duration cannot be returned for TimeSpan.MinValue because the absolute value of TimeSpan.MinValue exceeds the value of TimeSpan.MaxValue.
-Overflow_UInt16 = Value was either too large or too small for a UInt16.
-Overflow_UInt32 = Value was either too large or too small for a UInt32.
-Overflow_UInt64 = Value was either too large or too small for a UInt64.
-
-; PlatformNotsupportedException
-PlatformNotSupported_RequiresLonghorn = This operation is only supported on Windows Vista and above.
-PlatformNotSupported_RequiresNT = This operation is only supported on Windows 2000, Windows XP, and higher.
-PlatformNotSupported_RequiresW2kSP3 = This operation is only supported on Windows 2000 SP3 or later operating systems.
-#if FEATURE_COMINTEROP
-PlatformNotSupported_WinRT = Windows Runtime is not supported on this operating system.
-#endif // FEATURE_COMINTEROP
-
-; PolicyException
-; This still appears in bcl.small but should go away eventually
-Policy_Default = Error occurred while performing a policy operation.
-Policy_CannotLoadSemiTrustAssembliesDuringInit = All assemblies loaded as part of AppDomain initialization must be fully trusted.
-Policy_SaveNotFileBased = PolicyLevel object not based on a file cannot be saved.
-Policy_AppTrustMustGrantAppRequest = ApplicationTrust grant set does not contain ActivationContext's minimum request set.
-
-Error_SecurityPolicyFileParse = Error occurred while parsing the '{0}' policy level. The default policy level was used instead.
-Error_SecurityPolicyFileParseEx = Error '{1}' occurred while parsing the '{0}' policy level. The default policy level was used instead.
-
-; RankException
-Rank_MultiDimNotSupported = Only single dimension arrays are supported here.
-Rank_MustMatch = The specified arrays must have the same number of dimensions.
-
-; TypeInitializationException
-TypeInitialization_Default = Type constructor threw an exception.
-TypeInitialization_Type = The type initializer for '{0}' threw an exception.
-
-; TypeLoadException
-
-
-;
-; Reflection exceptions
-;
-RtType.InvalidCaller = Caller is not a friend.
-
-;CustomAttributeFormatException
-RFLCT.InvalidPropFail = '{0}' property specified was not found.
-RFLCT.InvalidFieldFail = '{0}' field specified was not found.
-
-;InvalidFilterCriteriaException
-InvalidFilterCriteriaException_CritString = A String must be provided for the filter criteria.
-InvalidFilterCriteriaException_CritInt = An Int32 must be provided for the filter criteria.
-
-; TargetException
-RFLCT.Targ_ITargMismatch = Object does not match target type.
-RFLCT.Targ_StatMethReqTarg = Non-static method requires a target.
-RFLCT.Targ_StatFldReqTarg = Non-static field requires a target.
-
-;AmbiguousMatchException
-RFLCT.Ambiguous = Ambiguous match found.
-RFLCT.AmbigCust = Multiple custom attributes of the same type found.
-
-;
-; Remoting exceptions
-;
-Remoting_AppDomainUnloaded_ThreadUnwound = The application domain in which the thread was running has been unloaded.
-Remoting_AppDomainUnloaded = The target application domain has been unloaded.
-Remoting_CantRemotePointerType = Pointer types cannot be passed in a remote call.
-Remoting_TypeCantBeRemoted = The given type cannot be passed in a remote call.
-Remoting_Delegate_TooManyTargets = The delegate must have only one target.
-Remoting_InvalidContext = The context is not valid.
-Remoting_InvalidValueTypeFieldAccess = An attempt was made to calculate the address of a value type field on a remote object. This was likely caused by an attempt to directly get or set the value of a field within this embedded value type. Avoid this and instead provide and use access methods for each field in the object that will be accessed remotely.
-Remoting_Message_BadRetValOrOutArg = Bad return value or out-argument inside the return message.
-Remoting_NonPublicOrStaticCantBeCalledRemotely = Permission denied: cannot call non-public or static methods remotely.
-Remoting_Proxy_ProxyTypeIsNotMBR = classToProxy argument must derive from MarshalByRef type.
-Remoting_TP_NonNull = The transparent proxy field of a real proxy must be null.
-
-; Resources exceptions
-;
-Resources_StreamNotValid = Stream is not a valid resource file.
-ResourceReaderIsClosed = ResourceReader is closed.
-
-; RuntimeWrappedException
-RuntimeWrappedException = An object that does not derive from System.Exception has been wrapped in a RuntimeWrappedException.
-
-; UnauthorizedAccessException
-UnauthorizedAccess_MemStreamBuffer = MemoryStream's internal buffer cannot be accessed.
-UnauthorizedAccess_IODenied_Path = Access to the path '{0}' is denied.
-UnauthorizedAccess_IODenied_NoPathName = Access to the path is denied.
-UnauthorizedAccess_RegistryKeyGeneric_Key = Access to the registry key '{0}' is denied.
-UnauthorizedAccess_RegistryNoWrite = Cannot write to the registry key.
-UnauthorizedAccess_SystemDomain = Cannot execute an assembly in the system domain.
-
-;
-; Security exceptions
-;
-
-;SecurityException
-; These still appear in bcl.small but should go away eventually
-Security_Generic = Request for the permission of type '{0}' failed.
-Security_GenericNoType = Request failed.
-Security_NoAPTCA = That assembly does not allow partially trusted callers.
-Security_RegistryPermission = Requested registry access is not allowed.
-Security_MustRevertOverride = Stack walk modifier must be reverted before another modification of the same type can be performed.
-
-;
-; HostProtection exceptions
-;
-
-HostProtection_HostProtection = Attempted to perform an operation that was forbidden by the CLR host.
-HostProtection_ProtectedResources = The protected resources (only available with full trust) were:
-HostProtection_DemandedResources = The demanded resources were:
-
-;
-; IO exceptions
-;
-
-; EOFException
-IO.EOF_ReadBeyondEOF = Unable to read beyond the end of the stream.
-
-; FileNotFoundException
-IO.FileNotFound = Unable to find the specified file.
-IO.FileNotFound_FileName = Could not find file '{0}'.
-IO.FileName_Name = File name: '{0}'
-IO.FileLoad = Could not load the specified file.
-
-; IOException
-IO.IO_AlreadyExists_Name = Cannot create "{0}" because a file or directory with the same name already exists.
-IO.IO_BindHandleFailed = BindHandle for ThreadPool failed on this handle.
-IO.IO_FileExists_Name = The file '{0}' already exists.
-IO.IO_FileStreamHandlePosition = The OS handle's position is not what FileStream expected. Do not use a handle simultaneously in one FileStream and in Win32 code or another FileStream. This may cause data loss.
-IO.IO_FileTooLong2GB = The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size.
-IO.IO_FileTooLongOrHandleNotSync = IO operation will not work. Most likely the file will become too long or the handle was not opened to support synchronous IO operations.
-IO.IO_FixedCapacity = Unable to expand length of this stream beyond its capacity.
-IO.IO_InvalidStringLen_Len = BinaryReader encountered an invalid string length of {0} characters.
-IO.IO_NoConsole = There is no console.
-IO.IO_NoPermissionToDirectoryName = <Path discovery permission to the specified directory was denied.>
-IO.IO_SeekBeforeBegin = An attempt was made to move the position before the beginning of the stream.
-IO.IO_SeekAppendOverwrite = Unable seek backward to overwrite data that previously existed in a file opened in Append mode.
-IO.IO_SetLengthAppendTruncate = Unable to truncate data that previously existed in a file opened in Append mode.
-IO.IO_SharingViolation_File = The process cannot access the file '{0}' because it is being used by another process.
-IO.IO_SharingViolation_NoFileName = The process cannot access the file because it is being used by another process.
-IO.IO_StreamTooLong = Stream was too long.
-IO.IO_CannotCreateDirectory = The specified directory '{0}' cannot be created.
-IO.IO_SourceDestMustBeDifferent = Source and destination path must be different.
-IO.IO_SourceDestMustHaveSameRoot = Source and destination path must have identical roots. Move will not work across volumes.
-
-; DirectoryNotFoundException
-IO.DriveNotFound_Drive = Could not find the drive '{0}'. The drive might not be ready or might not be mapped.
-IO.PathNotFound_Path = Could not find a part of the path '{0}'.
-IO.PathNotFound_NoPathName = Could not find a part of the path.
-
-; PathTooLongException
-IO.PathTooLong = The specified file name or path is too long, or a component of the specified path is too long.
-
-; SecurityException
-FileSecurityState_OperationNotPermitted = File operation not permitted. Access to path '{0}' is denied.
-
-; PrivilegeNotHeldException
-PrivilegeNotHeld_Default = The process does not possess some privilege required for this operation.
-PrivilegeNotHeld_Named = The process does not possess the '{0}' privilege which is required for this operation.
-
-; General strings used in the IO package
-IO_UnknownFileName = [Unknown]
-IO_StreamWriterBufferedDataLost = A StreamWriter was not closed and all buffered data within that StreamWriter was not flushed to the underlying stream. (This was detected when the StreamWriter was finalized with data in its buffer.) A portion of the data was lost. Consider one of calling Close(), Flush(), setting the StreamWriter's AutoFlush property to true, or allocating the StreamWriter with a "using" statement. Stream type: {0}\r\nFile name: {1}\r\nAllocated from:\r\n {2}
-IO_StreamWriterBufferedDataLostCaptureAllocatedFromCallstackNotEnabled = callstack information is not captured by default for performance reasons. Please enable captureAllocatedCallStack config switch for streamWriterBufferedDataLost MDA (refer to MSDN MDA documentation for how to do this).
-
-;
-; Serialization Exceptions
-;
-; SerializationException
-Serialization_InvalidData=An error occurred while deserializing the object. The serialized data is corrupt.
-Serialization_InvalidPtrValue = An IntPtr or UIntPtr with an eight byte value cannot be deserialized on a machine with a four byte word size.
-Serialization_MemberTypeNotRecognized = Unknown member type.
-Serialization_InsufficientState = Insufficient state to return the real object.
-Serialization_InvalidFieldState = Object fields may not be properly initialized.
-Serialization_MissField = Field {0} is missing.
-Serialization_NullSignature = The method signature cannot be null.
-Serialization_UnknownMember = Cannot get the member '{0}'.
-Serialization_InsufficientDeserializationState = Insufficient state to deserialize the object. Missing field '{0}'. More information is needed.
-Serialization_UnableToFindModule = The given module {0} cannot be found within the assembly {1}.
-Serialization_InvalidOnDeser = OnDeserialization method was called while the object was not being deserialized.
-Serialization_MissingKeys = The Keys for this Hashtable are missing.
-Serialization_MissingValues = The values for this dictionary are missing.
-Serialization_NullKey = One of the serialized keys is null.
-Serialization_KeyValueDifferentSizes = The keys and values arrays have different sizes.
-Serialization_SameNameTwice = Cannot add the same member twice to a SerializationInfo object.
-Serialization_BadParameterInfo = Non existent ParameterInfo. Position bigger than member's parameters length.
-Serialization_NoParameterInfo = Serialized member does not have a ParameterInfo.
-Serialization_NotFound = Member '{0}' was not found.
-Serialization_StringBuilderMaxCapacity = The serialized MaxCapacity property of StringBuilder must be positive and greater than or equal to the String length.
-Serialization_StringBuilderCapacity = The serialized Capacity property of StringBuilder must be positive, less than or equal to MaxCapacity and greater than or equal to the String length.
-Serialization_InvalidDelegateType = Cannot serialize delegates over unmanaged function pointers, dynamic methods or methods outside the delegate creator's assembly.
-Serialization_OptionalFieldVersionValue = Version value must be positive.
-Serialization_MissingDateTimeData = Invalid serialized DateTime data. Unable to find 'ticks' or 'dateData'.
-Serialization_DateTimeTicksOutOfRange = Invalid serialized DateTime data. Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
-; The following serialization exception messages appear in native resources too (mscorrc.rc)
-Serialization_MemberOutOfRange = The deserialized value of the member "{0}" in the class "{1}" is out of range.
-
-
-;
-; StringBuilder Exceptions
-;
-Arg_LongerThanSrcString = Source string was not long enough. Check sourceIndex and count.
-
-
-;
-; System.Threading
-;
-
-;
-; Thread Exceptions
-;
-ThreadState_NoAbortRequested = Unable to reset abort because no abort was requested.
-Threading.WaitHandleTooManyPosts = The WaitHandle cannot be signaled because it would exceed its maximum count.
-;
-; WaitHandleCannotBeOpenedException
-;
-Threading.WaitHandleCannotBeOpenedException = No handle of the given name exists.
-Threading.WaitHandleCannotBeOpenedException_InvalidHandle = A WaitHandle with system-wide name '{0}' cannot be created. A WaitHandle of a different type might have the same name.
-
-;
-; AbandonedMutexException
-;
-Threading.AbandonedMutexException = The wait completed due to an abandoned mutex.
-
-; AggregateException
-AggregateException_ctor_DefaultMessage=One or more errors occurred.
-AggregateException_ctor_InnerExceptionNull=An element of innerExceptions was null.
-AggregateException_DeserializationFailure=The serialization stream contains no inner exceptions.
-AggregateException_ToString={0}{1}---> (Inner Exception #{2}) {3}{4}{5}
-
-; Cancellation
-CancellationToken_CreateLinkedToken_TokensIsEmpty=No tokens were supplied.
-CancellationTokenSource_Disposed=The CancellationTokenSource has been disposed.
-CancellationToken_SourceDisposed=The CancellationTokenSource associated with this CancellationToken has been disposed.
-
-; Exceptions shared by all concurrent collection
-ConcurrentCollection_SyncRoot_NotSupported=The SyncRoot property may not be used for the synchronization of concurrent collections.
-
-; Exceptions shared by ConcurrentStack and ConcurrentQueue
-ConcurrentStackQueue_OnDeserialization_NoData=The serialization stream contains no elements.
-
-; ConcurrentStack<T>
-ConcurrentStack_PushPopRange_StartOutOfRange=The startIndex argument must be greater than or equal to zero.
-ConcurrentStack_PushPopRange_CountOutOfRange=The count argument must be greater than or equal to zero.
-ConcurrentStack_PushPopRange_InvalidCount=The sum of the startIndex and count arguments must be less than or equal to the collection's Count.
-
-; ConcurrentDictionary<TKey, TValue>
-ConcurrentDictionary_ItemKeyIsNull=TKey is a reference type and item.Key is null.
-ConcurrentDictionary_SourceContainsDuplicateKeys=The source argument contains duplicate keys.
-ConcurrentDictionary_IndexIsNegative=The index argument is less than zero.
-ConcurrentDictionary_ConcurrencyLevelMustBePositive=The concurrencyLevel argument must be positive.
-ConcurrentDictionary_CapacityMustNotBeNegative=The capacity argument must be greater than or equal to zero.
-ConcurrentDictionary_ArrayNotLargeEnough=The index is equal to or greater than the length of the array, or the number of elements in the dictionary is greater than the available space from index to the end of the destination array.
-ConcurrentDictionary_ArrayIncorrectType=The array is multidimensional, or the type parameter for the set cannot be cast automatically to the type of the destination array.
-ConcurrentDictionary_KeyAlreadyExisted=The key already existed in the dictionary.
-ConcurrentDictionary_TypeOfKeyIncorrect=The key was of an incorrect type for this dictionary.
-ConcurrentDictionary_TypeOfValueIncorrect=The value was of an incorrect type for this dictionary.
-
-; Partitioner
-Partitioner_DynamicPartitionsNotSupported=Dynamic partitions are not supported by this partitioner.
-
-; OrderablePartitioner
-OrderablePartitioner_GetPartitions_WrongNumberOfPartitions=GetPartitions returned an incorrect number of partitions.
-
-; PartitionerStatic
-PartitionerStatic_CurrentCalledBeforeMoveNext=MoveNext must be called at least once before calling Current.
-PartitionerStatic_CanNotCallGetEnumeratorAfterSourceHasBeenDisposed=Can not call GetEnumerator on partitions after the source enumerable is disposed
-
-; CDSCollectionETWBCLProvider events
-event_ConcurrentStack_FastPushFailed=Push to ConcurrentStack spun {0} time(s).
-event_ConcurrentStack_FastPopFailed=Pop from ConcurrentStack spun {0} time(s).
-event_ConcurrentDictionary_AcquiringAllLocks=ConcurrentDictionary acquiring all locks on {0} bucket(s).
-event_ConcurrentBag_TryTakeSteals=ConcurrentBag stealing in TryTake.
-event_ConcurrentBag_TryPeekSteals=ConcurrentBag stealing in TryPeek.
-
-; CountdownEvent
-CountdownEvent_Decrement_BelowZero=Invalid attempt made to decrement the event's count below zero.
-CountdownEvent_Increment_AlreadyZero=The event is already signaled and cannot be incremented.
-CountdownEvent_Increment_AlreadyMax=The increment operation would cause the CurrentCount to overflow.
-
-; Parallel
-Parallel_Invoke_ActionNull=One of the actions was null.
-Parallel_ForEach_OrderedPartitionerKeysNotNormalized=This method requires the use of an OrderedPartitioner with the KeysNormalized property set to true.
-Parallel_ForEach_PartitionerNotDynamic=The Partitioner used here must support dynamic partitioning.
-Parallel_ForEach_PartitionerReturnedNull=The Partitioner used here returned a null partitioner source.
-Parallel_ForEach_NullEnumerator=The Partitioner source returned a null enumerator.
-
-; Semaphore
-Argument_SemaphoreInitialMaximum=The initial count for the semaphore must be greater than or equal to zero and less than the maximum count.
-
-; SemaphoreFullException
-Threading_SemaphoreFullException=Adding the specified count to the semaphore would cause it to exceed its maximum count.
-
-; Lazy
-Lazy_ctor_ValueSelectorNull=The valueSelector argument is null.
-Lazy_ctor_InfoNull=The info argument is null.
-Lazy_ctor_deserialization_ValueInvalid=The Value cannot be null.
-Lazy_ctor_ModeInvalid=The mode argument specifies an invalid value.
-Lazy_CreateValue_NoParameterlessCtorForT=The lazily-initialized type does not have a public, parameterless constructor.
-Lazy_StaticInit_InvalidOperation=ValueFactory returned null.
-Lazy_Value_RecursiveCallsToValue=ValueFactory attempted to access the Value property of this instance.
-Lazy_ToString_ValueNotCreated=Value is not created.
-
-
-;ThreadLocal
-ThreadLocal_Value_RecursiveCallsToValue=ValueFactory attempted to access the Value property of this instance.
-ThreadLocal_Disposed=The ThreadLocal object has been disposed.
-ThreadLocal_ValuesNotAvailable=The ThreadLocal object is not tracking values. To use the Values property, use a ThreadLocal constructor that accepts the trackAllValues parameter and set the parameter to true.
-
-; SemaphoreSlim
-SemaphoreSlim_ctor_InitialCountWrong=The initialCount argument must be non-negative and less than or equal to the maximumCount.
-SemaphoreSlim_ctor_MaxCountWrong=The maximumCount argument must be a positive number. If a maximum is not required, use the constructor without a maxCount parameter.
-SemaphoreSlim_Wait_TimeoutWrong=The timeout must represent a value between -1 and Int32.MaxValue, inclusive.
-SemaphoreSlim_Release_CountWrong=The releaseCount argument must be greater than zero.
-SemaphoreSlim_Disposed=The semaphore has been disposed.
-
-; ManualResetEventSlim
-ManualResetEventSlim_ctor_SpinCountOutOfRange=The spinCount argument must be in the range 0 to {0}, inclusive.
-ManualResetEventSlim_ctor_TooManyWaiters=There are too many threads currently waiting on the event. A maximum of {0} waiting threads are supported.
-ManualResetEventSlim_Disposed=The event has been disposed.
-
-; SpinLock
-SpinLock_TryEnter_ArgumentOutOfRange=The timeout must be a value between -1 and Int32.MaxValue, inclusive.
-SpinLock_TryEnter_LockRecursionException=The calling thread already holds the lock.
-SpinLock_TryReliableEnter_ArgumentException=The tookLock argument must be set to false before calling this method.
-SpinLock_Exit_SynchronizationLockException=The calling thread does not hold the lock.
-SpinLock_IsHeldByCurrentThread=Thread tracking is disabled.
-
-; SpinWait
-SpinWait_SpinUntil_TimeoutWrong=The timeout must represent a value between -1 and Int32.MaxValue, inclusive.
-SpinWait_SpinUntil_ArgumentNull=The condition argument is null.
-
-; CdsSyncEtwBCLProvider events
-event_SpinLock_FastPathFailed=SpinLock beginning to spin.
-event_SpinWait_NextSpinWillYield=Next spin will yield.
-event_Barrier_PhaseFinished=Barrier finishing phase {1}.
-
-#if PLATFORM_UNIX
-; Unix threading
-PlatformNotSupported_NamedSynchronizationPrimitives=The named version of this synchronization primitive is not supported on this platform.
-PlatformNotSupported_NamedSyncObjectWaitAnyWaitAll=Wait operations on multiple wait handles including a named synchronization primitive are not supported on this platform.
-; OSX File locking
-PlatformNotSupported_OSXFileLocking=Locking/unlocking file regions is not supported on this platform. Use FileShare on the entire file instead.
-#endif
-
-;
-; System.Threading.Tasks
-;
-
-; AsyncMethodBuilder
-AsyncMethodBuilder_InstanceNotInitialized=The builder was not properly initialized.
-
-; TaskAwaiter and YieldAwaitable
-AwaitableAwaiter_InstanceNotInitialized=The awaitable or awaiter was not properly initialized.
-TaskAwaiter_TaskNotCompleted=The awaited task has not yet completed.
-
-; Task<T>
-TaskT_SetException_HasAnInitializer=A task's Exception may only be set directly if the task was created without a function.
-TaskT_TransitionToFinal_AlreadyCompleted=An attempt was made to transition a task to a final state when it had already completed.
-TaskT_ctor_SelfReplicating=It is invalid to specify TaskCreationOptions.SelfReplicating for a Task<TResult>.
-TaskT_DebuggerNoResult={Not yet computed}
-
-; Task
-Task_ctor_LRandSR=(Internal)An attempt was made to create a LongRunning SelfReplicating task.
-Task_ThrowIfDisposed=The task has been disposed.
-Task_Dispose_NotCompleted=A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled).
-Task_Start_Promise=Start may not be called on a promise-style task.
-Task_Start_AlreadyStarted=Start may not be called on a task that was already started.
-Task_Start_TaskCompleted=Start may not be called on a task that has completed.
-Task_Start_ContinuationTask=Start may not be called on a continuation task.
-Task_RunSynchronously_AlreadyStarted=RunSynchronously may not be called on a task that was already started.
-Task_RunSynchronously_TaskCompleted=RunSynchronously may not be called on a task that has already completed.
-Task_RunSynchronously_Promise=RunSynchronously may not be called on a task not bound to a delegate, such as the task returned from an asynchronous method.
-Task_RunSynchronously_Continuation=RunSynchronously may not be called on a continuation task.
-Task_ContinueWith_NotOnAnything=The specified TaskContinuationOptions excluded all continuation kinds.
-Task_ContinueWith_ESandLR=The specified TaskContinuationOptions combined LongRunning and ExecuteSynchronously. Synchronous continuations should not be long running.
-Task_MultiTaskContinuation_NullTask=The tasks argument included a null value.
-Task_MultiTaskContinuation_FireOptions=It is invalid to exclude specific continuation kinds for continuations off of multiple tasks.
-Task_MultiTaskContinuation_EmptyTaskList=The tasks argument contains no tasks.
-Task_FromAsync_TaskManagerShutDown=FromAsync was called with a TaskManager that had already shut down.
-Task_FromAsync_SelfReplicating=It is invalid to specify TaskCreationOptions.SelfReplicating in calls to FromAsync.
-Task_FromAsync_LongRunning=It is invalid to specify TaskCreationOptions.LongRunning in calls to FromAsync.
-Task_FromAsync_PreferFairness=It is invalid to specify TaskCreationOptions.PreferFairness in calls to FromAsync.
-Task_WaitMulti_NullTask=The tasks array included at least one null element.
-Task_Delay_InvalidMillisecondsDelay=The value needs to be either -1 (signifying an infinite timeout), 0 or a positive integer.
-Task_Delay_InvalidDelay=The value needs to translate in milliseconds to -1 (signifying an infinite timeout), 0 or a positive integer less than or equal to Int32.MaxValue.
-
-; TaskCanceledException
-TaskCanceledException_ctor_DefaultMessage=A task was canceled.
-
-;TaskCompletionSource<T>
-TaskCompletionSourceT_TrySetException_NullException=The exceptions collection included at least one null element.
-TaskCompletionSourceT_TrySetException_NoExceptions=The exceptions collection was empty.
-
-;TaskExceptionHolder
-TaskExceptionHolder_UnknownExceptionType=(Internal)Expected an Exception or an IEnumerable<Exception>
-TaskExceptionHolder_UnhandledException=A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.
-
-; TaskScheduler
-TaskScheduler_ExecuteTask_TaskAlreadyExecuted=ExecuteTask may not be called for a task which was already executed.
-TaskScheduler_ExecuteTask_WrongTaskScheduler=ExecuteTask may not be called for a task which was previously queued to a different TaskScheduler.
-TaskScheduler_InconsistentStateAfterTryExecuteTaskInline=The TryExecuteTaskInline call to the underlying scheduler succeeded, but the task body was not invoked.
-TaskScheduler_FromCurrentSynchronizationContext_NoCurrent=The current SynchronizationContext may not be used as a TaskScheduler.
-
-; TaskSchedulerException
-TaskSchedulerException_ctor_DefaultMessage=An exception was thrown by a TaskScheduler.
-
-;
-; ParallelState ( used in Parallel.For(), Parallel.ForEach() )
-ParallelState_Break_InvalidOperationException_BreakAfterStop=Break was called after Stop was called.
-ParallelState_Stop_InvalidOperationException_StopAfterBreak=Stop was called after Break was called.
-ParallelState_NotSupportedException_UnsupportedMethod=This method is not supported.
-
-;
-; TPLETWProvider events
-event_ParallelLoopBegin=Beginning {3} loop {2} from Task {1}.
-event_ParallelLoopEnd=Ending loop {2} after {3} iterations.
-event_ParallelInvokeBegin=Beginning ParallelInvoke {2} from Task {1} for {4} actions.
-event_ParallelInvokeEnd=Ending ParallelInvoke {2}.
-event_ParallelFork=Task {1} entering fork/join {2}.
-event_ParallelJoin=Task {1} leaving fork/join {2}.
-event_TaskScheduled=Task {2} scheduled to TaskScheduler {0}.
-event_TaskStarted=Task {2} executing.
-event_TaskCompleted=Task {2} completed.
-event_TaskWaitBegin=Beginning wait ({3}) on Task {2}.
-event_TaskWaitEnd=Ending wait on Task {2}.
-
-
-;
-; Weak Reference Exception
-;
-WeakReference_NoLongerValid = The weak reference is no longer valid.
-
-
-;
-; Interop Exceptions
-;
-Interop.COM_TypeMismatch = Type mismatch between source and destination types.
-Interop_Marshal_Unmappable_Char = Cannot marshal: Encountered unmappable character.
-
-;
-; Loader Exceptions
-;
-Loader_InvalidPath = Relative path must be a string that contains the substring, "..", or does not contain a root directory.
-Loader_Name = Name:
-Loader_NoContextPolicies = There are no context policies.
-Loader_ContextPolicies = Context Policies:
-
-;
-; AppDomain Exceptions
-AppDomain_RequireApplicationName = ApplicationName must be set before the DynamicBase can be set.
-AppDomain_AppBaseNotSet = The ApplicationBase must be set before retrieving this property.
-AppDomain_BindingModelIsLocked = Binding model is already locked for the AppDomain and cannot be reset.
-Argument_CustomAssemblyLoadContextRequestedNameMismatch = Resolved assembly's simple name should be the same as of the requested assembly.
-
-;
-; XMLSyntaxExceptions
-XMLSyntax_UnexpectedEndOfFile = Unexpected end of file.
-XMLSyntax_ExpectedCloseBracket = Expected > character.
-XMLSyntax_ExpectedSlashOrString = Expected / character or string.
-XMLSyntax_UnexpectedCloseBracket = Unexpected > character.
-XMLSyntax_SyntaxError = Invalid syntax on line {0}.
-XMLSyntax_SyntaxErrorEx = Invalid syntax on line {0} - '{1}'.
-XMLSyntax_InvalidSyntax = Invalid syntax.
-XML_Syntax_InvalidSyntaxInFile = Invalid XML in file '{0}' near element '{1}'.
-XMLSyntax_InvalidSyntaxSatAssemTag = Invalid XML in file "{0}" near element "{1}". The <satelliteassemblies> section only supports <assembly> tags.
-XMLSyntax_InvalidSyntaxSatAssemTagBadAttr = Invalid XML in file "{0}" near "{1}" and "{2}". In the <satelliteassemblies> section, the <assembly> tag must have exactly 1 attribute called 'name', whose value is a fully-qualified assembly name.
-XMLSyntax_InvalidSyntaxSatAssemTagNoAttr = Invalid XML in file "{0}". In the <satelliteassemblies> section, the <assembly> tag must have exactly 1 attribute called 'name', whose value is a fully-qualified assembly name.
-
-; MembershipConditions
-StrongName_ToString = StrongName - {0}{1}{2}
-StrongName_Name = name = {0}
-StrongName_Version = version = {0}
-Site_ToString = Site
-Publisher_ToString = Publisher
-Hash_ToString = Hash - {0} = {1}
-ApplicationDirectory_ToString = ApplicationDirectory
-Zone_ToString = Zone - {0}
-All_ToString = All code
-Url_ToString = Url
-GAC_ToString = GAC
-
-; Interop non exception strings.
-TypeLibConverter_ImportedTypeLibProductName = Assembly imported from type library '{0}'.
-
-;
-; begin System.TimeZoneInfo ArgumentException's
-;
-Argument_AdjustmentRulesNoNulls = The AdjustmentRule array cannot contain null elements.
-Argument_AdjustmentRulesOutOfOrder = The elements of the AdjustmentRule array must be in chronological order and must not overlap.
-Argument_AdjustmentRulesAmbiguousOverlap = The elements of the AdjustmentRule array must not contain ambiguous time periods that extend beyond the DateStart or DateEnd properties of the element.
-Argument_AdjustmentRulesrDaylightSavingTimeOverlap = The elements of the AdjustmentRule array must not contain Daylight Saving Time periods that overlap adjacent elements in such a way as to cause invalid or ambiguous time periods.
-Argument_AdjustmentRulesrDaylightSavingTimeOverlapNonRuleRange = The elements of the AdjustmentRule array must not contain Daylight Saving Time periods that overlap the DateStart or DateEnd properties in such a way as to cause invalid or ambiguous time periods.
-Argument_AdjustmentRulesInvalidOverlap = The elements of the AdjustmentRule array must not contain invalid time periods that extend beyond the DateStart or DateEnd properties of the element.
-Argument_ConvertMismatch = The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local.
-Argument_DateTimeHasTimeOfDay = The supplied DateTime includes a TimeOfDay setting. This is not supported.
-Argument_DateTimeIsInvalid = The supplied DateTime represents an invalid time. For example, when the clock is adjusted forward, any time in the period that is skipped is invalid.
-Argument_DateTimeIsNotAmbiguous = The supplied DateTime is not in an ambiguous time range.
-Argument_DateTimeOffsetIsNotAmbiguous = The supplied DateTimeOffset is not in an ambiguous time range.
-Argument_DateTimeKindMustBeUnspecifiedOrUtc = The supplied DateTime must have the Kind property set to DateTimeKind.Unspecified or DateTimeKind.Utc.
-Argument_DateTimeHasTicks = The supplied DateTime must have the Year, Month, and Day properties set to 1. The time cannot be specified more precisely than whole milliseconds.
-Argument_InvalidId = The specified ID parameter '{0}' is not supported.
-Argument_InvalidSerializedString = The specified serialized string '{0}' is not supported.
-Argument_InvalidREG_TZI_FORMAT = The REG_TZI_FORMAT structure is corrupt.
-Argument_OutOfOrderDateTimes = The DateStart property must come before the DateEnd property.
-Argument_TimeSpanHasSeconds = The TimeSpan parameter cannot be specified more precisely than whole minutes.
-Argument_TimeZoneInfoBadTZif = The tzfile does not begin with the magic characters 'TZif'. Please verify that the file is not corrupt.
-Argument_TimeZoneInfoInvalidTZif = The TZif data structure is corrupt.
-Argument_TransitionTimesAreIdentical = The DaylightTransitionStart property must not equal the DaylightTransitionEnd property.
-;
-; begin System.TimeZoneInfo ArgumentOutOfRangeException's
-;
-ArgumentOutOfRange_DayParam = The Day parameter must be in the range 1 through 31.
-ArgumentOutOfRange_DayOfWeek = The DayOfWeek enumeration must be in the range 0 through 6.
-ArgumentOutOfRange_MonthParam = The Month parameter must be in the range 1 through 12.
-ArgumentOutOfRange_UtcOffset = The TimeSpan parameter must be within plus or minus 14.0 hours.
-ArgumentOutOfRange_UtcOffsetAndDaylightDelta = The sum of the BaseUtcOffset and DaylightDelta properties must within plus or minus 14.0 hours.
-ArgumentOutOfRange_Week = The Week parameter must be in the range 1 through 5.
-;
-; begin System.TimeZoneInfo InvalidTimeZoneException's
-;
-InvalidTimeZone_InvalidRegistryData = The time zone ID '{0}' was found on the local computer, but the registry information was corrupt.
-InvalidTimeZone_InvalidFileData = The time zone ID '{0}' was found on the local computer, but the file at '{1}' was corrupt.
-InvalidTimeZone_InvalidWin32APIData = The Local time zone was found on the local computer, but the data was corrupt.
-InvalidTimeZone_NoTTInfoStructures = There are no ttinfo structures in the tzfile. At least one ttinfo structure is required in order to construct a TimeZoneInfo object.
-InvalidTimeZone_UnparseablePosixMDateString = '{0}' is not a valid POSIX-TZ-environment-variable MDate rule. A valid rule has the format 'Mm.w.d'.
-InvalidTimeZone_JulianDayNotSupported = Julian dates in POSIX strings are unsupported.
-;
-; begin System.TimeZoneInfo SecurityException's
-;
-Security_CannotReadRegistryData = The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the registry information.
-Security_CannotReadFileData = The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the file.
-;
-; begin System.TimeZoneInfo SerializationException's
-;
-Serialization_CorruptField = The value of the field '{0}' is invalid. The serialized data is corrupt.
-Serialization_InvalidEscapeSequence = The serialized data contained an invalid escape sequence '\\{0}'.
-;
-; begin System.TimeZoneInfo TimeZoneNotFoundException's
-;
-TimeZoneNotFound_MissingData = The time zone ID '{0}' was not found on the local computer.
-;
-; end System.TimeZoneInfo
-;
-
-
-; Tuple
-ArgumentException_TupleIncorrectType=Argument must be of type {0}.
-ArgumentException_TupleNonIComparableElement=The tuple contains an element of type {0} which does not implement the IComparable interface.
-ArgumentException_TupleLastArgumentNotATuple=The last element of an eight element tuple must be a Tuple.
-ArgumentException_OtherNotArrayOfCorrectLength=Object is not a array with the same number of elements as the array to compare it to.
-
-; WinRT collection adapters
-Argument_IndexOutOfArrayBounds=The specified index is out of bounds of the specified array.
-Argument_InsufficientSpaceToCopyCollection=The specified space is not sufficient to copy the elements from this Collection.
-ArgumentOutOfRange_IndexLargerThanMaxValue=This collection cannot work with indices larger than Int32.MaxValue - 1 (0x7FFFFFFF - 1).
-ArgumentOutOfRange_IndexOutOfRange=The specified index is outside the current index range of this collection.
-InvalidOperation_CollectionBackingListTooLarge=The collection backing this List contains too many elements.
-InvalidOperation_CollectionBackingDictionaryTooLarge=The collection backing this Dictionary contains too many elements.
-InvalidOperation_CannotRemoveLastFromEmptyCollection=Cannot remove the last element from an empty collection.
-
-; Buffers
-ArgumentException_BufferNotFromPool=The buffer is not associated with this pool and may not be returned to it.
-
-;------------------
-; Encoding names:
-;
-;Total items: 147
-;
-Globalization.cp_1200 = Unicode
-Globalization.cp_1201 = Unicode (Big-Endian)
-Globalization.cp_65001 = Unicode (UTF-8)
-Globalization.cp_65000 = Unicode (UTF-7)
-Globalization.cp_12000 = Unicode (UTF-32)
-Globalization.cp_12001 = Unicode (UTF-32 Big-Endian)
-Globalization.cp_20127 = US-ASCII
-Globalization.cp_28591 = Western European (ISO)
-
-#endif // INCLUDE_DEBUG
-
-;------------------
-
-; ValueTuple
-ArgumentException_ValueTupleIncorrectType=Argument must be of type {0}.
-ArgumentException_ValueTupleLastArgumentNotAValueTuple=The last element of an eight element ValueTuple must be a ValueTuple.
-
-; SafeSerializationEventArgs
-Serialization_NonSerType=Type '{0}' in Assembly '{1}' is not marked as serializable.
-
Contract.EndContractBlock();
if (type is System.Reflection.Emit.TypeBuilder)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_CreateInstanceWithTypeBuilder"));
+ throw new NotSupportedException(SR.NotSupported_CreateInstanceWithTypeBuilder);
// If they didn't specify a lookup, then we will provide the default lookup.
if ((bindingAttr & (BindingFlags)LookupMask) == 0)
if (activationAttributes != null && activationAttributes.Length > 0)
{
- throw new PlatformNotSupportedException(Environment.GetResourceString("NotSupported_ActivAttr"));
+ throw new PlatformNotSupportedException(SR.NotSupported_ActivAttr);
}
RuntimeType rt = type.UnderlyingSystemType as RuntimeType;
if (rt == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(type));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(type));
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return rt.CreateInstanceImpl(bindingAttr, binder, args, culture, activationAttributes, ref stackMark);
RuntimeType rt = type.UnderlyingSystemType as RuntimeType;
if (rt == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(type));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(type));
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return rt.CreateInstanceDefaultCtor(!nonPublic, false, true, ref stackMark);
// This is a workaround to maintain compatibility with V2. Without this we would throw a NotSupportedException for void[].
// Array, Ref, and Pointer types don't have default constructors.
if (rt.HasElementType)
- throw new MissingMethodException(Environment.GetResourceString("Arg_NoDefCTor"));
+ throw new MissingMethodException(SR.Arg_NoDefCTor);
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
if (Attr.Length > 0)
{
if (((ComVisibleAttribute)Attr[0]).Value == false)
- throw new TypeLoadException(Environment.GetResourceString("Argument_TypeMustBeVisibleFromCom"));
+ throw new TypeLoadException(SR.Argument_TypeMustBeVisibleFromCom);
}
Log(assembly != null, "CreateInstance:: ", "Loaded " + assembly.FullName, "Failed to Load: " + assemblyName);
/// Initializes a new instance of the <see cref="AggregateException"/> class.
/// </summary>
public AggregateException()
- : base(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"))
+ : base(SR.AggregateException_ctor_DefaultMessage)
{
m_innerExceptions = new ReadOnlyCollection<Exception>(new Exception[0]);
}
/// <exception cref="T:System.ArgumentException">An element of <paramref name="innerExceptions"/> is
/// null.</exception>
public AggregateException(IEnumerable<Exception> innerExceptions) :
- this(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"), innerExceptions)
+ this(SR.AggregateException_ctor_DefaultMessage, innerExceptions)
{
}
/// <exception cref="T:System.ArgumentException">An element of <paramref name="innerExceptions"/> is
/// null.</exception>
public AggregateException(params Exception[] innerExceptions) :
- this(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"), innerExceptions)
+ this(SR.AggregateException_ctor_DefaultMessage, innerExceptions)
{
}
if (exceptionsCopy[i] == null)
{
- throw new ArgumentException(Environment.GetResourceString("AggregateException_ctor_InnerExceptionNull"));
+ throw new ArgumentException(SR.AggregateException_ctor_InnerExceptionNull);
}
}
/// <exception cref="T:System.ArgumentException">An element of <paramref name="innerExceptionInfos"/> is
/// null.</exception>
internal AggregateException(IEnumerable<ExceptionDispatchInfo> innerExceptionInfos) :
- this(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"), innerExceptionInfos)
+ this(SR.AggregateException_ctor_DefaultMessage, innerExceptionInfos)
{
}
if (exceptionsCopy[i] == null)
{
- throw new ArgumentException(Environment.GetResourceString("AggregateException_ctor_InnerExceptionNull"));
+ throw new ArgumentException(SR.AggregateException_ctor_InnerExceptionNull);
}
}
Exception[] innerExceptions = info.GetValue("InnerExceptions", typeof(Exception[])) as Exception[];
if (innerExceptions == null)
{
- throw new SerializationException(Environment.GetResourceString("AggregateException_DeserializationFailure"));
+ throw new SerializationException(SR.AggregateException_DeserializationFailure);
}
m_innerExceptions = new ReadOnlyCollection<Exception>(innerExceptions);
{
text = String.Format(
CultureInfo.InvariantCulture,
- Environment.GetResourceString("AggregateException_ToString"),
+ SR.AggregateException_ToString,
text, Environment.NewLine, i, m_innerExceptions[i].ToString(), "<---", Environment.NewLine);
}
if (switchName == null)
throw new ArgumentNullException(nameof(switchName));
if (switchName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(switchName));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(switchName));
// By default, the switch is not enabled.
isEnabled = false;
if (switchName == null)
throw new ArgumentNullException(nameof(switchName));
if (switchName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(switchName));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(switchName));
SwitchValueState switchValue = (isEnabled ? SwitchValueState.HasTrueValue : SwitchValueState.HasFalseValue)
| SwitchValueState.HasLookedForOverride;
if (nested != null)
nestedDelegates.Add(nested);
else
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeStatic"),
+ throw new ArgumentException(SR.Arg_MustBeStatic,
list[i].Method.ReflectedType.FullName + "::" + list[i].Method.Name);
}
else
// uninitialized object through remoting, etc.
if (_pDomain.IsNull())
{
- throw new InvalidOperationException(Environment.GetResourceString("Argument_InvalidHandle"));
+ throw new InvalidOperationException(SR.Argument_InvalidHandle);
}
return new AppDomainHandle(_pDomain);
}
catch (FileNotFoundException e)
{
- throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"), e);
+ throw new TypeLoadException(SR.Argument_NoDomainManager, e);
}
catch (SecurityException e)
{
- throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"), e);
+ throw new TypeLoadException(SR.Argument_NoDomainManager, e);
}
catch (TypeLoadException e)
{
- throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"), e);
+ throw new TypeLoadException(SR.Argument_NoDomainManager, e);
}
if (_domainManager == null)
{
- throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"));
+ throw new TypeLoadException(SR.Argument_NoDomainManager);
}
// If this domain was not created by a managed call to CreateDomain, then the AppDomainSetup
{
#if FEATURE_APPX
if (IsAppXModel())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.LoadFrom"));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.LoadFrom"));
#endif
}
{
#if FEATURE_APPX
if (IsAppXModel())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.LoadFile"));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.LoadFile"));
#endif
}
{
#if FEATURE_APPX
if (IsAppXModel())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.ReflectionOnlyLoad"));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.ReflectionOnlyLoad"));
#endif
}
{
#if FEATURE_APPX
if (IsAppXModel())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.Load(byte[], ...)"));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.Load(byte[], ...)"));
#endif
}
String fn = nGetFriendlyName();
if (fn != null)
{
- sb.Append(Environment.GetResourceString("Loader_Name") + fn);
+ sb.Append(SR.Loader_Name + fn);
sb.Append(Environment.NewLine);
}
if (_Policies == null || _Policies.Length == 0)
- sb.Append(Environment.GetResourceString("Loader_NoContextPolicies")
+ sb.Append(SR.Loader_NoContextPolicies
+ Environment.NewLine);
else
{
- sb.Append(Environment.GetResourceString("Loader_ContextPolicies")
+ sb.Append(SR.Loader_ContextPolicies
+ Environment.NewLine);
for (int i = 0; i < _Policies.Length; i++)
{
}
if (currentVal != null)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_SetData_OnlyOnce"));
+ throw new InvalidOperationException(SR.InvalidOperation_SetData_OnlyOnce);
}
lock (((ICollection)LocalStore).SyncRoot)
private AppDomain()
{
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_Constructor));
+ throw new NotSupportedException(SR.GetResourceString(ResId.NotSupported_Constructor));
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
throw new ArgumentNullException("APPBASE");
if (PathInternal.IsPartiallyQualified(propertyValues[i]))
- throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"));
+ throw new ArgumentException(SR.Argument_AbsolutePathRequired);
newSetup.ApplicationBase = NormalizePath(propertyValues[i], fullCheck: true);
}
case "MultiDomain": newSetup.LoaderOptimization = LoaderOptimization.MultiDomain; break;
case "MultiDomainHost": newSetup.LoaderOptimization = LoaderOptimization.MultiDomainHost; break;
case "NotSpecified": newSetup.LoaderOptimization = LoaderOptimization.NotSpecified; break;
- default: throw new ArgumentException(Environment.GetResourceString("Argument_UnrecognizedLoaderOptimization"), "LOADER_OPTIMIZATION");
+ default: throw new ArgumentException(SR.Argument_UnrecognizedLoaderOptimization, "LOADER_OPTIMIZATION");
}
}
else if (propertyNames[i] == "TRUSTED_PLATFORM_ASSEMBLIES" ||
continue;
if (PathInternal.IsPartiallyQualified(path))
- throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"));
+ throw new ArgumentException(SR.Argument_AbsolutePathRequired);
string appPath = NormalizePath(path, fullCheck: true);
sb.Append(appPath);
// with it for "file:\\" + "\\server" and "file:\\\" + "\localpath"
if ((len > 8) &&
((path[8] == '\\') || (path[8] == '/')))
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPathChars"));
+ throw new ArgumentException(SR.Argument_InvalidPathChars);
// file:\\\ means local path
else
String appBase = Value[(int)LoaderInformation.ApplicationBaseValue];
if ((appBase == null) || (appBase.Length == 0))
- throw new MemberAccessException(Environment.GetResourceString("AppDomain_AppBaseNotSet"));
+ throw new MemberAccessException(SR.AppDomain_AppBaseNotSet);
StringBuilder result = StringBuilderCache.Acquire();
internal class AppDomainUnloadedException : SystemException
{
public AppDomainUnloadedException()
- : base(Environment.GetResourceString("Arg_AppDomainUnloadedException"))
+ : base(SR.Arg_AppDomainUnloadedException)
{
SetErrorCode(__HResults.COR_E_APPDOMAINUNLOADED);
}
// Inherited from object
public override bool Equals(Object o)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NYI"));
+ throw new NotSupportedException(SR.NotSupported_NYI);
}
#else
public ArgIterator(RuntimeArgumentHandle arglist)
get
{
if (_rangeMessage == null)
- _rangeMessage = Environment.GetResourceString("Arg_ArgumentOutOfRangeException");
+ _rangeMessage = SR.Arg_ArgumentOutOfRangeException;
return _rangeMessage;
}
}
String s = base.Message;
if (m_actualValue != null)
{
- String valueMessage = Environment.GetResourceString("ArgumentOutOfRange_ActualValue", m_actualValue.ToString());
+ String valueMessage = SR.Format(SR.ArgumentOutOfRange_ActualValue, m_actualValue.ToString());
if (s == null)
return valueMessage;
return s + Environment.NewLine + valueMessage;
return AttributeUsageAttribute.Default;
throw new FormatException(
- Environment.GetResourceString("Format_AttributeUsage", type));
+ SR.Format(SR.Format_AttributeUsage, type));
}
private static Attribute[] CreateAttributeArrayHelper(Type elementType, int elementCount)
throw new ArgumentNullException(nameof(type));
if (!type.IsSubclassOf(typeof(Attribute)) && type != typeof(Attribute))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass"));
+ throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
Contract.EndContractBlock();
switch (element.MemberType)
throw new ArgumentNullException(nameof(attributeType));
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass"));
+ throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
Contract.EndContractBlock();
switch (element.MemberType)
if (attrib.Length == 1)
return attrib[0];
- throw new AmbiguousMatchException(Environment.GetResourceString("RFLCT.AmbigCust"));
+ throw new AmbiguousMatchException(SR.RFLCT_AmbigCust);
}
#endregion
throw new ArgumentNullException(nameof(attributeType));
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass"));
+ throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
if (element.Member == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidParameterInfo"), nameof(element));
+ throw new ArgumentException(SR.Argument_InvalidParameterInfo, nameof(element));
Contract.EndContractBlock();
throw new ArgumentNullException(nameof(element));
if (element.Member == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidParameterInfo"), nameof(element));
+ throw new ArgumentException(SR.Argument_InvalidParameterInfo, nameof(element));
Contract.EndContractBlock();
throw new ArgumentNullException(nameof(attributeType));
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass"));
+ throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
Contract.EndContractBlock();
MemberInfo member = element.Member;
default:
Debug.Assert(false, "Invalid type for ParameterInfo member in Attribute class");
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidParamInfo"));
+ throw new ArgumentException(SR.Argument_InvalidParamInfo);
}
}
if (attrib.Length == 1)
return attrib[0];
- throw new AmbiguousMatchException(Environment.GetResourceString("RFLCT.AmbigCust"));
+ throw new AmbiguousMatchException(SR.RFLCT_AmbigCust);
}
#endregion
throw new ArgumentNullException(nameof(attributeType));
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass"));
+ throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
Contract.EndContractBlock();
return (Attribute[])element.GetCustomAttributes(attributeType, inherit);
throw new ArgumentNullException(nameof(attributeType));
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass"));
+ throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
Contract.EndContractBlock();
return element.IsDefined(attributeType, false);
if (attrib.Length == 1)
return attrib[0];
- throw new AmbiguousMatchException(Environment.GetResourceString("RFLCT.AmbigCust"));
+ throw new AmbiguousMatchException(SR.RFLCT_AmbigCust);
}
#endregion
throw new ArgumentNullException(nameof(attributeType));
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass"));
+ throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
Contract.EndContractBlock();
return (Attribute[])element.GetCustomAttributes(attributeType, inherit);
throw new ArgumentNullException(nameof(attributeType));
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass"));
+ throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
Contract.EndContractBlock();
return element.IsDefined(attributeType, false);
if (attrib.Length == 1)
return attrib[0];
- throw new AmbiguousMatchException(Environment.GetResourceString("RFLCT.AmbigCust"));
+ throw new AmbiguousMatchException(SR.RFLCT_AmbigCust);
}
#endregion
private String _fusionLog; // fusion log (when applicable)
public BadImageFormatException()
- : base(Environment.GetResourceString("Arg_BadImageFormatException"))
+ : base(SR.Arg_BadImageFormatException)
{
SetErrorCode(__HResults.COR_E_BADIMAGEFORMAT);
}
{
if ((_fileName == null) &&
(HResult == System.__HResults.COR_E_EXCEPTION))
- _message = Environment.GetResourceString("Arg_BadImageFormatException");
+ _message = SR.Arg_BadImageFormatException;
else
_message = FileLoadException.FormatFileLoadExceptionMessage(_fileName, HResult);
String s = GetType().FullName + ": " + Message;
if (_fileName != null && _fileName.Length != 0)
- s += Environment.NewLine + Environment.GetResourceString("IO.FileName_Name", _fileName);
+ s += Environment.NewLine + SR.Format(SR.IO_FileName_Name, _fileName);
if (InnerException != null)
s = s + " ---> " + InnerException.ToString();
}
if (!(obj is Boolean))
{
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeBoolean"));
+ throw new ArgumentException(SR.Arg_MustBeBoolean);
}
if (m_value == ((Boolean)obj).m_value)
Boolean result = false;
if (!TryParse(value, out result))
{
- throw new FormatException(Environment.GetResourceString("Format_BadBoolean"));
+ throw new FormatException(SR.Format_BadBoolean);
}
else
{
/// <internalonly/>
char IConvertible.ToChar(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Boolean", "Char"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Boolean", "Char"));
}
/// <internalonly/>
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Boolean", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Boolean", "DateTime"));
}
/// <internalonly/>
// Is it of primitive types?
if (!IsPrimitiveTypeArray(array))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBePrimArray"), nameof(array));
+ throw new ArgumentException(SR.Arg_MustBePrimArray, nameof(array));
// Is the index in valid range of the array?
if (index < 0 || index >= _ByteLength(array))
// Is it of primitive types?
if (!IsPrimitiveTypeArray(array))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBePrimArray"), nameof(array));
+ throw new ArgumentException(SR.Arg_MustBePrimArray, nameof(array));
// Is the index in valid range of the array?
if (index < 0 || index >= _ByteLength(array))
// Is it of primitive types?
if (!IsPrimitiveTypeArray(array))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBePrimArray"), nameof(array));
+ throw new ArgumentException(SR.Arg_MustBePrimArray, nameof(array));
return _ByteLength(array);
}
}
if (!(value is Byte))
{
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeByte"));
+ throw new ArgumentException(SR.Arg_MustBeByte);
}
return m_value - (((Byte)value).m_value);
}
catch (OverflowException e)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Byte"), e);
+ throw new OverflowException(SR.Overflow_Byte, e);
}
- if (i < MinValue || i > MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_Byte"));
+ if (i < MinValue || i > MaxValue) throw new OverflowException(SR.Overflow_Byte);
return (byte)i;
}
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Byte", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Byte", "DateTime"));
}
/// <internalonly/>
}
if (!(value is Char))
{
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeChar"));
+ throw new ArgumentException(SR.Arg_MustBeChar);
}
return (m_value - ((Char)value).m_value);
if (s.Length != 1)
{
- throw new FormatException(Environment.GetResourceString("Format_NeedSingleChar"));
+ throw new FormatException(SR.Format_NeedSingleChar);
}
return s[0];
}
/// <internalonly/>
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Char", "Boolean"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Boolean"));
}
/// <internalonly/>
/// <internalonly/>
float IConvertible.ToSingle(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Char", "Single"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Single"));
}
/// <internalonly/>
double IConvertible.ToDouble(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Char", "Double"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Double"));
}
/// <internalonly/>
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Char", "Decimal"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Decimal"));
}
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Char", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "DateTime"));
}
/// <internalonly/>
// are considered as irregular code unit sequence, but they are not illegal.
if ((utf32 < 0 || utf32 > UNICODE_PLANE16_END) || (utf32 >= HIGH_SURROGATE_START && utf32 <= LOW_SURROGATE_END))
{
- throw new ArgumentOutOfRangeException(nameof(utf32), Environment.GetResourceString("ArgumentOutOfRange_InvalidUTF32"));
+ throw new ArgumentOutOfRangeException(nameof(utf32), SR.ArgumentOutOfRange_InvalidUTF32);
}
Contract.EndContractBlock();
{
if (!IsHighSurrogate(highSurrogate))
{
- throw new ArgumentOutOfRangeException(nameof(highSurrogate), Environment.GetResourceString("ArgumentOutOfRange_InvalidHighSurrogate"));
+ throw new ArgumentOutOfRangeException(nameof(highSurrogate), SR.ArgumentOutOfRange_InvalidHighSurrogate);
}
if (!IsLowSurrogate(lowSurrogate))
{
- throw new ArgumentOutOfRangeException(nameof(lowSurrogate), Environment.GetResourceString("ArgumentOutOfRange_InvalidLowSurrogate"));
+ throw new ArgumentOutOfRangeException(nameof(lowSurrogate), SR.ArgumentOutOfRange_InvalidLowSurrogate);
}
Contract.EndContractBlock();
return (((highSurrogate - CharUnicodeInfo.HIGH_SURROGATE_START) * 0x400) + (lowSurrogate - CharUnicodeInfo.LOW_SURROGATE_START) + UNICODE_PLANE01_START);
if (index < 0 || index >= s.Length)
{
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
}
Contract.EndContractBlock();
// Check if the character at index is a high surrogate.
}
else
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHighSurrogate", index), nameof(s));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidHighSurrogate, index), nameof(s));
}
}
else
{
// Found a high surrogate at the end of the string.
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHighSurrogate", index), nameof(s));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidHighSurrogate, index), nameof(s));
}
}
else
{
// Find a low surrogate at the character pointed by index.
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidLowSurrogate", index), nameof(s));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidLowSurrogate, index), nameof(s));
}
}
// Not a high-surrogate or low-surrogate. Genereate the UTF32 value for the BMP characters.
//
public ArrayList(int capacity)
{
- if (capacity < 0) throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegNum", nameof(capacity)));
+ if (capacity < 0) throw new ArgumentOutOfRangeException(nameof(capacity), SR.Format(SR.ArgumentOutOfRange_MustBeNonNegNum, nameof(capacity)));
Contract.EndContractBlock();
if (capacity == 0)
public ArrayList(ICollection c)
{
if (c == null)
- throw new ArgumentNullException(nameof(c), Environment.GetResourceString("ArgumentNull_Collection"));
+ throw new ArgumentNullException(nameof(c), SR.ArgumentNull_Collection);
Contract.EndContractBlock();
int count = c.Count;
{
if (value < _size)
{
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_SmallCapacity);
}
Contract.Ensures(Capacity >= 0);
Contract.EndContractBlock();
{
get
{
- if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
Contract.EndContractBlock();
return _items[index];
}
set
{
- if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
Contract.EndContractBlock();
_items[index] = value;
_version++;
public virtual void CopyTo(Array array, int arrayIndex)
{
if ((array != null) && (array.Rank != 1))
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
+ throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
Contract.EndContractBlock();
// Delegate rest of error checking to Array.Copy.
Array.Copy(_items, 0, array, arrayIndex, _size);
public virtual void Insert(int index, Object value)
{
// Note that insertions at the end are legal.
- if (index < 0 || index > _size) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_ArrayListInsert"));
+ if (index < 0 || index > _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_ArrayListInsert);
//Contract.Ensures(Count == Contract.OldValue(Count) + 1);
Contract.EndContractBlock();
public virtual void InsertRange(int index, ICollection c)
{
if (c == null)
- throw new ArgumentNullException(nameof(c), Environment.GetResourceString("ArgumentNull_Collection"));
- if (index < 0 || index > _size) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentNullException(nameof(c), SR.ArgumentNull_Collection);
+ if (index < 0 || index > _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
//Contract.Ensures(Count == Contract.OldValue(Count) + c.Count);
Contract.EndContractBlock();
//
public virtual void RemoveAt(int index)
{
- if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
Contract.Ensures(Count >= 0);
//Contract.Ensures(Count == Contract.OldValue(Count) - 1);
Contract.EndContractBlock();
}
set
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
+ throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
}
}
public virtual int Add(Object obj)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
+ throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
}
public virtual void Clear()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
+ throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
}
public virtual bool Contains(Object obj)
public virtual void Insert(int index, Object obj)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
+ throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
}
public virtual void Remove(Object value)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
+ throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
}
public virtual void RemoveAt(int index)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
+ throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
}
}
{
if (version != list._version)
{
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
+ throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
}
if (isArrayList)
{ // check if enumeration has not started or has terminated
if (index == -1)
{
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
+ throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
}
else
{
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded));
+ throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded));
}
}
{
if (version != list._version)
{
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
+ throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
}
currentElement = dummyObject;
if (ib != null)
return -ib.CompareTo(a);
- throw new ArgumentException(Environment.GetResourceString("Argument_ImplementIComparable"));
+ throw new ArgumentException(SR.Argument_ImplementIComparable);
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
if (ia != null)
return ia.CompareTo(b);
- throw new ArgumentException(Environment.GetResourceString("Argument_ImplementIComparable"));
+ throw new ArgumentException(SR.Argument_ImplementIComparable);
}
public new bool Equals(Object a, Object b)
/// cref="ICollection"/>. This property is not supported.
/// </summary>
/// <exception cref="NotSupportedException">The SyncRoot property is not supported.</exception>
- object ICollection.SyncRoot { get { throw new NotSupportedException(Environment.GetResourceString("ConcurrentCollection_SyncRoot_NotSupported")); } }
+ object ICollection.SyncRoot { get { throw new NotSupportedException(SR.ConcurrentCollection_SyncRoot_NotSupported); } }
/// <summary>Returns an enumerator that iterates through a collection.</summary>
/// <returns>An <see cref="IEnumerator"/> that can be used to iterate through the collection.</returns>
long count = GetCount(head, headHead, tail, tailTail);
if (index > array.Length - count)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_ArrayPlusOffTooSmall"));
+ throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall);
}
// Copy the items to the target array
{
get
{
- throw new NotSupportedException(Environment.GetResourceString("ConcurrentCollection_SyncRoot_NotSupported"));
+ throw new NotSupportedException(SR.ConcurrentCollection_SyncRoot_NotSupported);
}
}
throw new ArgumentNullException(nameof(array));
if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
+ throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum);
if (array.Length - index < this.Count)
- throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Index"), nameof(index));
+ throw new ArgumentException(SR.ArgumentOutOfRange_Index, nameof(index));
Contract.EndContractBlock();
// the actual copy is a NOP
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
return null;
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
if (!key.GetType().IsSerializable)
- throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), nameof(key));
+ throw new ArgumentException(SR.Argument_NotSerializable, nameof(key));
if ((value != null) && (!value.GetType().IsSerializable))
- throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), nameof(value));
+ throw new ArgumentException(SR.Argument_NotSerializable, nameof(value));
Contract.EndContractBlock();
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_ReadOnly);
}
}
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
if (!key.GetType().IsSerializable)
- throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), nameof(key));
+ throw new ArgumentException(SR.Argument_NotSerializable, nameof(key));
if ((value != null) && (!value.GetType().IsSerializable))
- throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), nameof(value));
+ throw new ArgumentException(SR.Argument_NotSerializable, nameof(value));
Contract.EndContractBlock();
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_ReadOnly);
}
public void Clear()
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_ReadOnly);
}
public bool IsReadOnly
public void Remove(Object key)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_ReadOnly);
}
private sealed class NodeEnumerator : IDictionaryEnumerator
{
get
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
}
{
get
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
}
{
get
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
}
{
get
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
}
}
internal static void ThrowOrIgnoreBadComparer(Object comparer)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_BogusIComparer", comparer));
+ throw new ArgumentException(SR.Format(SR.Arg_BogusIComparer, comparer));
}
}
}
catch (Exception e)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
}
}
}
catch (Exception e)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
}
}
}
catch (Exception e)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
}
}
}
catch (Exception e)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
}
}
}
catch (Exception e)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
}
}
}
catch (Exception e)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
}
}
}
catch (Exception e)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
}
}
if (array == null)
throw new ArgumentNullException(nameof(array));
if (startIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
if (count > array.Length - startIndex)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
if (count == 0) return -1;
fixed (byte* pbytes = array)
public Hashtable(int capacity, float loadFactor)
{
if (capacity < 0)
- throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_NeedNonNegNum);
if (!(loadFactor >= 0.1f && loadFactor <= 1.0f))
- throw new ArgumentOutOfRangeException(nameof(loadFactor), Environment.GetResourceString("ArgumentOutOfRange_HashtableLoadFactor", .1, 1.0));
+ throw new ArgumentOutOfRangeException(nameof(loadFactor), SR.Format(SR.ArgumentOutOfRange_HashtableLoadFactor, .1, 1.0));
Contract.EndContractBlock();
// Based on perf work, .72 is the optimal load factor for this table.
double rawsize = capacity / this.loadFactor;
if (rawsize > Int32.MaxValue)
- throw new ArgumentException(Environment.GetResourceString("Arg_HTCapacityOverflow"));
+ throw new ArgumentException(SR.Arg_HTCapacityOverflow);
// Avoid awfully small sizes
int hashsize = (rawsize > InitialSize) ? HashHelpers.GetPrime((int)rawsize) : InitialSize;
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
public virtual void CopyTo(Array array, int arrayIndex)
{
if (array == null)
- throw new ArgumentNullException(nameof(array), Environment.GetResourceString("ArgumentNull_Array"));
+ throw new ArgumentNullException(nameof(array), SR.ArgumentNull_Array);
if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
+ throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(arrayIndex), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(arrayIndex), SR.ArgumentOutOfRange_NeedNonNegNum);
if (array.Length - arrayIndex < Count)
- throw new ArgumentException(Environment.GetResourceString("Arg_ArrayPlusOffTooSmall"));
+ throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall);
Contract.EndContractBlock();
CopyEntries(array, arrayIndex);
}
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
if (count >= loadsize)
{
if (add)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicate__", buckets[bucketNumber].key, key));
+ throw new ArgumentException(SR.Format(SR.Argument_AddingDuplicate__, buckets[bucketNumber].key, key));
}
isWriterInProgress = true;
buckets[bucketNumber].val = nvalue;
// Then verify that our double hash function (h2, described at top of file)
// meets the requirements described above. You should never see this assert.
Debug.Assert(false, "hash table insert failed! Load factor too high, or our double hashing function is incorrect.");
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_HashInsertFailed"));
+ throw new InvalidOperationException(SR.InvalidOperation_HashInsertFailed);
}
private void putEntry(bucket[] newBuckets, Object key, Object nvalue, int hashcode)
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
Debug.Assert(!isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized.");
bn = (int)(((long)bn + incr) % (uint)buckets.Length);
} while (b.hash_coll < 0 && ++ntry < buckets.Length);
- //throw new ArgumentException(Environment.GetResourceString("Arg_RemoveArgNotFound"));
+ //throw new ArgumentException(SR.Arg_RemoveArgNotFound);
}
// Returns the object to synchronize on for this hash table.
// Explicitly check to see if anyone changed the Hashtable while we
// were serializing it. That's a race condition in their code.
if (version != oldVersion)
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
+ throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
}
}
if (siInfo == null)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidOnDeser"));
+ throw new SerializationException(SR.Serialization_InvalidOnDeser);
}
int hashsize = 0;
if (serKeys == null)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_MissingKeys"));
+ throw new SerializationException(SR.Serialization_MissingKeys);
}
if (serValues == null)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_MissingValues"));
+ throw new SerializationException(SR.Serialization_MissingValues);
}
if (serKeys.Length != serValues.Length)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_KeyValueDifferentSizes"));
+ throw new SerializationException(SR.Serialization_KeyValueDifferentSizes);
}
for (int i = 0; i < serKeys.Length; i++)
{
if (serKeys[i] == null)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_NullKey"));
+ throw new SerializationException(SR.Serialization_NullKey);
}
Insert(serKeys[i], serValues[i], true);
}
if (array == null)
throw new ArgumentNullException(nameof(array));
if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
+ throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(arrayIndex), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(arrayIndex), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
if (array.Length - arrayIndex < _hashtable.count)
- throw new ArgumentException(Environment.GetResourceString("Arg_ArrayPlusOffTooSmall"));
+ throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall);
_hashtable.CopyKeys(array, arrayIndex);
}
if (array == null)
throw new ArgumentNullException(nameof(array));
if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
+ throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(arrayIndex), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(arrayIndex), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
if (array.Length - arrayIndex < _hashtable.count)
- throw new ArgumentException(Environment.GetResourceString("Arg_ArrayPlusOffTooSmall"));
+ throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall);
_hashtable.CopyValues(array, arrayIndex);
}
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
return _table.ContainsKey(key);
{
get
{
- if (current == false) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
+ if (current == false) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
return currentKey;
}
}
public virtual bool MoveNext()
{
- if (version != hashtable.version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
+ if (version != hashtable.version) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
while (bucket > 0)
{
bucket--;
{
get
{
- if (current == false) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen));
+ if (current == false) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen));
return new DictionaryEntry(currentKey, currentValue);
}
}
{
get
{
- if (current == false) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen));
+ if (current == false) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen));
if (getObjectRetType == Keys)
return currentKey;
{
get
{
- if (current == false) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen));
+ if (current == false) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen));
return currentValue;
}
}
public virtual void Reset()
{
- if (version != hashtable.version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
+ if (version != hashtable.version) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
current = false;
bucket = hashtable.buckets.Length;
currentKey = null;
public static int GetPrime(int min)
{
if (min < 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_HTCapacityOverflow"));
+ throw new ArgumentException(SR.Arg_HTCapacityOverflow);
Contract.EndContractBlock();
for (int i = 0; i < primes.Length; i++)
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
DictionaryNode node = head;
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
{
if (node.key.Equals(key))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicate__", node.key, key));
+ throw new ArgumentException(SR.Format(SR.Argument_AddingDuplicate__, node.key, key));
}
last = node;
}
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
for (DictionaryNode node = head; node != null; node = node.next)
throw new ArgumentNullException(nameof(array));
if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
+ throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum);
if (array.Length - index < this.Count)
- throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Index"), nameof(index));
+ throw new ArgumentException(SR.ArgumentOutOfRange_Index, nameof(index));
Contract.EndContractBlock();
for (DictionaryNode node = head; node != null; node = node.next)
{
if (key == null)
{
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+ throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
}
Contract.EndContractBlock();
version++;
{
if (current == null)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
return new DictionaryEntry(current.key, current.value);
}
{
if (current == null)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
return current.key;
}
{
if (current == null)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
return current.value;
}
{
if (version != list.version)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion);
}
if (start)
{
{
if (version != list.version)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion);
}
start = true;
current = null;
if (array == null)
throw new ArgumentNullException(nameof(array));
if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
+ throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
if (array.Length - index < list.Count)
- throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Index"), nameof(index));
+ throw new ArgumentException(SR.ArgumentOutOfRange_Index, nameof(index));
for (DictionaryNode node = list.head; node != null; node = node.next)
{
array.SetValue(isKeys ? node.key : node.value, index);
{
if (current == null)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
return isKeys ? current.key : current.value;
}
{
if (version != list.version)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion);
}
if (start)
{
{
if (version != list.version)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion);
}
start = true;
current = null;
{
if (year < 1 || year > 9999)
{
- throw new ArgumentOutOfRangeException(nameof(year), Environment.GetResourceString("ArgumentOutOfRange_Range", 1, 9999));
+ throw new ArgumentOutOfRangeException(nameof(year), SR.Format(SR.ArgumentOutOfRange_Range, 1, 9999));
}
Contract.EndContractBlock();
private DBNull(SerializationInfo info, StreamingContext context)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DBNullSerial"));
+ throw new NotSupportedException(SR.NotSupported_DBNullSerial);
}
public static readonly DBNull Value = new DBNull();
/// <internalonly/>
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
char IConvertible.ToChar(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
byte IConvertible.ToByte(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
short IConvertible.ToInt16(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
int IConvertible.ToInt32(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
long IConvertible.ToInt64(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
float IConvertible.ToSingle(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
double IConvertible.ToDouble(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull"));
+ throw new InvalidCastException(SR.InvalidCast_FromDBNull);
}
/// <internalonly/>
public DateTime(long ticks)
{
if (ticks < MinTicks || ticks > MaxTicks)
- throw new ArgumentOutOfRangeException(nameof(ticks), Environment.GetResourceString("ArgumentOutOfRange_DateTimeBadTicks"));
+ throw new ArgumentOutOfRangeException(nameof(ticks), SR.ArgumentOutOfRange_DateTimeBadTicks);
Contract.EndContractBlock();
dateData = (UInt64)ticks;
}
{
if (ticks < MinTicks || ticks > MaxTicks)
{
- throw new ArgumentOutOfRangeException(nameof(ticks), Environment.GetResourceString("ArgumentOutOfRange_DateTimeBadTicks"));
+ throw new ArgumentOutOfRangeException(nameof(ticks), SR.ArgumentOutOfRange_DateTimeBadTicks);
}
if (kind < DateTimeKind.Unspecified || kind > DateTimeKind.Local)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDateTimeKind"), nameof(kind));
+ throw new ArgumentException(SR.Argument_InvalidDateTimeKind, nameof(kind));
}
Contract.EndContractBlock();
dateData = ((UInt64)ticks | ((UInt64)kind << KindShift));
{
if (ticks < MinTicks || ticks > MaxTicks)
{
- throw new ArgumentOutOfRangeException(nameof(ticks), Environment.GetResourceString("ArgumentOutOfRange_DateTimeBadTicks"));
+ throw new ArgumentOutOfRangeException(nameof(ticks), SR.ArgumentOutOfRange_DateTimeBadTicks);
}
Contract.Requires(kind == DateTimeKind.Local, "Internal Constructor is for local times only");
Contract.EndContractBlock();
{
if (kind < DateTimeKind.Unspecified || kind > DateTimeKind.Local)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDateTimeKind"), nameof(kind));
+ throw new ArgumentException(SR.Argument_InvalidDateTimeKind, nameof(kind));
}
Contract.EndContractBlock();
Int64 ticks = DateToTicks(year, month, day) + TimeToTicks(hour, minute, second);
{
if (millisecond < 0 || millisecond >= MillisPerSecond)
{
- throw new ArgumentOutOfRangeException(nameof(millisecond), Environment.GetResourceString("ArgumentOutOfRange_Range", 0, MillisPerSecond - 1));
+ throw new ArgumentOutOfRangeException(nameof(millisecond), SR.Format(SR.ArgumentOutOfRange_Range, 0, MillisPerSecond - 1));
}
Contract.EndContractBlock();
Int64 ticks = DateToTicks(year, month, day) + TimeToTicks(hour, minute, second);
ticks += millisecond * TicksPerMillisecond;
if (ticks < MinTicks || ticks > MaxTicks)
- throw new ArgumentException(Environment.GetResourceString("Arg_DateTimeRange"));
+ throw new ArgumentException(SR.Arg_DateTimeRange);
dateData = (UInt64)ticks;
}
{
if (millisecond < 0 || millisecond >= MillisPerSecond)
{
- throw new ArgumentOutOfRangeException(nameof(millisecond), Environment.GetResourceString("ArgumentOutOfRange_Range", 0, MillisPerSecond - 1));
+ throw new ArgumentOutOfRangeException(nameof(millisecond), SR.Format(SR.ArgumentOutOfRange_Range, 0, MillisPerSecond - 1));
}
if (kind < DateTimeKind.Unspecified || kind > DateTimeKind.Local)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDateTimeKind"), nameof(kind));
+ throw new ArgumentException(SR.Argument_InvalidDateTimeKind, nameof(kind));
}
Contract.EndContractBlock();
Int64 ticks = DateToTicks(year, month, day) + TimeToTicks(hour, minute, second);
ticks += millisecond * TicksPerMillisecond;
if (ticks < MinTicks || ticks > MaxTicks)
- throw new ArgumentException(Environment.GetResourceString("Arg_DateTimeRange"));
+ throw new ArgumentException(SR.Arg_DateTimeRange);
dateData = ((UInt64)ticks | ((UInt64)kind << KindShift));
}
throw new ArgumentNullException(nameof(calendar));
if (millisecond < 0 || millisecond >= MillisPerSecond)
{
- throw new ArgumentOutOfRangeException(nameof(millisecond), Environment.GetResourceString("ArgumentOutOfRange_Range", 0, MillisPerSecond - 1));
+ throw new ArgumentOutOfRangeException(nameof(millisecond), SR.Format(SR.ArgumentOutOfRange_Range, 0, MillisPerSecond - 1));
}
Contract.EndContractBlock();
Int64 ticks = calendar.ToDateTime(year, month, day, hour, minute, second, 0).Ticks;
ticks += millisecond * TicksPerMillisecond;
if (ticks < MinTicks || ticks > MaxTicks)
- throw new ArgumentException(Environment.GetResourceString("Arg_DateTimeRange"));
+ throw new ArgumentException(SR.Arg_DateTimeRange);
dateData = (UInt64)ticks;
}
throw new ArgumentNullException(nameof(calendar));
if (millisecond < 0 || millisecond >= MillisPerSecond)
{
- throw new ArgumentOutOfRangeException(nameof(millisecond), Environment.GetResourceString("ArgumentOutOfRange_Range", 0, MillisPerSecond - 1));
+ throw new ArgumentOutOfRangeException(nameof(millisecond), SR.Format(SR.ArgumentOutOfRange_Range, 0, MillisPerSecond - 1));
}
if (kind < DateTimeKind.Unspecified || kind > DateTimeKind.Local)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDateTimeKind"), nameof(kind));
+ throw new ArgumentException(SR.Argument_InvalidDateTimeKind, nameof(kind));
}
Contract.EndContractBlock();
Int64 ticks = calendar.ToDateTime(year, month, day, hour, minute, second, 0).Ticks;
ticks += millisecond * TicksPerMillisecond;
if (ticks < MinTicks || ticks > MaxTicks)
- throw new ArgumentException(Environment.GetResourceString("Arg_DateTimeRange"));
+ throw new ArgumentException(SR.Arg_DateTimeRange);
dateData = ((UInt64)ticks | ((UInt64)kind << KindShift));
}
}
else
{
- throw new SerializationException(Environment.GetResourceString("Serialization_MissingDateTimeData"));
+ throw new SerializationException(SR.Serialization_MissingDateTimeData);
}
Int64 ticks = InternalTicks;
if (ticks < MinTicks || ticks > MaxTicks)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_DateTimeTicksOutOfRange"));
+ throw new SerializationException(SR.Serialization_DateTimeTicksOutOfRange);
}
}
{
long millis = (long)(value * scale + (value >= 0 ? 0.5 : -0.5));
if (millis <= -MaxMillis || millis >= MaxMillis)
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_AddValue"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_AddValue);
return AddTicks(millis * TicksPerMillisecond);
}
//
public DateTime AddMonths(int months)
{
- if (months < -120000 || months > 120000) throw new ArgumentOutOfRangeException(nameof(months), Environment.GetResourceString("ArgumentOutOfRange_DateTimeBadMonths"));
+ if (months < -120000 || months > 120000) throw new ArgumentOutOfRangeException(nameof(months), SR.ArgumentOutOfRange_DateTimeBadMonths);
Contract.EndContractBlock();
int y = GetDatePart(DatePartYear);
int m = GetDatePart(DatePartMonth);
}
if (y < 1 || y > 9999)
{
- throw new ArgumentOutOfRangeException(nameof(months), Environment.GetResourceString("ArgumentOutOfRange_DateArithmetic"));
+ throw new ArgumentOutOfRangeException(nameof(months), SR.ArgumentOutOfRange_DateArithmetic);
}
int days = DaysInMonth(y, m);
if (d > days) d = days;
long ticks = InternalTicks;
if (value > MaxTicks - ticks || value < MinTicks - ticks)
{
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_DateArithmetic"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_DateArithmetic);
}
return new DateTime((UInt64)(ticks + value) | InternalKind);
}
{
// DateTimeOffset.AddYears(int years) is implemented on top of DateTime.AddYears(int value). Use the more appropriate
// parameter name out of the two for the exception.
- throw new ArgumentOutOfRangeException("years", Environment.GetResourceString("ArgumentOutOfRange_DateTimeBadYears"));
+ throw new ArgumentOutOfRangeException("years", SR.ArgumentOutOfRange_DateTimeBadYears);
}
Contract.EndContractBlock();
return AddMonths(value * 12);
if (value == null) return 1;
if (!(value is DateTime))
{
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDateTime"));
+ throw new ArgumentException(SR.Arg_MustBeDateTime);
}
return Compare(this, (DateTime)value);
return n * TicksPerDay;
}
}
- throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("ArgumentOutOfRange_BadYearMonthDay"));
+ throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadYearMonthDay);
}
// Return the tick count corresponding to the given hour, minute, second.
{
return (TimeSpan.TimeToTicks(hour, minute, second));
}
- throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("ArgumentOutOfRange_BadHourMinuteSecond"));
+ throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadHourMinuteSecond);
}
// Returns the number of days in the month given by the year and
//
public static int DaysInMonth(int year, int month)
{
- if (month < 1 || month > 12) throw new ArgumentOutOfRangeException(nameof(month), Environment.GetResourceString("ArgumentOutOfRange_Month"));
+ if (month < 1 || month > 12) throw new ArgumentOutOfRangeException(nameof(month), SR.ArgumentOutOfRange_Month);
Contract.EndContractBlock();
// IsLeapYear checks the year argument
int[] days = IsLeapYear(year) ? DaysToMonth366 : DaysToMonth365;
{
// The check done this way will take care of NaN
if (!(value < OADateMaxAsDouble) || !(value > OADateMinAsDouble))
- throw new ArgumentException(Environment.GetResourceString("Arg_OleAutDateInvalid"));
+ throw new ArgumentException(SR.Arg_OleAutDateInvalid);
// Conversion to long will not cause an overflow here, as at this point the "value" is in between OADateMinAsDouble and OADateMaxAsDouble
long millis = (long)(value * MillisPerDay + (value >= 0 ? 0.5 : -0.5));
millis += DoubleDateOffset / TicksPerMillisecond;
- if (millis < 0 || millis >= MaxMillis) throw new ArgumentException(Environment.GetResourceString("Arg_OleAutDateScale"));
+ if (millis < 0 || millis >= MaxMillis) throw new ArgumentException(SR.Arg_OleAutDateScale);
return millis * TicksPerMillisecond;
}
}
if (ticks < MinTicks || ticks > MaxTicks)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeBadBinaryData"), nameof(dateData));
+ throw new ArgumentException(SR.Argument_DateTimeBadBinaryData, nameof(dateData));
}
return new DateTime(ticks, DateTimeKind.Local, isAmbiguousLocalDst);
}
{
Int64 ticks = dateData & (Int64)TicksMask;
if (ticks < MinTicks || ticks > MaxTicks)
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeBadBinaryData"), nameof(dateData));
+ throw new ArgumentException(SR.Argument_DateTimeBadBinaryData, nameof(dateData));
return new DateTime((UInt64)dateData);
}
{
if (fileTime < 0 || fileTime > MaxTicks - FileTimeOffset)
{
- throw new ArgumentOutOfRangeException(nameof(fileTime), Environment.GetResourceString("ArgumentOutOfRange_FileTimeInvalid"));
+ throw new ArgumentOutOfRangeException(nameof(fileTime), SR.ArgumentOutOfRange_FileTimeInvalid);
}
Contract.EndContractBlock();
{
if (year < 1 || year > 9999)
{
- throw new ArgumentOutOfRangeException(nameof(year), Environment.GetResourceString("ArgumentOutOfRange_Year"));
+ throw new ArgumentOutOfRangeException(nameof(year), SR.ArgumentOutOfRange_Year);
}
Contract.EndContractBlock();
return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
long valueTicks = value._ticks;
if (ticks - MinTicks < valueTicks || ticks - MaxTicks > valueTicks)
{
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_DateArithmetic"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_DateArithmetic);
}
return new DateTime((UInt64)(ticks - valueTicks) | InternalKind);
}
if (value < TicksPerDay) // This is a fix for VB. They want the default day to be 1/1/0001 rathar then 12/30/1899.
value += DoubleDateOffset; // We could have moved this fix down but we would like to keep the bounds check.
if (value < OADateMinAsTicks)
- throw new OverflowException(Environment.GetResourceString("Arg_OleAutDateInvalid"));
+ throw new OverflowException(SR.Arg_OleAutDateInvalid);
// Currently, our max date == OA's max date (12/31/9999), so we don't
// need an overflow check in that direction.
long millis = (value - DoubleDateOffset) / TicksPerMillisecond;
ticks -= FileTimeOffset;
if (ticks < 0)
{
- throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("ArgumentOutOfRange_FileTimeInvalid"));
+ throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_FileTimeInvalid);
}
return ticks;
}
if (tick > DateTime.MaxTicks)
{
if (throwOnOverflow)
- throw new ArgumentException(Environment.GetResourceString("Arg_ArgumentOutOfRangeException"));
+ throw new ArgumentException(SR.Arg_ArgumentOutOfRangeException);
else
return new DateTime(DateTime.MaxTicks, DateTimeKind.Local);
}
if (tick < DateTime.MinTicks)
{
if (throwOnOverflow)
- throw new ArgumentException(Environment.GetResourceString("Arg_ArgumentOutOfRangeException"));
+ throw new ArgumentException(SR.Arg_ArgumentOutOfRangeException);
else
return new DateTime(DateTime.MinTicks, DateTimeKind.Local);
}
long valueTicks = t._ticks;
if (valueTicks > MaxTicks - ticks || valueTicks < MinTicks - ticks)
{
- throw new ArgumentOutOfRangeException(nameof(t), Environment.GetResourceString("ArgumentOutOfRange_DateArithmetic"));
+ throw new ArgumentOutOfRangeException(nameof(t), SR.ArgumentOutOfRange_DateArithmetic);
}
return new DateTime((UInt64)(ticks + valueTicks) | d.InternalKind);
}
long valueTicks = t._ticks;
if (ticks - MinTicks < valueTicks || ticks - MaxTicks > valueTicks)
{
- throw new ArgumentOutOfRangeException(nameof(t), Environment.GetResourceString("ArgumentOutOfRange_DateArithmetic"));
+ throw new ArgumentOutOfRangeException(nameof(t), SR.ArgumentOutOfRange_DateArithmetic);
}
return new DateTime((UInt64)(ticks - valueTicks) | d.InternalKind);
}
/// <internalonly/>
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Boolean"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Boolean"));
}
/// <internalonly/>
char IConvertible.ToChar(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Char"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Char"));
}
/// <internalonly/>
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "SByte"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "SByte"));
}
/// <internalonly/>
byte IConvertible.ToByte(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Byte"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Byte"));
}
/// <internalonly/>
short IConvertible.ToInt16(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Int16"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Int16"));
}
/// <internalonly/>
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "UInt16"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "UInt16"));
}
/// <internalonly/>
int IConvertible.ToInt32(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Int32"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Int32"));
}
/// <internalonly/>
uint IConvertible.ToUInt32(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "UInt32"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "UInt32"));
}
/// <internalonly/>
long IConvertible.ToInt64(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Int64"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Int64"));
}
/// <internalonly/>
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "UInt64"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "UInt64"));
}
/// <internalonly/>
float IConvertible.ToSingle(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Single"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Single"));
}
/// <internalonly/>
double IConvertible.ToDouble(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Double"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Double"));
}
/// <internalonly/>
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Decimal"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Decimal"));
}
/// <internalonly/>
{
if (offset != TimeZoneInfo.GetLocalUtcOffset(dateTime, TimeZoneInfoOptions.NoThrowOnInvalidTime))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_OffsetLocalMismatch"), nameof(offset));
+ throw new ArgumentException(SR.Argument_OffsetLocalMismatch, nameof(offset));
}
}
else if (dateTime.Kind == DateTimeKind.Utc)
{
if (offset != TimeSpan.Zero)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_OffsetUtcMismatch"), nameof(offset));
+ throw new ArgumentException(SR.Argument_OffsetUtcMismatch, nameof(offset));
}
}
m_offsetMinutes = ValidateOffset(offset);
if (obj == null) return 1;
if (!(obj is DateTimeOffset))
{
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDateTimeOffset"));
+ throw new ArgumentException(SR.Arg_MustBeDateTimeOffset);
}
DateTime objUtc = ((DateTimeOffset)obj).UtcDateTime;
if (seconds < UnixMinSeconds || seconds > UnixMaxSeconds)
{
throw new ArgumentOutOfRangeException(nameof(seconds),
- string.Format(Environment.GetResourceString("ArgumentOutOfRange_Range"), UnixMinSeconds, UnixMaxSeconds));
+ string.Format(SR.ArgumentOutOfRange_Range, UnixMinSeconds, UnixMaxSeconds));
}
long ticks = seconds * TimeSpan.TicksPerSecond + UnixEpochTicks;
if (milliseconds < MinMilliseconds || milliseconds > MaxMilliseconds)
{
throw new ArgumentOutOfRangeException(nameof(milliseconds),
- string.Format(Environment.GetResourceString("ArgumentOutOfRange_Range"), MinMilliseconds, MaxMilliseconds));
+ string.Format(SR.ArgumentOutOfRange_Range, MinMilliseconds, MaxMilliseconds));
}
long ticks = milliseconds * TimeSpan.TicksPerMillisecond + UnixEpochTicks;
}
catch (ArgumentException e)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e);
+ throw new SerializationException(SR.Serialization_InvalidData, e);
}
}
Int64 ticks = offset.Ticks;
if (ticks % TimeSpan.TicksPerMinute != 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_OffsetPrecision"), nameof(offset));
+ throw new ArgumentException(SR.Argument_OffsetPrecision, nameof(offset));
}
if (ticks < MinOffset || ticks > MaxOffset)
{
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("Argument_OffsetOutOfRange"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.Argument_OffsetOutOfRange);
}
return (Int16)(offset.Ticks / TimeSpan.TicksPerMinute);
}
Int64 utcTicks = dateTime.Ticks - offset.Ticks;
if (utcTicks < DateTime.MinTicks || utcTicks > DateTime.MaxTicks)
{
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("Argument_UTCOutOfRange"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.Argument_UTCOutOfRange);
}
// make sure the Kind is set to Unspecified
//
{
if ((style & DateTimeFormatInfo.InvalidDateTimeStyles) != 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDateTimeStyles"), parameterName);
+ throw new ArgumentException(SR.Argument_InvalidDateTimeStyles, parameterName);
}
if (((style & (DateTimeStyles.AssumeLocal)) != 0) && ((style & (DateTimeStyles.AssumeUniversal)) != 0))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_ConflictingDateTimeStyles"), parameterName);
+ throw new ArgumentException(SR.Argument_ConflictingDateTimeStyles, parameterName);
}
if ((style & DateTimeStyles.NoCurrentDateDefault) != 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeOffsetInvalidDateTimeStyles"), parameterName);
+ throw new ArgumentException(SR.Argument_DateTimeOffsetInvalidDateTimeStyles, parameterName);
}
Contract.EndContractBlock();
return;
}
}
- throw new ArgumentException(Environment.GetResourceString("Arg_DecBitCtor"));
+ throw new ArgumentException(SR.Arg_DecBitCtor);
}
// Constructs a Decimal from its constituent parts.
public Decimal(int lo, int mid, int hi, bool isNegative, byte scale)
{
if (scale > 28)
- throw new ArgumentOutOfRangeException(nameof(scale), Environment.GetResourceString("ArgumentOutOfRange_DecimalScale"));
+ throw new ArgumentOutOfRangeException(nameof(scale), SR.ArgumentOutOfRange_DecimalScale);
Contract.EndContractBlock();
this.lo = lo;
this.mid = mid;
}
catch (ArgumentException e)
{
- throw new SerializationException(Environment.GetResourceString("Overflow_Decimal"), e);
+ throw new SerializationException(SR.Overflow_Decimal, e);
}
}
}
catch (ArgumentException e)
{
- throw new SerializationException(Environment.GetResourceString("Overflow_Decimal"), e);
+ throw new SerializationException(SR.Overflow_Decimal, e);
}
}
this.flags = flags;
return;
}
- throw new ArgumentException(Environment.GetResourceString("Arg_DecBitCtor"));
+ throw new ArgumentException(SR.Arg_DecBitCtor);
}
// Returns the absolute value of the given Decimal. If d is
if (value == null)
return 1;
if (!(value is Decimal))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDecimal"));
+ throw new ArgumentException(SR.Arg_MustBeDecimal);
Decimal other = (Decimal)value;
return FCallCompare(ref this, ref other);
public static Decimal Round(Decimal d, int decimals, MidpointRounding mode)
{
if ((decimals < 0) || (decimals > 28))
- throw new ArgumentOutOfRangeException(nameof(decimals), Environment.GetResourceString("ArgumentOutOfRange_DecimalRound"));
+ throw new ArgumentOutOfRangeException(nameof(decimals), SR.ArgumentOutOfRange_DecimalRound);
if (mode < MidpointRounding.ToEven || mode > MidpointRounding.AwayFromZero)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidEnumValue", mode, nameof(MidpointRounding)), nameof(mode));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode, nameof(MidpointRounding)), nameof(mode));
}
Contract.EndContractBlock();
}
catch (OverflowException e)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Byte"), e);
+ throw new OverflowException(SR.Overflow_Byte, e);
}
- if (temp < Byte.MinValue || temp > Byte.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_Byte"));
+ if (temp < Byte.MinValue || temp > Byte.MaxValue) throw new OverflowException(SR.Overflow_Byte);
return (byte)temp;
}
}
catch (OverflowException e)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_SByte"), e);
+ throw new OverflowException(SR.Overflow_SByte, e);
}
- if (temp < SByte.MinValue || temp > SByte.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_SByte"));
+ if (temp < SByte.MinValue || temp > SByte.MaxValue) throw new OverflowException(SR.Overflow_SByte);
return (sbyte)temp;
}
}
catch (OverflowException e)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Int16"), e);
+ throw new OverflowException(SR.Overflow_Int16, e);
}
- if (temp < Int16.MinValue || temp > Int16.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_Int16"));
+ if (temp < Int16.MinValue || temp > Int16.MaxValue) throw new OverflowException(SR.Overflow_Int16);
return (short)temp;
}
if (i <= 0) return i;
}
}
- throw new OverflowException(Environment.GetResourceString("Overflow_Int32"));
+ throw new OverflowException(SR.Overflow_Int32);
}
// Converts a Decimal to a long. The Decimal value is rounded towards zero
if (l <= 0) return l;
}
}
- throw new OverflowException(Environment.GetResourceString("Overflow_Int64"));
+ throw new OverflowException(SR.Overflow_Int64);
}
// Converts a Decimal to an ushort. The Decimal
}
catch (OverflowException e)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"), e);
+ throw new OverflowException(SR.Overflow_UInt16, e);
}
- if (temp < UInt16.MinValue || temp > UInt16.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
+ if (temp < UInt16.MinValue || temp > UInt16.MaxValue) throw new OverflowException(SR.Overflow_UInt16);
return (ushort)temp;
}
if (d.flags >= 0 || i == 0)
return i;
}
- throw new OverflowException(Environment.GetResourceString("Overflow_UInt32"));
+ throw new OverflowException(SR.Overflow_UInt32);
}
// Converts a Decimal to an unsigned long. The Decimal
if (d.flags >= 0 || l == 0)
return l;
}
- throw new OverflowException(Environment.GetResourceString("Overflow_UInt64"));
+ throw new OverflowException(SR.Overflow_UInt64);
}
// Converts a Decimal to a float. Since a float has fewer significant
}
catch (OverflowException e)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Char"), e);
+ throw new OverflowException(SR.Overflow_Char, e);
}
return (char)temp;
}
/// <internalonly/>
char IConvertible.ToChar(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Decimal", "Char"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Decimal", "Char"));
}
/// <internalonly/>
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Decimal", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Decimal", "DateTime"));
}
/// <internalonly/>
ParameterModifier[] modifiers, CultureInfo cultureInfo, String[] names, out Object state)
{
if (match == null || match.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_EmptyArray"), nameof(match));
+ throw new ArgumentException(SR.Arg_EmptyArray, nameof(match));
Contract.EndContractBlock();
MethodBase[] candidates = (MethodBase[])match.Clone();
// If we didn't find a method
if (CurIdx == 0)
- throw new MissingMethodException(Environment.GetResourceString("MissingMember"));
+ throw new MissingMethodException(SR.MissingMember);
if (CurIdx == 1)
{
}
if (ambig)
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
// Reorder (if needed)
if (names != null)
}
}
if (CurIdx == 0)
- throw new MissingFieldException(Environment.GetResourceString("MissingField"));
+ throw new MissingFieldException(SR.MissingField);
if (CurIdx == 1)
return candidates[0];
}
}
}
if (ambig)
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
return candidates[currentMin];
}
{
realTypes[i] = types[i].UnderlyingSystemType;
if (!(realTypes[i] is RuntimeType))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(types));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(types));
}
types = realTypes;
// We don't automatically jump out on exact match.
if (match == null || match.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_EmptyArray"), nameof(match));
+ throw new ArgumentException(SR.Arg_EmptyArray, nameof(match));
MethodBase[] candidates = (MethodBase[])match.Clone();
}
}
if (ambig)
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
return candidates[currentMin];
}
throw new ArgumentNullException(nameof(indexes));
}
if (match == null || match.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_EmptyArray"), nameof(match));
+ throw new ArgumentException(SR.Arg_EmptyArray, nameof(match));
Contract.EndContractBlock();
PropertyInfo[] candidates = (PropertyInfo[])match.Clone();
}
if (ambig)
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
return candidates[currentMin];
}
// This is because the default is built into the low level invoke code.
public override Object ChangeType(Object value, Type type, CultureInfo cultureInfo)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ChangeType"));
+ throw new NotSupportedException(SR.NotSupported_ChangeType);
}
public override void ReorderArgumentArray(ref Object[] args, Object state)
continue;
if (bestMatch != null)
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
bestMatch = match[i];
}
// This can only happen if at least one is vararg or generic.
if (currentHierarchyDepth == deepestHierarchy)
{
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
}
// Check to see if this method is on the most derived class.
if (!BindToMethodName(target, (RuntimeType)target.GetType(), method,
DelegateBindingFlags.InstanceMethodOnly |
DelegateBindingFlags.ClosedDelegateOnly))
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth"));
+ throw new ArgumentException(SR.Arg_DlgtTargMeth);
}
// This constructor is called from a class to generate a
throw new ArgumentNullException(nameof(target));
if (target.IsGenericType && target.ContainsGenericParameters)
- throw new ArgumentException(Environment.GetResourceString("Arg_UnboundGenParam"), nameof(target));
+ throw new ArgumentException(SR.Arg_UnboundGenParam, nameof(target));
if (method == null)
throw new ArgumentNullException(nameof(method));
RuntimeType rtTarget = target as RuntimeType;
if (rtTarget == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(target));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(target));
// This API existed in v1/v1.1 and only expected to create open
// static delegates. Constrain the call to BindToMethodName to such
return source;
if (!InternalEqualTypes(source, value))
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTypeMis"));
+ throw new ArgumentException(SR.Arg_DlgtTypeMis);
return source.RemoveImpl(value);
}
protected virtual Delegate CombineImpl(Delegate d)
{
- throw new MulticastNotSupportedException(Environment.GetResourceString("Multicast_Combine"));
+ throw new MulticastNotSupportedException(SR.Multicast_Combine);
}
protected virtual Delegate RemoveImpl(Delegate d)
RuntimeType rtType = type as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(type));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (!rtType.IsDelegate())
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type));
+ throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type));
Delegate d = InternalAlloc(rtType);
// This API existed in v1/v1.1 and only expected to create closed
(ignoreCase ? DelegateBindingFlags.CaselessMatching : 0)))
{
if (throwOnBindFailure)
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth"));
+ throw new ArgumentException(SR.Arg_DlgtTargMeth);
d = null;
}
if (target == null)
throw new ArgumentNullException(nameof(target));
if (target.IsGenericType && target.ContainsGenericParameters)
- throw new ArgumentException(Environment.GetResourceString("Arg_UnboundGenParam"), nameof(target));
+ throw new ArgumentException(SR.Arg_UnboundGenParam, nameof(target));
if (method == null)
throw new ArgumentNullException(nameof(method));
Contract.EndContractBlock();
RuntimeType rtType = type as RuntimeType;
RuntimeType rtTarget = target as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(type));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (rtTarget == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(target));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(target));
if (!rtType.IsDelegate())
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type));
+ throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type));
Delegate d = InternalAlloc(rtType);
// This API existed in v1/v1.1 and only expected to create open
(ignoreCase ? DelegateBindingFlags.CaselessMatching : 0)))
{
if (throwOnBindFailure)
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth"));
+ throw new ArgumentException(SR.Arg_DlgtTargMeth);
d = null;
}
RuntimeType rtType = type as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(type));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
RuntimeMethodInfo rmi = method as RuntimeMethodInfo;
if (rmi == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(method));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(method));
if (!rtType.IsDelegate())
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type));
+ throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type));
// This API existed in v1/v1.1 and only expected to create closed
// instance delegates. Constrain the call to BindToMethodInfo to
ref stackMark);
if (d == null && throwOnBindFailure)
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth"));
+ throw new ArgumentException(SR.Arg_DlgtTargMeth);
return d;
}
RuntimeType rtType = type as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(type));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
RuntimeMethodInfo rmi = method as RuntimeMethodInfo;
if (rmi == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(method));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(method));
if (!rtType.IsDelegate())
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type));
+ throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type));
// This API is new in Whidbey and allows the full range of delegate
// flexability (open or closed delegates binding to static or
ref stackMark);
if (d == null && throwOnBindFailure)
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth"));
+ throw new ArgumentException(SR.Arg_DlgtTargMeth);
return d;
}
RuntimeType rtType = type as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(type));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (!rtType.IsDelegate())
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type));
+ throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type));
// Initialize the method...
Delegate d = InternalAlloc(rtType);
method.GetMethodInfo(),
RuntimeMethodHandle.GetDeclaringType(method.GetMethodInfo()),
DelegateBindingFlags.RelaxedSignature | DelegateBindingFlags.SkipSecurityChecks))
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth"));
+ throw new ArgumentException(SR.Arg_DlgtTargMeth);
return d;
}
RuntimeMethodInfo rtMethod = method as RuntimeMethodInfo;
if (rtMethod == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(method));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(method));
if (!type.IsDelegate())
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type));
+ throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type));
// This API is used by the formatters when deserializing a delegate.
// They pass us the specific target method (that was already the
DelegateBindingFlags.RelaxedSignature);
if (d == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth"));
+ throw new ArgumentException(SR.Arg_DlgtTargMeth);
return d;
}
Type c = delegateType.BaseType;
if (c == null || (c != typeof(Delegate) && c != typeof(MulticastDelegate)))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), "type");
+ throw new ArgumentException(SR.Arg_MustBeDelegate, "type");
if (method.DeclaringType == null)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_GlobalMethodSerialization"));
+ throw new NotSupportedException(SR.NotSupported_GlobalMethodSerialization);
DelegateEntry de = new DelegateEntry(delegateType.FullName, delegateType.Module.Assembly.FullName, target,
method.ReflectedType.Module.Assembly.FullName, method.ReflectedType.FullName, method.Name);
private void ThrowInsufficientState(string field)
{
throw new SerializationException(
- Environment.GetResourceString("Serialization_InsufficientDeserializationState", field));
+ SR.Format(SR.Serialization_InsufficientDeserializationState, field));
}
private DelegateEntry OldDelegateWireFormat(SerializationInfo info, StreamingContext context)
#region ISerializable
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DelegateSerHolderSerial"));
+ throw new NotSupportedException(SR.NotSupported_DelegateSerHolderSerial);
}
#endregion
}
if (Debugger.Launch() == false)
{
throw new InvalidOperationException(
- Environment.GetResourceString("InvalidOperation_DebuggerLaunchFailed"));
+ SR.InvalidOperation_DebuggerLaunchFailed);
}
}
}
{
if (fromInclusive > toExclusive)
#if CORECLR
- throw new ArgumentException(Environment.GetResourceString("Argument_ToExclusiveLessThanFromExclusive"));
+ throw new ArgumentException(SR.Argument_ToExclusiveLessThanFromExclusive);
#else
throw new ArgumentException("fromInclusive must be less than or equal to toExclusive.");
#endif
{
if (fromInclusive > toExclusive)
#if CORECLR
- throw new ArgumentException(Environment.GetResourceString("Argument_ToExclusiveLessThanFromExclusive"));
+ throw new ArgumentException(SR.Argument_ToExclusiveLessThanFromExclusive);
#else
throw new ArgumentException("fromInclusive must be less than or equal to toExclusive.");
#endif
if (probablyNotRewritten == null)
probablyNotRewritten = thisAssembly;
String simpleName = probablyNotRewritten.GetName().Name;
- System.Runtime.CompilerServices.ContractHelper.TriggerFailure(kind, Environment.GetResourceString("MustUseCCRewrite", contractKind, simpleName), null, null, null);
+ System.Runtime.CompilerServices.ContractHelper.TriggerFailure(kind, SR.Format(SR.MustUseCCRewrite, contractKind, simpleName), null, null, null);
_assertingMustUseRewriter = false;
}
static partial void ReportFailure(ContractFailureKind failureKind, String userMessage, String conditionText, Exception innerException)
{
if (failureKind < ContractFailureKind.Precondition || failureKind > ContractFailureKind.Assume)
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", failureKind), nameof(failureKind));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, failureKind), nameof(failureKind));
Contract.EndContractBlock();
// displayMessage == null means: yes we handled it. Otherwise it is the localized failure message
static partial void RaiseContractFailedEventImplementation(ContractFailureKind failureKind, String userMessage, String conditionText, Exception innerException, ref string resultFailureMessage)
{
if (failureKind < ContractFailureKind.Precondition || failureKind > ContractFailureKind.Assume)
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", failureKind), nameof(failureKind));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, failureKind), nameof(failureKind));
Contract.EndContractBlock();
string returnValue;
// May need to rethink Assert.Fail w/ TaskDialogIndirect as a model. Window title. Main instruction. Content. Expanded info.
// Optional info like string for collapsed text vs. expanded text.
- String windowTitle = Environment.GetResourceString(GetResourceNameForFailure(kind));
+ String windowTitle = SR.GetResourceString(GetResourceNameForFailure(kind));
const int numStackFramesToSkip = 2; // To make stack traces easier to read
System.Diagnostics.Assert.Fail(conditionText, displayMessage, windowTitle, COR_E_CODECONTRACTFAILED, StackTrace.TraceFormat.Normal, numStackFramesToSkip);
// If we got here, the user selected Ignore. Continue.
if (!String.IsNullOrEmpty(conditionText))
{
resourceName += "_Cnd";
- failureMessage = Environment.GetResourceString(resourceName, conditionText);
+ failureMessage = SR.Format(SR.GetResourceString(resourceName), conditionText);
}
else
{
- failureMessage = Environment.GetResourceString(resourceName);
+ failureMessage = SR.GetResourceString(resourceName);
}
// Now add in the user message, if present.
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
private static string GetResourceString(string key, params object[] args)
{
- return Environment.GetResourceString(key, args);
+ return SR.Format(SR.GetResourceString(key), args);
}
private static readonly bool m_EventSourcePreventRecursion = false;
{
internal static string GetResourceString(string key, params object[] args)
{
- return Environment.GetResourceString(key, args);
+ return SR.Format(SR.GetResourceString(key), args);
}
}
}
-using System.Reflection;
+using System.Reflection;
using System.Runtime.InteropServices;
using System.Diagnostics;
public LogSwitch(String name, String description, LogSwitch parent)
{
if (name != null && name.Length == 0)
- throw new ArgumentOutOfRangeException(nameof(Name), Environment.GetResourceString("Argument_StringZeroLength"));
+ throw new ArgumentOutOfRangeException(nameof(Name), SR.Argument_StringZeroLength);
Contract.EndContractBlock();
if ((name != null) && (parent != null))
{
if (skipFrames < 0)
throw new ArgumentOutOfRangeException(nameof(skipFrames),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
m_iNumOfFrames = 0;
{
if (skipFrames < 0)
throw new ArgumentOutOfRangeException(nameof(skipFrames),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
m_iNumOfFrames = 0;
if (skipFrames < 0)
throw new ArgumentOutOfRangeException(nameof(skipFrames),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
m_iNumOfFrames = 0;
if (skipFrames < 0)
throw new ArgumentOutOfRangeException(nameof(skipFrames),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
m_iNumOfFrames = 0;
if (traceFormat != TraceFormat.NoResourceLookup)
{
- word_At = Environment.GetResourceString("Word_At");
- inFileLineNum = Environment.GetResourceString("StackTrace_InFileLineNumber");
+ word_At = SR.Word_At;
+ inFileLineNum = SR.StackTrace_InFileLineNumber;
}
bool fFirstFrame = true;
if (sf.GetIsLastFrameFromForeignExceptionStackTrace())
{
sb.Append(Environment.NewLine);
- sb.Append(Environment.GetResourceString("Exception_EndStackTraceFromPreviousThrow"));
+ sb.Append(SR.Exception_EndStackTraceFromPreviousThrow);
}
}
}
throw new ArgumentNullException("LogSwitch");
if (level < 0)
- throw new ArgumentOutOfRangeException(nameof(level), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(level), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Is logging for this level for this switch enabled?
public class DllNotFoundException : TypeLoadException
{
public DllNotFoundException()
- : base(Environment.GetResourceString("Arg_DllNotFoundException"))
+ : base(SR.Arg_DllNotFoundException)
{
SetErrorCode(__HResults.COR_E_DLLNOTFOUND);
}
else
return 1;
}
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDouble"));
+ throw new ArgumentException(SR.Arg_MustBeDouble);
}
public int CompareTo(Double value)
/// <internalonly/>
char IConvertible.ToChar(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Double", "Char"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Double", "Char"));
}
/// <internalonly/>
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Double", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Double", "DateTime"));
}
/// <internalonly/>
case CorElementType.U8:
return (*(ulong*)pValue).ToString("X16", null);
default:
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType"));
+ throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType);
}
}
}
return ((UInt64)(Int64)value).ToString("X16", null);
// All unsigned types will be directly cast
default:
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType"));
+ throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType);
}
}
break;
// All unsigned types will be directly cast
default:
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType"));
+ throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType);
}
return result;
switch (m_failure)
{
case ParseFailureKind.Argument:
- return new ArgumentException(Environment.GetResourceString(m_failureMessageID));
+ return new ArgumentException(SR.GetResourceString(m_failureMessageID));
case ParseFailureKind.ArgumentNull:
return new ArgumentNullException(m_failureParameter);
case ParseFailureKind.ArgumentWithParameter:
- return new ArgumentException(Environment.GetResourceString(m_failureMessageID, m_failureMessageFormatArgument));
+ return new ArgumentException(SR.Format(SR.GetResourceString(m_failureMessageID), m_failureMessageFormatArgument));
case ParseFailureKind.UnhandledException:
return m_innerException;
default:
Debug.Assert(false, "Unknown EnumParseFailure: " + m_failure);
- return new ArgumentException(Environment.GetResourceString("Arg_EnumValueNotFound"));
+ return new ArgumentException(SR.Arg_EnumValueNotFound);
}
}
}
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
if (value == null)
{
default:
// All unsigned types will be directly cast
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnumBaseTypeOrEnum"), nameof(value));
+ throw new ArgumentException(SR.Arg_MustBeEnumBaseTypeOrEnum, nameof(value));
}
}
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
if (value == null)
throw new ArgumentNullException(nameof(value));
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
// Check if both of them are of the same type
Type valueType = value.GetType();
if (valueType.IsEnum)
{
if (!valueType.IsEquivalentTo(enumType))
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumAndObjectMustBeSameType", valueType.ToString(), enumType.ToString()));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumAndObjectMustBeSameType, valueType.ToString(), enumType.ToString()));
if (format.Length != 1)
{
// all acceptable format string are of length 1
- throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification"));
+ throw new FormatException(SR.Format_InvalidEnumFormatSpecification);
}
return ((Enum)value).ToString(format);
}
// The value must be of the same type as the Underlying type of the Enum
else if (valueType != underlyingType)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType", valueType.ToString(), underlyingType.ToString()));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType, valueType.ToString(), underlyingType.ToString()));
}
if (format.Length != 1)
{
// all acceptable format string are of length 1
- throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification"));
+ throw new FormatException(SR.Format_InvalidEnumFormatSpecification);
}
char formatCh = format[0];
if (formatCh == 'F' || formatCh == 'f')
return Enum.InternalFlagsFormat(rtType, ToUInt64(value)) ?? value.ToString();
- throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification"));
+ throw new FormatException(SR.Format_InvalidEnumFormatSpecification);
}
#endregion
Type thisType = this.GetType();
Type targetType = target.GetType();
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumAndObjectMustBeSameType",
- targetType.ToString(), thisType.ToString()));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumAndObjectMustBeSameType, targetType.ToString(), thisType.ToString()));
}
else
{
// assert valid return code (3)
Debug.Assert(ret == retInvalidEnumType, "Enum.InternalCompareTo return code was invalid");
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType"));
+ throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType);
}
}
#endregion
if (format == null || format.Length == 0)
formatCh = 'G';
else if (format.Length != 1)
- throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification"));
+ throw new FormatException(SR.Format_InvalidEnumFormatSpecification);
else
formatCh = format[0];
if (formatCh == 'F' || formatCh == 'f')
return InternalFlagsFormat((RuntimeType)GetType(), ToUInt64()) ?? GetValue().ToString();
- throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification"));
+ throw new FormatException(SR.Format_InvalidEnumFormatSpecification);
}
[Obsolete("The provider argument is not used. Please use ToString().")]
if (!this.GetType().IsEquivalentTo(flag.GetType()))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_EnumTypeDoesNotMatch", flag.GetType(), this.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_EnumTypeDoesNotMatch, flag.GetType(), this.GetType()));
}
return InternalHasFlag(flag);
case CorElementType.U8:
return TypeCode.UInt64;
default:
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType"));
+ throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType);
}
}
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Enum", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Enum", "DateTime"));
}
/// <internalonly/>
if (enumType == null)
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
Contract.EndContractBlock();
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
return InternalBoxEnum(rtType, value);
}
if (enumType == null)
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
Contract.EndContractBlock();
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
return InternalBoxEnum(rtType, value);
}
if (enumType == null)
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
Contract.EndContractBlock();
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
return InternalBoxEnum(rtType, value);
}
if (enumType == null)
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
Contract.EndContractBlock();
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
return InternalBoxEnum(rtType, value);
}
if (enumType == null)
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
Contract.EndContractBlock();
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
return InternalBoxEnum(rtType, value);
}
if (enumType == null)
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
Contract.EndContractBlock();
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
return InternalBoxEnum(rtType, value);
}
if (enumType == null)
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
Contract.EndContractBlock();
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
return InternalBoxEnum(rtType, value);
}
if (enumType == null)
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
Contract.EndContractBlock();
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
return InternalBoxEnum(rtType, unchecked((long)value));
}
if (enumType == null)
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
Contract.EndContractBlock();
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
return InternalBoxEnum(rtType, value);
}
if (enumType == null)
throw new ArgumentNullException(nameof(enumType));
if (!enumType.IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
Contract.EndContractBlock();
RuntimeType rtType = enumType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
return InternalBoxEnum(rtType, value ? 1 : 0);
}
#endregion
// that includes the contents of the environment variable.
private const int MaxSystemEnvVariableLength = 1024;
private const int MaxUserEnvVariableLength = 255;
+ private const int MaxMachineNameLength = 256;
- internal sealed class ResourceHelper
+ // Looks up the resource string value for key.
+ //
+ // if you change this method's signature then you must change the code that calls it
+ // in excep.cpp and probably you will have to visit mscorlib.h to add the new signature
+ // as well as metasig.h to create the new signature type
+ internal static String GetResourceStringLocal(String key)
{
- internal ResourceHelper(String name)
- {
- m_name = name;
- }
-
- private String m_name;
- private ResourceManager SystemResMgr;
-
- // To avoid infinite loops when calling GetResourceString. See comments
- // in GetResourceString for this field.
- private List<string> currentlyLoading;
-
- // process-wide state (since this is only used in one domain),
- // used to avoid the TypeInitialization infinite recusion
- // in GetResourceStringCode
- internal bool resourceManagerInited = false;
-
- // Is this thread currently doing infinite resource lookups?
- private int infinitelyRecursingCount;
-
- internal String GetResourceString(String key)
- {
- if (key == null || key.Length == 0)
- {
- Debug.Assert(false, "Environment::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?");
- return "[Resource lookup failed - null or empty resource name]";
- }
-
- // We have a somewhat common potential for infinite
- // loops with mscorlib's ResourceManager. If "potentially dangerous"
- // code throws an exception, we will get into an infinite loop
- // inside the ResourceManager and this "potentially dangerous" code.
- // Potentially dangerous code includes the IO package, CultureInfo,
- // parts of the loader, some parts of Reflection, Security (including
- // custom user-written permissions that may parse an XML file at
- // class load time), assembly load event handlers, etc. Essentially,
- // this is not a bounded set of code, and we need to fix the problem.
- // Fortunately, this is limited to mscorlib's error lookups and is NOT
- // a general problem for all user code using the ResourceManager.
-
- // The solution is to make sure only one thread at a time can call
- // GetResourceString. Also, since resource lookups can be
- // reentrant, if the same thread comes into GetResourceString
- // twice looking for the exact same resource name before
- // returning, we're going into an infinite loop and we should
- // return a bogus string.
-
- bool lockTaken = false;
- try
- {
- Monitor.Enter(this, ref lockTaken);
-
- // Are we recursively looking up the same resource? Note - our backout code will set
- // the ResourceHelper's currentlyLoading stack to null if an exception occurs.
- if (currentlyLoading != null && currentlyLoading.Count > 0 && currentlyLoading.LastIndexOf(key) != -1)
- {
- // We can start infinitely recursing for one resource lookup,
- // then during our failure reporting, start infinitely recursing again.
- // avoid that.
- if (infinitelyRecursingCount > 0)
- {
- return "[Resource lookup failed - infinite recursion or critical failure detected.]";
- }
- infinitelyRecursingCount++;
-
- // Note: our infrastructure for reporting this exception will again cause resource lookup.
- // This is the most direct way of dealing with that problem.
- string message = $"Infinite recursion during resource lookup within {System.CoreLib.Name}. This may be a bug in {System.CoreLib.Name}, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: {key}";
- Assert.Fail("[Recursive resource lookup bug]", message, Assert.COR_E_FAILFAST, System.Diagnostics.StackTrace.TraceFormat.NoResourceLookup);
- Environment.FailFast(message);
- }
- if (currentlyLoading == null)
- currentlyLoading = new List<string>();
-
- // Call class constructors preemptively, so that we cannot get into an infinite
- // loop constructing a TypeInitializationException. If this were omitted,
- // we could get the Infinite recursion assert above by failing type initialization
- // between the Push and Pop calls below.
- if (!resourceManagerInited)
- {
- RuntimeHelpers.RunClassConstructor(typeof(ResourceManager).TypeHandle);
- RuntimeHelpers.RunClassConstructor(typeof(ResourceReader).TypeHandle);
- RuntimeHelpers.RunClassConstructor(typeof(RuntimeResourceSet).TypeHandle);
- RuntimeHelpers.RunClassConstructor(typeof(BinaryReader).TypeHandle);
- resourceManagerInited = true;
- }
-
- currentlyLoading.Add(key); // Push
-
- if (SystemResMgr == null)
- {
- SystemResMgr = new ResourceManager(m_name, typeof(Object).Assembly);
- }
- string s = SystemResMgr.GetString(key, null);
- currentlyLoading.RemoveAt(currentlyLoading.Count - 1); // Pop
-
- Debug.Assert(s != null, "Managed resource string lookup failed. Was your resource name misspelled? Did you rebuild mscorlib after adding a resource to resources.txt? Debug this w/ cordbg and bug whoever owns the code that called Environment.GetResourceString. Resource name was: \"" + key + "\"");
- return s;
- }
- catch
- {
- if (lockTaken)
- {
- // Backout code - throw away potentially corrupt state
- SystemResMgr = null;
- currentlyLoading = null;
- }
- throw;
- }
- finally
- {
- if (lockTaken)
- {
- Monitor.Exit(this);
- }
- }
- }
+ return SR.GetResourceString(key);
}
- private static volatile ResourceHelper m_resHelper; // Doesn't need to be initialized as they're zero-init.
-
- private const int MaxMachineNameLength = 256;
-
// Private object for locking instead of locking on a public type for SQL reliability work.
private static Object s_InternalSyncObject;
private static Object InternalSyncObject
StringBuilder buf = new StringBuilder(MaxMachineNameLength);
int len = MaxMachineNameLength;
if (Win32Native.GetComputerName(buf, ref len) == 0)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ComputerName"));
+ throw new InvalidOperationException(SR.InvalidOperation_ComputerName);
return buf.ToString();
}
}
Microsoft.Win32.Win32Native.OSVERSIONINFO osvi = new Microsoft.Win32.Win32Native.OSVERSIONINFO();
if (!GetVersion(osvi))
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GetVersion"));
+ throw new InvalidOperationException(SR.InvalidOperation_GetVersion);
}
Microsoft.Win32.Win32Native.OSVERSIONINFOEX osviEx = new Microsoft.Win32.Win32Native.OSVERSIONINFOEX();
if (!GetVersionEx(osviEx))
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GetVersion"));
+ throw new InvalidOperationException(SR.InvalidOperation_GetVersion);
#if PLATFORM_UNIX
PlatformID id = PlatformID.Unix;
return st.ToString(System.Diagnostics.StackTrace.TraceFormat.Normal);
}
- private static void InitResourceHelper()
- {
- // Only the default AppDomain should have a ResourceHelper. All calls to
- // GetResourceString from any AppDomain delegate to GetResourceStringLocal
- // in the default AppDomain via the fcall GetResourceFromDefault.
-
- bool tookLock = false;
- RuntimeHelpers.PrepareConstrainedRegions();
- try
- {
- Monitor.Enter(Environment.InternalSyncObject, ref tookLock);
-
- if (m_resHelper == null)
- {
- ResourceHelper rh = new ResourceHelper(System.CoreLib.Name);
-
- System.Threading.Thread.MemoryBarrier();
- m_resHelper = rh;
- }
- }
- finally
- {
- if (tookLock)
- Monitor.Exit(Environment.InternalSyncObject);
- }
- }
-
- // Looks up the resource string value for key.
- //
- // if you change this method's signature then you must change the code that calls it
- // in excep.cpp and probably you will have to visit mscorlib.h to add the new signature
- // as well as metasig.h to create the new signature type
- internal static String GetResourceStringLocal(String key)
- {
- if (m_resHelper == null)
- InitResourceHelper();
-
- return m_resHelper.GetResourceString(key);
- }
-
- internal static String GetResourceString(String key)
- {
- return GetResourceStringLocal(key);
- }
-
- // The reason the following overloads exist are to reduce code bloat.
- // Since GetResourceString is basically only called when exceptions are
- // thrown, we want the code size to be as small as possible.
- // Using the params object[] overload works against this since the
- // initialization of the array is done inline in the caller at the IL
- // level. So we have overloads that simply wrap the params one.
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- internal static string GetResourceString(string key, object val0)
- {
- return GetResourceStringFormatted(key, new object[] { val0 });
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- internal static string GetResourceString(string key, object val0, object val1)
- {
- return GetResourceStringFormatted(key, new object[] { val0, val1 });
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- internal static string GetResourceString(string key, object val0, object val1, object val2)
- {
- return GetResourceStringFormatted(key, new object[] { val0, val1, val2 });
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- internal static string GetResourceString(string key, object val0, object val1, object val2, object val3)
- {
- return GetResourceStringFormatted(key, new object[] { val0, val1, val2, val3 });
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- internal static String GetResourceString(string key, params object[] values)
- {
- return GetResourceStringFormatted(key, values);
- }
-
- private static String GetResourceStringFormatted(string key, params object[] values)
- {
- string rs = GetResourceString(key);
- return String.Format(CultureInfo.CurrentCulture, rs, values);
- }
-
public static extern bool HasShutdownStarted
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
}
if (variable.Length == 0)
{
- throw new ArgumentException(GetResourceString("Argument_StringZeroLength"), nameof(variable));
+ throw new ArgumentException(SR.Argument_StringZeroLength, nameof(variable));
}
if (variable[0] == '\0')
{
- throw new ArgumentException(GetResourceString("Argument_StringFirstCharIsZero"), nameof(variable));
+ throw new ArgumentException(SR.Argument_StringFirstCharIsZero, nameof(variable));
}
if (variable.Length >= MaxEnvVariableValueLength)
{
- throw new ArgumentException(GetResourceString("Argument_LongEnvVarValue"), nameof(variable));
+ throw new ArgumentException(SR.Argument_LongEnvVarValue, nameof(variable));
}
if (variable.IndexOf('=') != -1)
{
- throw new ArgumentException(GetResourceString("Argument_IllegalEnvVarName"), nameof(variable));
+ throw new ArgumentException(SR.Argument_IllegalEnvVarName, nameof(variable));
}
if (string.IsNullOrEmpty(value) || value[0] == '\0')
}
else if (value.Length >= MaxEnvVariableValueLength)
{
- throw new ArgumentException(GetResourceString("Argument_LongEnvVarValue"), nameof(value));
+ throw new ArgumentException(SR.Argument_LongEnvVarValue, nameof(value));
}
}
target != EnvironmentVariableTarget.Machine &&
target != EnvironmentVariableTarget.User)
{
- throw new ArgumentOutOfRangeException(nameof(target), target, SR.Format(GetResourceString("Arg_EnumIllegalVal"), target));
+ throw new ArgumentOutOfRangeException(nameof(target), target, SR.Format(SR.Arg_EnumIllegalVal, target));
}
}
}
else
{
- throw new ArgumentException(GetResourceString("Arg_EnumIllegalVal", (int)target));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)target));
}
using (RegistryKey environmentKey = baseKey.OpenSubKey(keyName, writable: false))
}
else
{
- throw new ArgumentException(GetResourceString("Arg_EnumIllegalVal", (int)target));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)target));
}
using (RegistryKey environmentKey = baseKey.OpenSubKey(keyName, writable: false))
case Win32Native.ERROR_FILENAME_EXCED_RANGE:
// The error message from Win32 is "The filename or extension is too long",
// which is not accurate.
- throw new ArgumentException(GetResourceString("Argument_LongEnvVarValue"));
+ throw new ArgumentException(SR.Format(SR.Argument_LongEnvVarValue));
default:
throw new ArgumentException(Win32Native.GetMessage(errorCode));
}
const int MaxUserEnvVariableLength = 255;
if (variable.Length >= MaxUserEnvVariableLength)
{
- throw new ArgumentException(GetResourceString("Argument_LongEnvVarValue"), nameof(variable));
+ throw new ArgumentException(SR.Argument_LongEnvVarValue, nameof(variable));
}
baseKey = Registry.CurrentUser;
}
else
{
- throw new ArgumentException(GetResourceString("Arg_EnumIllegalVal", (int)target));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)target));
}
using (RegistryKey environmentKey = baseKey.OpenSubKey(keyName, writable: true))
if (_className == null || HResult == 0)
- throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState"));
+ throw new SerializationException(SR.Serialization_InsufficientState);
// If we are constructing a new exception after a cross-appdomain call...
if (context.State == StreamingContextStates.CrossAppDomain)
{
_className = GetClassName();
}
- return Environment.GetResourceString("Exception_WasThrown", _className);
+ return SR.Format(SR.Exception_WasThrown, _className);
}
else
{
if (moduleBuilder != null)
rtModule = moduleBuilder.InternalModule;
else
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeReflectionObject"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeReflectionObject);
}
_source = rtModule.GetRuntimeAssembly().GetSimpleName();
if (_innerException != null)
{
s = s + " ---> " + _innerException.ToString(needFileLineInfo, needMessage) + Environment.NewLine +
- " " + Environment.GetResourceString("Exception_EndOfInnerExceptionStack");
+ " " + SR.Exception_EndOfInnerExceptionStack;
}
string stackTrace = GetStackTrace(needFileLineInfo);
if (bytesAllocated <= 0)
{
throw new ArgumentOutOfRangeException(nameof(bytesAllocated),
- Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
+ SR.ArgumentOutOfRange_NeedPosNum);
}
if ((4 == IntPtr.Size) && (bytesAllocated > Int32.MaxValue))
{
throw new ArgumentOutOfRangeException("pressure",
- Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegInt32"));
+ SR.ArgumentOutOfRange_MustBeNonNegInt32);
}
Contract.EndContractBlock();
if (bytesAllocated <= 0)
{
throw new ArgumentOutOfRangeException(nameof(bytesAllocated),
- Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
+ SR.ArgumentOutOfRange_NeedPosNum);
}
if ((4 == IntPtr.Size) && (bytesAllocated > Int32.MaxValue))
{
throw new ArgumentOutOfRangeException(nameof(bytesAllocated),
- Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegInt32"));
+ SR.ArgumentOutOfRange_MustBeNonNegInt32);
}
Contract.EndContractBlock();
{
if (generation < 0)
{
- throw new ArgumentOutOfRangeException(nameof(generation), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
+ throw new ArgumentOutOfRangeException(nameof(generation), SR.ArgumentOutOfRange_GenericPositive);
}
if ((mode < GCCollectionMode.Default) || (mode > GCCollectionMode.Optimized))
{
- throw new ArgumentOutOfRangeException(nameof(mode), Environment.GetResourceString("ArgumentOutOfRange_Enum"));
+ throw new ArgumentOutOfRangeException(nameof(mode), SR.ArgumentOutOfRange_Enum);
}
Contract.EndContractBlock();
{
if (generation < 0)
{
- throw new ArgumentOutOfRangeException(nameof(generation), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
+ throw new ArgumentOutOfRangeException(nameof(generation), SR.ArgumentOutOfRange_GenericPositive);
}
Contract.EndContractBlock();
return _CollectionCount(generation, 0);
throw new ArgumentOutOfRangeException(nameof(maxGenerationThreshold),
String.Format(
CultureInfo.CurrentCulture,
- Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper"),
+ SR.ArgumentOutOfRange_Bounds_Lower_Upper,
1,
99));
}
throw new ArgumentOutOfRangeException(nameof(largeObjectHeapThreshold),
String.Format(
CultureInfo.CurrentCulture,
- Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper"),
+ SR.ArgumentOutOfRange_Bounds_Lower_Upper,
1,
99));
}
if (!_RegisterForFullGCNotification(maxGenerationThreshold, largeObjectHeapThreshold))
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotWithConcurrentGC"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotWithConcurrentGC);
}
}
{
if (!_CancelFullGCNotification())
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotWithConcurrentGC"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotWithConcurrentGC);
}
}
public static GCNotificationStatus WaitForFullGCApproach(int millisecondsTimeout)
{
if (millisecondsTimeout < -1)
- throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
return (GCNotificationStatus)_WaitForFullGCApproach(millisecondsTimeout);
}
public static GCNotificationStatus WaitForFullGCComplete(int millisecondsTimeout)
{
if (millisecondsTimeout < -1)
- throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
return (GCNotificationStatus)_WaitForFullGCComplete(millisecondsTimeout);
}
if ((options & ValidSortkeyCtorMaskOffFlags) != 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), nameof(options));
+ throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options));
}
byte [] keyData;
//
// This means that '\' is at the end of the formatting string.
//
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
}
else
throw new FormatException(
String.Format(
CultureInfo.CurrentCulture,
- Environment.GetResourceString("Format_BadQuote"), quoteChar));
+ SR.Format_BadQuote, quoteChar));
}
//
}
else
{
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
break;
case 't':
// This means that '%' is at the end of the format string or
// "%%" appears in the format string.
//
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
break;
case '\\':
//
// This means that '\' is at the end of the formatting string.
//
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
break;
default:
realFormat = dtfi.YearMonthPattern;
break;
default:
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
return (realFormat);
}
if (offset != NullOffset)
{
// This format is not supported by DateTimeOffset
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
// Universal time is always in Greogrian calendar.
//
results = new String[] { Format(dateTime, new String(format, 1), dtfi) };
break;
default:
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
return (results);
}
switch (result.failure)
{
case ParseFailureKind.ArgumentNull:
- return new ArgumentNullException(result.failureArgumentName, Environment.GetResourceString(result.failureMessageID));
+ return new ArgumentNullException(result.failureArgumentName, SR.GetResourceString(result.failureMessageID));
case ParseFailureKind.Format:
- return new FormatException(Environment.GetResourceString(result.failureMessageID));
+ return new FormatException(SR.GetResourceString(result.failureMessageID));
case ParseFailureKind.FormatWithParameter:
- return new FormatException(Environment.GetResourceString(result.failureMessageID, result.failureMessageFormatArgument));
+ return new FormatException(SR.Format(SR.GetResourceString(result.failureMessageID), result.failureMessageFormatArgument));
case ParseFailureKind.FormatBadDateTimeCalendar:
- return new FormatException(Environment.GetResourceString(result.failureMessageID, result.calendar));
+ return new FormatException(SR.Format(SR.GetResourceString(result.failureMessageID), result.calendar));
default:
Debug.Assert(false, "Unkown DateTimeParseFailure: " + result);
return null;
None = 0x0001, // Gives full Unicode compatibility.
NativeNational = 0x0002 // National shapes
}
-}
\ No newline at end of file
+}
CodePageDataItem dataItem = s_encodingDataTableItems[i];
arrayEncodingInfo[i] = new EncodingInfo(dataItem.CodePage, dataItem.WebName,
- Environment.GetResourceString(dataItem.DisplayNameResourceKey));
+ SR.GetResourceString(dataItem.DisplayNameResourceKey));
}
return arrayEncodingInfo;
throw new ArgumentException(
string.Format(
CultureInfo.CurrentCulture,
- Environment.GetResourceString("Argument_EncodingNotSupported"), name), nameof(name));
+ SR.Argument_EncodingNotSupported, name), nameof(name));
}
internal static CodePageDataItem GetCodePageDataItem(int codepage)
throw new ArgumentException(
String.Format(
CultureInfo.CurrentCulture,
- Environment.GetResourceString("Argument_EncodingNotSupported"), name), nameof(name));
+ SR.Argument_EncodingNotSupported, name), nameof(name));
}
// Return a list of all EncodingInfo objects describing all of our encodings
for (i = 0; i < lastCodePageItem; i++)
{
arrayEncodingInfo[i] = new EncodingInfo(codePageDataPtr[i].codePage, CodePageDataItem.CreateString(codePageDataPtr[i].Names, 0),
- Environment.GetResourceString("Globalization.cp_" + codePageDataPtr[i].codePage));
+ SR.GetResourceString("Globalization_cp_" + codePageDataPtr[i].codePage));
}
return arrayEncodingInfo;
return !(left == right);
}
}
-}
\ No newline at end of file
+}
return FormatStandard(value, false, format, pattern);
}
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
return FormatCustomized(value, format, DateTimeFormatInfo.GetInstance(formatProvider));
case 'h':
tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch);
if (tokenLen > 2)
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
DateTimeFormat.FormatDigits(result, hours, tokenLen);
break;
case 'm':
tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch);
if (tokenLen > 2)
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
DateTimeFormat.FormatDigits(result, minutes, tokenLen);
break;
case 's':
tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch);
if (tokenLen > 2)
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
DateTimeFormat.FormatDigits(result, seconds, tokenLen);
break;
case 'f':
//
tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch);
if (tokenLen > DateTimeFormat.MaxSecondsFractionDigits)
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
tmp = (long)fraction;
tmp /= (long)Math.Pow(10, DateTimeFormat.MaxSecondsFractionDigits - tokenLen);
//
tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch);
if (tokenLen > DateTimeFormat.MaxSecondsFractionDigits)
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
tmp = (long)fraction;
tmp /= (long)Math.Pow(10, DateTimeFormat.MaxSecondsFractionDigits - tokenLen);
//
tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch);
if (tokenLen > 8)
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
DateTimeFormat.FormatDigits(result, day, tokenLen, true);
break;
case '\'':
// This means that '%' is at the end of the format string or
// "%%" appears in the format string.
//
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
break;
case '\\':
//
// This means that '\' is at the end of the formatting string.
//
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
break;
default:
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
i += tokenLen;
}
internal static void ValidateStyles(TimeSpanStyles style, String parameterName)
{
if (style != TimeSpanStyles.None && style != TimeSpanStyles.AssumeNegative)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTimeSpanStyles"), parameterName);
+ throw new ArgumentException(SR.Argument_InvalidTimeSpanStyles, parameterName);
}
internal const int unlimitedDigits = -1;
switch (m_failure)
{
case ParseFailureKind.ArgumentNull:
- return new ArgumentNullException(m_failureArgumentName, Environment.GetResourceString(m_failureMessageID));
+ return new ArgumentNullException(m_failureArgumentName, SR.GetResourceString(m_failureMessageID));
case ParseFailureKind.FormatWithParameter:
- return new FormatException(Environment.GetResourceString(m_failureMessageID, m_failureMessageFormatArgument));
+ return new FormatException(SR.Format(SR.GetResourceString(m_failureMessageID), m_failureMessageFormatArgument));
case ParseFailureKind.Format:
- return new FormatException(Environment.GetResourceString(m_failureMessageID));
+ return new FormatException(SR.GetResourceString(m_failureMessageID));
case ParseFailureKind.Overflow:
- return new OverflowException(Environment.GetResourceString(m_failureMessageID));
+ return new OverflowException(SR.GetResourceString(m_failureMessageID));
default:
Debug.Assert(false, "Unknown TimeSpanParseFailure: " + m_failure);
- return new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ return new FormatException(SR.Format_InvalidString);
}
}
}
if (b == null)
throw new ArgumentNullException(nameof(b));
if (b.Length != 16)
- throw new ArgumentException(Environment.GetResourceString("Arg_GuidArrayCtor", "16"), nameof(b));
+ throw new ArgumentException(SR.Format(SR.Arg_GuidArrayCtor, "16"), nameof(b));
Contract.EndContractBlock();
_a = ((int)b[3] << 24) | ((int)b[2] << 16) | ((int)b[1] << 8) | b[0];
throw new ArgumentNullException(nameof(d));
// Check that array is not too big
if (d.Length != 8)
- throw new ArgumentException(Environment.GetResourceString("Arg_GuidArrayCtor", "8"), nameof(d));
+ throw new ArgumentException(SR.Format(SR.Arg_GuidArrayCtor, "8"), nameof(d));
Contract.EndContractBlock();
_a = a;
switch (m_failure)
{
case ParseFailureKind.ArgumentNull:
- return new ArgumentNullException(m_failureArgumentName, Environment.GetResourceString(m_failureMessageID));
+ return new ArgumentNullException(m_failureArgumentName, SR.GetResourceString(m_failureMessageID));
case ParseFailureKind.FormatWithInnerException:
- return new FormatException(Environment.GetResourceString(m_failureMessageID), m_innerException);
+ return new FormatException(SR.GetResourceString(m_failureMessageID), m_innerException);
case ParseFailureKind.FormatWithParameter:
- return new FormatException(Environment.GetResourceString(m_failureMessageID, m_failureMessageFormatArgument));
+ return new FormatException(SR.Format(SR.GetResourceString(m_failureMessageID), m_failureMessageFormatArgument));
case ParseFailureKind.Format:
- return new FormatException(Environment.GetResourceString(m_failureMessageID));
+ return new FormatException(SR.GetResourceString(m_failureMessageID));
case ParseFailureKind.NativeException:
return m_innerException;
default:
Debug.Assert(false, "Unknown GuidParseFailure: " + m_failure);
- return new FormatException(Environment.GetResourceString("Format_GuidUnrecognized"));
+ return new FormatException(SR.Format_GuidUnrecognized);
}
}
}
if (format.Length != 1)
{
// all acceptable format strings are of length 1
- throw new FormatException(Environment.GetResourceString("Format_InvalidGuidFormatSpecification"));
+ throw new FormatException(SR.Format_InvalidGuidFormatSpecification);
}
GuidStyles style;
}
else
{
- throw new FormatException(Environment.GetResourceString("Format_InvalidGuidFormatSpecification"));
+ throw new FormatException(SR.Format_InvalidGuidFormatSpecification);
}
GuidResult result = new GuidResult();
}
else if (parseResult.throwStyle == GuidParseThrowStyle.AllButOverflow)
{
- throw new FormatException(Environment.GetResourceString("Format_GuidUnrecognized"), ex);
+ throw new FormatException(SR.Format_GuidUnrecognized, ex);
}
else
{
}
else if (parseResult.throwStyle == GuidParseThrowStyle.AllButOverflow)
{
- throw new FormatException(Environment.GetResourceString("Format_GuidUnrecognized"), ex);
+ throw new FormatException(SR.Format_GuidUnrecognized, ex);
}
else
{
}
if (!(value is Guid))
{
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeGuid"), nameof(value));
+ throw new ArgumentException(SR.Arg_MustBeGuid, nameof(value));
}
Guid g = (Guid)value;
if (format.Length != 1)
{
// all acceptable format strings are of length 1
- throw new FormatException(Environment.GetResourceString("Format_InvalidGuidFormatSpecification"));
+ throw new FormatException(SR.Format_InvalidGuidFormatSpecification);
}
char formatCh = format[0];
}
else
{
- throw new FormatException(Environment.GetResourceString("Format_InvalidGuidFormatSpecification"));
+ throw new FormatException(SR.Format_InvalidGuidFormatSpecification);
}
unsafe
throw new ArgumentNullException(nameof(encoding));
}
if (!input.CanRead)
- throw new ArgumentException(Environment.GetResourceString("Argument_StreamNotReadable"));
+ throw new ArgumentException(SR.Argument_StreamNotReadable);
Contract.EndContractBlock();
m_stream = input;
m_decoder = encoding.GetDecoder();
catch (ArgumentException e)
{
// ReadDecimal cannot leak out ArgumentException
- throw new IOException(Environment.GetResourceString("Arg_DecBitCtor"), e);
+ throw new IOException(SR.Arg_DecBitCtor, e);
}
}
stringLength = Read7BitEncodedInt();
if (stringLength < 0)
{
- throw new IOException(Environment.GetResourceString("IO.IO_InvalidStringLen_Len", stringLength));
+ throw new IOException(SR.Format(SR.IO_InvalidStringLen_Len, stringLength));
}
if (stringLength == 0)
{
if (buffer == null)
{
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
}
if (index < 0)
{
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (buffer.Length - index < count)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
}
Contract.Ensures(Contract.Result<int>() >= 0);
Contract.Ensures(Contract.Result<int>() <= count);
{
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.Ensures(Contract.Result<char[]>() != null);
Contract.Ensures(Contract.Result<char[]>().Length <= count);
public virtual int Read(byte[] buffer, int index, int count)
{
if (buffer == null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.Ensures(Contract.Result<int>() >= 0);
Contract.Ensures(Contract.Result<int>() <= count);
Contract.EndContractBlock();
public virtual byte[] ReadBytes(int count)
{
- if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.Ensures(Contract.Result<byte[]>() != null);
Contract.Ensures(Contract.Result<byte[]>().Length <= Contract.OldValue(count));
Contract.EndContractBlock();
{
if (m_buffer != null && (numBytes < 0 || numBytes > m_buffer.Length))
{
- throw new ArgumentOutOfRangeException(nameof(numBytes), Environment.GetResourceString("ArgumentOutOfRange_BinaryReaderFillBuffer"));
+ throw new ArgumentOutOfRangeException(nameof(numBytes), SR.ArgumentOutOfRange_BinaryReaderFillBuffer);
}
int bytesRead = 0;
int n = 0;
// Check for a corrupted stream. Read a max of 5 bytes.
// In a future version, add a DataFormatException.
if (shift == 5 * 7) // 5 bytes max per Int32, shift += 7
- throw new FormatException(Environment.GetResourceString("Format_Bad7BitInt32"));
+ throw new FormatException(SR.Format_Bad7BitInt32);
// ReadByte handles end of stream cases for us.
b = ReadByte();
if (encoding == null)
throw new ArgumentNullException(nameof(encoding));
if (!output.CanWrite)
- throw new ArgumentException(Environment.GetResourceString("Argument_StreamNotWritable"));
+ throw new ArgumentException(SR.Argument_StreamNotWritable);
Contract.EndContractBlock();
OutStream = output;
public unsafe virtual void Write(char ch)
{
if (Char.IsSurrogate(ch))
- throw new ArgumentException(Environment.GetResourceString("Arg_SurrogatesNotAllowedAsSingleChar"));
+ throw new ArgumentException(SR.Arg_SurrogatesNotAllowedAsSingleChar);
Contract.EndContractBlock();
Debug.Assert(_encoding.GetMaxByteCount(1) <= 16, "_encoding.GetMaxByteCount(1) <= 16)");
if (searchPattern == null)
throw new ArgumentNullException(nameof(searchPattern));
if ((searchOption != SearchOption.TopDirectoryOnly) && (searchOption != SearchOption.AllDirectories))
- throw new ArgumentOutOfRangeException(nameof(searchOption), Environment.GetResourceString("ArgumentOutOfRange_Enum"));
+ throw new ArgumentOutOfRangeException(nameof(searchOption), SR.ArgumentOutOfRange_Enum);
Contract.Ensures(Contract.Result<IEnumerable<String>>() != null);
Contract.EndContractBlock();
if (path == null)
throw new ArgumentNullException(nameof(path));
if (path.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_PathEmpty"));
+ throw new ArgumentException(SR.Argument_PathEmpty);
if (path.Length >= Path.MaxPath)
- throw new PathTooLongException(Environment.GetResourceString("IO.PathTooLong"));
+ throw new PathTooLongException(SR.IO_PathTooLong);
String fulldestDirName = Path.GetFullPath(path);
public class DirectoryNotFoundException : IOException
{
public DirectoryNotFoundException()
- : base(Environment.GetResourceString("Arg_DirectoryNotFoundException"))
+ : base(SR.Arg_DirectoryNotFoundException)
{
SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND);
}
internal class DriveNotFoundException : IOException
{
public DriveNotFoundException()
- : base(Environment.GetResourceString("Arg_DriveNotFoundException"))
+ : base(SR.Arg_DriveNotFoundException)
{
SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND);
}
public class EndOfStreamException : IOException
{
public EndOfStreamException()
- : base(Environment.GetResourceString("Arg_EndOfStreamException"))
+ : base(SR.Arg_EndOfStreamException)
{
SetErrorCode(__HResults.COR_E_ENDOFSTREAM);
}
int index = 0;
long fileLength = fs.Length;
if (fileLength > Int32.MaxValue)
- throw new IOException(Environment.GetResourceString("IO.IO_FileTooLong2GB"));
+ throw new IOException(SR.IO_FileTooLong2GB);
int count = (int)fileLength;
bytes = new byte[count];
while (count > 0)
if (path == null)
throw new ArgumentNullException(nameof(path));
if (path.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyPath"));
+ throw new ArgumentException(SR.Argument_EmptyPath);
Contract.EndContractBlock();
return InternalReadAllLines(path, Encoding.UTF8);
private String _fusionLog; // fusion log (when applicable)
public FileLoadException()
- : base(Environment.GetResourceString("IO.FileLoad"))
+ : base(SR.IO_FileLoad)
{
SetErrorCode(__HResults.COR_E_FILELOAD);
}
String s = GetType().FullName + ": " + Message;
if (_fileName != null && _fileName.Length != 0)
- s += Environment.NewLine + Environment.GetResourceString("IO.FileName_Name", _fileName);
+ s += Environment.NewLine + SR.Format(SR.IO_FileName_Name, _fileName);
if (InnerException != null)
s = s + " ---> " + InnerException.ToString();
private String _fusionLog; // fusion log (when applicable)
public FileNotFoundException()
- : base(Environment.GetResourceString("IO.FileNotFound"))
+ : base(SR.IO_FileNotFound)
{
SetErrorCode(__HResults.COR_E_FILENOTFOUND);
}
{
if ((_fileName == null) &&
(HResult == System.__HResults.COR_E_EXCEPTION))
- _message = Environment.GetResourceString("IO.FileNotFound");
+ _message = SR.IO_FileNotFound;
else if (_fileName != null)
_message = FileLoadException.FormatFileLoadExceptionMessage(_fileName, HResult);
String s = GetType().FullName + ": " + Message;
if (_fileName != null && _fileName.Length != 0)
- s += Environment.NewLine + Environment.GetResourceString("IO.FileName_Name", _fileName);
+ s += Environment.NewLine + SR.Format(SR.IO_FileName_Name, _fileName);
if (InnerException != null)
s = s + " ---> " + InnerException.ToString();
private String _maybeFullPath; // For debuggers on partial trust code
public IOException()
- : base(Environment.GetResourceString("Arg_IOException"))
+ : base(SR.Arg_IOException)
{
SetErrorCode(__HResults.COR_E_IO);
}
{
if (capacity < 0)
{
- throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_NegativeCapacity"));
+ throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_NegativeCapacity);
}
Contract.EndContractBlock();
public MemoryStream(byte[] buffer, bool writable)
{
- if (buffer == null) throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ if (buffer == null) throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
Contract.EndContractBlock();
_buffer = buffer;
_length = _capacity = buffer.Length;
public MemoryStream(byte[] buffer, int index, int count, bool writable, bool publiclyVisible)
{
if (buffer == null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
_buffer = buffer;
{
// Check for overflow
if (value < 0)
- throw new IOException(Environment.GetResourceString("IO.IO_StreamTooLong"));
+ throw new IOException(SR.IO_StreamTooLong);
if (value > _capacity)
{
int newCapacity = value;
public virtual byte[] GetBuffer()
{
if (!_exposable)
- throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_MemStreamBuffer"));
+ throw new UnauthorizedAccessException(SR.UnauthorizedAccess_MemStreamBuffer);
return _buffer;
}
{
// Only update the capacity if the MS is expandable and the value is different than the current capacity.
// Special behavior if the MS isn't expandable: we don't throw if value is the same as the current capacity
- if (value < Length) throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity"));
+ if (value < Length) throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_SmallCapacity);
Contract.Ensures(_capacity - _origin == value);
Contract.EndContractBlock();
set
{
if (value < 0)
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.Ensures(Position == value);
Contract.EndContractBlock();
if (!_isOpen) __Error.StreamIsClosed();
if (value > MemStreamMaxLength)
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_StreamLength"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_StreamLength);
_position = _origin + (int)value;
}
}
public override int Read([In, Out] byte[] buffer, int offset, int count)
{
if (buffer == null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (offset < 0)
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - offset < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
if (!_isOpen) __Error.StreamIsClosed();
public override Task<int> ReadAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
if (buffer == null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (offset < 0)
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - offset < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock(); // contract validation copied from Read(...)
// If cancellation was requested, bail early
if (!_isOpen) __Error.StreamIsClosed();
if (offset > MemStreamMaxLength)
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_StreamLength"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_StreamLength);
switch (loc)
{
case SeekOrigin.Begin:
{
int tempPosition = unchecked(_origin + (int)offset);
if (offset < 0 || tempPosition < _origin)
- throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin"));
+ throw new IOException(SR.IO_SeekBeforeBegin);
_position = tempPosition;
break;
}
{
int tempPosition = unchecked(_position + (int)offset);
if (unchecked(_position + offset) < _origin || tempPosition < _origin)
- throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin"));
+ throw new IOException(SR.IO_SeekBeforeBegin);
_position = tempPosition;
break;
}
{
int tempPosition = unchecked(_length + (int)offset);
if (unchecked(_length + offset) < _origin || tempPosition < _origin)
- throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin"));
+ throw new IOException(SR.IO_SeekBeforeBegin);
_position = tempPosition;
break;
}
default:
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidSeekOrigin"));
+ throw new ArgumentException(SR.Argument_InvalidSeekOrigin);
}
Debug.Assert(_position >= 0, "_position >= 0");
{
if (value < 0 || value > Int32.MaxValue)
{
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_StreamLength"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_StreamLength);
}
Contract.Ensures(_length - _origin == value);
Contract.EndContractBlock();
Debug.Assert(MemStreamMaxLength == Int32.MaxValue); // Check parameter validation logic in this method if this fails.
if (value > (Int32.MaxValue - _origin))
{
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_StreamLength"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_StreamLength);
}
int newLength = _origin + (int)value;
public override void Write(byte[] buffer, int offset, int count)
{
if (buffer == null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (offset < 0)
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - offset < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
if (!_isOpen) __Error.StreamIsClosed();
int i = _position + count;
// Check for overflow
if (i < 0)
- throw new IOException(Environment.GetResourceString("IO.IO_StreamTooLong"));
+ throw new IOException(SR.IO_StreamTooLong);
if (i > _length)
{
public override Task WriteAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
if (buffer == null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (offset < 0)
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - offset < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock(); // contract validation copied from Write(...)
// If cancellation is already requested, bail early
public virtual void WriteTo(Stream stream)
{
if (stream == null)
- throw new ArgumentNullException(nameof(stream), Environment.GetResourceString("ArgumentNull_Stream"));
+ throw new ArgumentNullException(nameof(stream), SR.ArgumentNull_Stream);
Contract.EndContractBlock();
if (!_isOpen) __Error.StreamIsClosed();
public class PathTooLongException : IOException
{
public PathTooLongException()
- : base(Environment.GetResourceString("IO.PathTooLong"))
+ : base(SR.IO_PathTooLong)
{
SetErrorCode(__HResults.COR_E_PATHTOOLONG);
}
get
{
Contract.Ensures(Contract.Result<int>() >= 0);
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TimeoutsNotSupported"));
+ throw new InvalidOperationException(SR.InvalidOperation_TimeoutsNotSupported);
}
set
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TimeoutsNotSupported"));
+ throw new InvalidOperationException(SR.InvalidOperation_TimeoutsNotSupported);
}
}
get
{
Contract.Ensures(Contract.Result<int>() >= 0);
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TimeoutsNotSupported"));
+ throw new InvalidOperationException(SR.InvalidOperation_TimeoutsNotSupported);
}
set
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TimeoutsNotSupported"));
+ throw new InvalidOperationException(SR.InvalidOperation_TimeoutsNotSupported);
}
}
if (readTask == null)
{
- throw new ArgumentException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple"));
+ throw new ArgumentException(SR.InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple);
}
else if (readTask != asyncResult)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple"));
+ throw new InvalidOperationException(SR.InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple);
}
else if (!readTask._isRead)
{
- throw new ArgumentException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple"));
+ throw new ArgumentException(SR.InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple);
}
try
var writeTask = _activeReadWriteTask;
if (writeTask == null)
{
- throw new ArgumentException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple"));
+ throw new ArgumentException(SR.InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple);
}
else if (writeTask != asyncResult)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple"));
+ throw new InvalidOperationException(SR.InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple);
}
else if (writeTask._isRead)
{
- throw new ArgumentException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple"));
+ throw new ArgumentException(SR.InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple);
}
try
if (bufferSize <= 0)
{
- throw new ArgumentOutOfRangeException(nameof(bufferSize), bufferSize, Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
+ throw new ArgumentOutOfRangeException(nameof(bufferSize), bufferSize, SR.ArgumentOutOfRange_NeedPosNum);
}
bool sourceCanRead = source.CanRead;
if (!sourceCanRead && !source.CanWrite)
{
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_StreamClosed"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
}
bool destinationCanWrite = destination.CanWrite;
if (!destinationCanWrite && !destination.CanRead)
{
- throw new ObjectDisposedException(nameof(destination), Environment.GetResourceString("ObjectDisposed_StreamClosed"));
+ throw new ObjectDisposedException(nameof(destination), SR.ObjectDisposed_StreamClosed);
}
if (!sourceCanRead)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnreadableStream"));
+ throw new NotSupportedException(SR.NotSupported_UnreadableStream);
}
if (!destinationCanWrite)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnwritableStream"));
+ throw new NotSupportedException(SR.NotSupported_UnwritableStream);
}
}
}
Task t = _asyncReadTask;
if (t != null && !t.IsCompleted)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_AsyncIOInProgress"));
+ throw new InvalidOperationException(SR.InvalidOperation_AsyncIOInProgress);
}
// StreamReader by default will ignore illegal UTF8 characters. We don't want to
if (stream == null || encoding == null)
throw new ArgumentNullException((stream == null ? nameof(stream) : nameof(encoding)));
if (!stream.CanRead)
- throw new ArgumentException(Environment.GetResourceString("Argument_StreamNotReadable"));
+ throw new ArgumentException(SR.Argument_StreamNotReadable);
if (bufferSize <= 0)
- throw new ArgumentOutOfRangeException(nameof(bufferSize), Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
+ throw new ArgumentOutOfRangeException(nameof(bufferSize), SR.ArgumentOutOfRange_NeedPosNum);
Contract.EndContractBlock();
Init(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize, leaveOpen);
if (path==null || encoding==null)
throw new ArgumentNullException((path==null ? nameof(path) : nameof(encoding)));
if (path.Length==0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyPath"));
+ throw new ArgumentException(SR.Argument_EmptyPath);
if (bufferSize <= 0)
- throw new ArgumentOutOfRangeException(nameof(bufferSize), Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
+ throw new ArgumentOutOfRangeException(nameof(bufferSize), SR.ArgumentOutOfRange_NeedPosNum);
Contract.EndContractBlock();
Stream stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, DefaultFileStreamBufferSize, FileOptions.SequentialScan);
public override int Read([In, Out] char[] buffer, int index, int count)
{
if (buffer==null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
if (stream == null)
public override int ReadBlock([In, Out] char[] buffer, int index, int count)
{
if (buffer==null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
if (stream == null)
public override Task<int> ReadAsync(char[] buffer, int index, int count)
{
if (buffer==null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
// If we have been inherited into a subclass, the following implementation could be incorrect
public override Task<int> ReadBlockAsync(char[] buffer, int index, int count)
{
if (buffer==null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
// If we have been inherited into a subclass, the following implementation could be incorrect
public virtual int Read([In, Out] char[] buffer, int index, int count)
{
if (buffer==null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.Ensures(Contract.Result<int>() >= 0);
Contract.Ensures(Contract.Result<int>() <= Contract.OldValue(count));
Contract.EndContractBlock();
public virtual Task<int> ReadAsync(char[] buffer, int index, int count)
{
if (buffer==null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
return ReadAsyncInternal(buffer, index, count);
public virtual Task<int> ReadBlockAsync(char[] buffer, int index, int count)
{
if (buffer==null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
public override Task<int> ReadBlockAsync(char[] buffer, int index, int count)
{
if (buffer==null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
public override Task<int> ReadAsync(char[] buffer, int index, int count)
{
if (buffer==null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
return Task.FromResult(Read(buffer, index, count));
}
if (offset < 0)
{
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (capacity < 0)
{
- throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (buffer.ByteLength < (UInt64)(offset + capacity))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_OffsetAndCapacityOutOfBounds"));
+ throw new ArgumentException(SR.Argument_OffsetAndCapacityOutOfBounds);
}
if (access < FileAccess.Read || access > FileAccess.ReadWrite)
{
if (_isOpen)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CalledTwice"));
+ throw new InvalidOperationException(SR.InvalidOperation_CalledTwice);
}
unsafe
buffer.AcquirePointer(ref pointer);
if (((byte*)((Int64)pointer + offset + capacity)) < pointer)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_UnmanagedMemAccessorWrapAround"));
+ throw new ArgumentException(SR.Argument_UnmanagedMemAccessorWrapAround);
}
}
finally
// Check for invalid Decimal values
if (!((flags & ~(SignMask | ScaleMask)) == 0 && (flags & ScaleMask) <= (28 << 16)))
{
- throw new ArgumentException(Environment.GetResourceString("Arg_BadDecimal")); // Throw same Exception type as Decimal(int[]) ctor for compat
+ throw new ArgumentException(SR.Arg_BadDecimal); // Throw same Exception type as Decimal(int[]) ctor for compat
}
bool isNegative = (flags & SignMask) != 0;
{
if (position < 0)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.EndContractBlock();
if (!_isOpen)
{
- throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed"));
+ throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed);
}
if (!CanRead)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_Reading"));
+ throw new NotSupportedException(SR.NotSupported_Reading);
}
UInt32 sizeOfT = Marshal.SizeOfType(typeof(T));
{
if (position >= _capacity)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired);
}
else
{
- throw new ArgumentException(Environment.GetResourceString("Argument_NotEnoughBytesToRead", typeof(T).FullName), nameof(position));
+ throw new ArgumentException(SR.Format(SR.Argument_NotEnoughBytesToRead, typeof (T).FullName), nameof(position));
}
}
}
if (offset < 0)
{
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (array.Length - offset < count)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_OffsetAndLengthOutOfBounds"));
+ throw new ArgumentException(SR.Argument_OffsetAndLengthOutOfBounds);
}
Contract.EndContractBlock();
if (!CanRead)
{
if (!_isOpen)
{
- throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed"));
+ throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed);
}
else
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_Reading"));
+ throw new NotSupportedException(SR.NotSupported_Reading);
}
}
if (position < 0)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum);
}
UInt32 sizeOfT = Marshal.AlignedSizeOf<T>();
// only check position and ask for fewer Ts if count is too big
if (position >= _capacity)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired);
}
int n = count;
{
if (position < 0)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.EndContractBlock();
if (!_isOpen)
{
- throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed"));
+ throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed);
}
if (!CanWrite)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_Writing"));
+ throw new NotSupportedException(SR.NotSupported_Writing);
}
UInt32 sizeOfT = Marshal.SizeOfType(typeof(T));
{
if (position >= _capacity)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired);
}
else
{
- throw new ArgumentException(Environment.GetResourceString("Argument_NotEnoughBytesToWrite", typeof(T).FullName), nameof(position));
+ throw new ArgumentException(SR.Format(SR.Argument_NotEnoughBytesToWrite, typeof (T).FullName), nameof(position));
}
}
}
if (offset < 0)
{
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (array.Length - offset < count)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_OffsetAndLengthOutOfBounds"));
+ throw new ArgumentException(SR.Argument_OffsetAndLengthOutOfBounds);
}
if (position < 0)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (position >= Capacity)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired);
}
Contract.EndContractBlock();
if (!_isOpen)
{
- throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed"));
+ throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed);
}
if (!CanWrite)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_Writing"));
+ throw new NotSupportedException(SR.NotSupported_Writing);
}
_buffer.WriteArray<T>((UInt64)(_offset + position), array, offset, count);
{
if (!_isOpen)
{
- throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed"));
+ throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed);
}
if (!CanRead)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_Reading"));
+ throw new NotSupportedException(SR.NotSupported_Reading);
}
if (position < 0)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.EndContractBlock();
if (position > _capacity - sizeOfType)
{
if (position >= _capacity)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired);
}
else
{
- throw new ArgumentException(Environment.GetResourceString("Argument_NotEnoughBytesToRead"), nameof(position));
+ throw new ArgumentException(SR.Argument_NotEnoughBytesToRead, nameof(position));
}
}
}
{
if (!_isOpen)
{
- throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed"));
+ throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed);
}
if (!CanWrite)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_Writing"));
+ throw new NotSupportedException(SR.NotSupported_Writing);
}
if (position < 0)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.EndContractBlock();
if (position > _capacity - sizeOfType)
{
if (position >= _capacity)
{
- throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired"));
+ throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired);
}
else
{
- throw new ArgumentException(Environment.GetResourceString("Argument_NotEnoughBytesToWrite", nameof(Byte)), nameof(position));
+ throw new ArgumentException(SR.Format(SR.Argument_NotEnoughBytesToWrite, nameof(Byte)), nameof(position));
}
}
}
}
if (offset < 0)
{
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (length < 0)
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (buffer.ByteLength < (ulong)(offset + length))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidSafeBufferOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidSafeBufferOffLen);
}
if (access < FileAccess.Read || access > FileAccess.ReadWrite)
{
if (_isOpen)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CalledTwice"));
+ throw new InvalidOperationException(SR.InvalidOperation_CalledTwice);
}
// check for wraparound
buffer.AcquirePointer(ref pointer);
if ((pointer + offset + length) < pointer)
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_UnmanagedMemStreamWrapAround"));
+ throw new ArgumentException(SR.ArgumentOutOfRange_UnmanagedMemStreamWrapAround);
}
}
finally
if (pointer == null)
throw new ArgumentNullException(nameof(pointer));
if (length < 0 || capacity < 0)
- throw new ArgumentOutOfRangeException((length < 0) ? nameof(length) : nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException((length < 0) ? nameof(length) : nameof(capacity), SR.ArgumentOutOfRange_NeedNonNegNum);
if (length > capacity)
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_LengthGreaterThanCapacity"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_LengthGreaterThanCapacity);
Contract.EndContractBlock();
// Check for wraparound.
if (((byte*)((long)pointer + capacity)) < pointer)
- throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_UnmanagedMemStreamWrapAround"));
+ throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_UnmanagedMemStreamWrapAround);
if (access < FileAccess.Read || access > FileAccess.ReadWrite)
- throw new ArgumentOutOfRangeException(nameof(access), Environment.GetResourceString("ArgumentOutOfRange_Enum"));
+ throw new ArgumentOutOfRangeException(nameof(access), SR.ArgumentOutOfRange_Enum);
if (_isOpen)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CalledTwice"));
+ throw new InvalidOperationException(SR.InvalidOperation_CalledTwice);
_mem = pointer;
_offset = 0;
set
{
if (value < 0)
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
if (!CanSeek) __Error.StreamIsClosed();
unsafe {
// On 32 bit machines, ensure we don't wrap around.
if (value > (long) Int32.MaxValue || _mem + value < _mem)
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_StreamLength"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_StreamLength);
}
#endif
Interlocked.Exchange(ref _position, value);
{
if (_buffer != null)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UmsSafeBuffer"));
+ throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
}
// Use a temp to avoid a race
long pos = Interlocked.Read(ref _position);
if (pos > _capacity)
- throw new IndexOutOfRangeException(Environment.GetResourceString("IndexOutOfRange_UMSPosition"));
+ throw new IndexOutOfRangeException(SR.IndexOutOfRange_UMSPosition);
byte* ptr = _mem + pos;
if (!_isOpen) __Error.StreamIsClosed();
return ptr;
set
{
if (_buffer != null)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UmsSafeBuffer"));
+ throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
if (!_isOpen) __Error.StreamIsClosed();
// Note: subtracting pointers returns an Int64. Working around
// to avoid hitting compiler warning CS0652 on this line.
if (new IntPtr(value - _mem).ToInt64() > UnmanagedMemStreamMaxLength)
- throw new ArgumentOutOfRangeException("offset", Environment.GetResourceString("ArgumentOutOfRange_UnmanagedMemStreamLength"));
+ throw new ArgumentOutOfRangeException("offset", SR.ArgumentOutOfRange_UnmanagedMemStreamLength);
if (value < _mem)
- throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin"));
+ throw new IOException(SR.IO_SeekBeforeBegin);
Interlocked.Exchange(ref _position, value - _mem);
}
get
{
if (_buffer != null)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UmsSafeBuffer"));
+ throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
return _mem;
}
public override int Read([In, Out] byte[] buffer, int offset, int count)
{
if (buffer == null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (offset < 0)
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - offset < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock(); // Keep this in sync with contract validation in ReadAsync
if (!_isOpen) __Error.StreamIsClosed();
public override Task<Int32> ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
{
if (buffer == null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (offset < 0)
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - offset < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock(); // contract validation copied from Read(...)
if (cancellationToken.IsCancellationRequested)
{
if (!_isOpen) __Error.StreamIsClosed();
if (offset > UnmanagedMemStreamMaxLength)
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_UnmanagedMemStreamLength"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_UnmanagedMemStreamLength);
switch (loc)
{
case SeekOrigin.Begin:
if (offset < 0)
- throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin"));
+ throw new IOException(SR.IO_SeekBeforeBegin);
Interlocked.Exchange(ref _position, offset);
break;
case SeekOrigin.Current:
long pos = Interlocked.Read(ref _position);
if (offset + pos < 0)
- throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin"));
+ throw new IOException(SR.IO_SeekBeforeBegin);
Interlocked.Exchange(ref _position, offset + pos);
break;
case SeekOrigin.End:
long len = Interlocked.Read(ref _length);
if (len + offset < 0)
- throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin"));
+ throw new IOException(SR.IO_SeekBeforeBegin);
Interlocked.Exchange(ref _position, len + offset);
break;
default:
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidSeekOrigin"));
+ throw new ArgumentException(SR.Argument_InvalidSeekOrigin);
}
long finalPos = Interlocked.Read(ref _position);
public override void SetLength(long value)
{
if (value < 0)
- throw new ArgumentOutOfRangeException("length", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException("length", SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
if (_buffer != null)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UmsSafeBuffer"));
+ throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer);
if (!_isOpen) __Error.StreamIsClosed();
if (!CanWrite) __Error.WriteNotSupported();
if (value > _capacity)
- throw new IOException(Environment.GetResourceString("IO.IO_FixedCapacity"));
+ throw new IOException(SR.IO_FixedCapacity);
long pos = Interlocked.Read(ref _position);
long len = Interlocked.Read(ref _length);
public override void Write(byte[] buffer, int offset, int count)
{
if (buffer == null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (offset < 0)
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - offset < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock(); // Keep contract validation in sync with WriteAsync(..)
if (!_isOpen) __Error.StreamIsClosed();
long n = pos + count;
// Check for overflow
if (n < 0)
- throw new IOException(Environment.GetResourceString("IO.IO_StreamTooLong"));
+ throw new IOException(SR.IO_StreamTooLong);
if (n > _capacity)
{
- throw new NotSupportedException(Environment.GetResourceString("IO.IO_FixedCapacity"));
+ throw new NotSupportedException(SR.IO_FixedCapacity);
}
if (_buffer == null)
long bytesLeft = _capacity - pos;
if (bytesLeft < count)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_BufferTooSmall"));
+ throw new ArgumentException(SR.Arg_BufferTooSmall);
}
byte* pointer = null;
public override Task WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
{
if (buffer == null)
- throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (offset < 0)
- throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - offset < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock(); // contract validation copied from Write(..)
if (cancellationToken.IsCancellationRequested)
{
// Check for overflow
if (n < 0)
- throw new IOException(Environment.GetResourceString("IO.IO_StreamTooLong"));
+ throw new IOException(SR.IO_StreamTooLong);
if (n > _capacity)
- throw new NotSupportedException(Environment.GetResourceString("IO.IO_FixedCapacity"));
+ throw new NotSupportedException(SR.IO_FixedCapacity);
// Check to see whether we are now expanding the stream and must
// zero any memory in the middle.
public override byte[] GetBuffer()
{
- throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_MemStreamBuffer"));
+ throw new UnauthorizedAccessException(SR.UnauthorizedAccess_MemStreamBuffer);
}
public override bool TryGetBuffer(out ArraySegment<byte> buffer)
[SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
set
{
- throw new IOException(Environment.GetResourceString("IO.IO_FixedCapacity"));
+ throw new IOException(SR.IO_FixedCapacity);
}
}
public unsafe override void WriteTo(Stream stream)
{
if (stream == null)
- throw new ArgumentNullException(nameof(stream), Environment.GetResourceString("ArgumentNull_Stream"));
+ throw new ArgumentNullException(nameof(stream), SR.ArgumentNull_Stream);
Contract.EndContractBlock();
if (!_unmanagedStream._isOpen) __Error.StreamIsClosed();
throw new ArgumentNullException(nameof(destination));
if (bufferSize <= 0)
- throw new ArgumentOutOfRangeException(nameof(bufferSize), Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
+ throw new ArgumentOutOfRangeException(nameof(bufferSize), SR.ArgumentOutOfRange_NeedPosNum);
if (!CanRead && !CanWrite)
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_StreamClosed"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
if (!destination.CanRead && !destination.CanWrite)
- throw new ObjectDisposedException(nameof(destination), Environment.GetResourceString("ObjectDisposed_StreamClosed"));
+ throw new ObjectDisposedException(nameof(destination), SR.ObjectDisposed_StreamClosed);
if (!CanRead)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnreadableStream"));
+ throw new NotSupportedException(SR.NotSupported_UnreadableStream);
if (!destination.CanWrite)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnwritableStream"));
+ throw new NotSupportedException(SR.NotSupported_UnwritableStream);
Contract.EndContractBlock();
{
internal static void EndOfFile()
{
- throw new EndOfStreamException(Environment.GetResourceString("IO.EOF_ReadBeyondEOF"));
+ throw new EndOfStreamException(SR.IO_EOF_ReadBeyondEOF);
}
internal static void FileNotOpen()
{
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_FileClosed"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_FileClosed);
}
internal static void StreamIsClosed()
{
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_StreamClosed"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
}
internal static void MemoryStreamNotExpandable()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_MemStreamNotExpandable"));
+ throw new NotSupportedException(SR.NotSupported_MemStreamNotExpandable);
}
internal static void ReaderClosed()
{
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ReaderClosed"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_ReaderClosed);
}
internal static void ReadNotSupported()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnreadableStream"));
+ throw new NotSupportedException(SR.NotSupported_UnreadableStream);
}
internal static void WrongAsyncResult()
{
- throw new ArgumentException(Environment.GetResourceString("Arg_WrongAsyncResult"));
+ throw new ArgumentException(SR.Arg_WrongAsyncResult);
}
internal static void EndReadCalledTwice()
{
// Should ideally be InvalidOperationExc but we can't maitain parity with Stream and FileStream without some work
- throw new ArgumentException(Environment.GetResourceString("InvalidOperation_EndReadCalledMultiple"));
+ throw new ArgumentException(SR.InvalidOperation_EndReadCalledMultiple);
}
internal static void EndWriteCalledTwice()
{
// Should ideally be InvalidOperationExc but we can't maintain parity with Stream and FileStream without some work
- throw new ArgumentException(Environment.GetResourceString("InvalidOperation_EndWriteCalledMultiple"));
+ throw new ArgumentException(SR.InvalidOperation_EndWriteCalledMultiple);
}
// Given a possible fully qualified path, ensure that we have path
if (!safeToReturn)
{
if (PathInternal.IsDirectorySeparator(path[path.Length - 1]))
- path = Environment.GetResourceString("IO.IO_NoPermissionToDirectoryName");
+ path = SR.IO_NoPermissionToDirectoryName;
else
path = Path.GetFileName(path);
}
{
case Win32Native.ERROR_FILE_NOT_FOUND:
if (str.Length == 0)
- throw new FileNotFoundException(Environment.GetResourceString("IO.FileNotFound"));
+ throw new FileNotFoundException(SR.IO_FileNotFound);
else
- throw new FileNotFoundException(Environment.GetResourceString("IO.FileNotFound_FileName", str), str);
+ throw new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, str), str);
case Win32Native.ERROR_PATH_NOT_FOUND:
if (str.Length == 0)
- throw new DirectoryNotFoundException(Environment.GetResourceString("IO.PathNotFound_NoPathName"));
+ throw new DirectoryNotFoundException(SR.IO_PathNotFound_NoPathName);
else
- throw new DirectoryNotFoundException(Environment.GetResourceString("IO.PathNotFound_Path", str));
+ throw new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, str));
case Win32Native.ERROR_ACCESS_DENIED:
if (str.Length == 0)
- throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_IODenied_NoPathName"));
+ throw new UnauthorizedAccessException(SR.UnauthorizedAccess_IODenied_NoPathName);
else
- throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_IODenied_Path", str));
+ throw new UnauthorizedAccessException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, str));
case Win32Native.ERROR_ALREADY_EXISTS:
if (str.Length == 0)
goto default;
- throw new IOException(Environment.GetResourceString("IO.IO_AlreadyExists_Name", str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath);
+ throw new IOException(SR.Format(SR.IO_AlreadyExists_Name, str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath);
case Win32Native.ERROR_FILENAME_EXCED_RANGE:
- throw new PathTooLongException(Environment.GetResourceString("IO.PathTooLong"));
+ throw new PathTooLongException(SR.IO_PathTooLong);
case Win32Native.ERROR_INVALID_DRIVE:
- throw new DriveNotFoundException(Environment.GetResourceString("IO.DriveNotFound_Drive", str));
+ throw new DriveNotFoundException(SR.Format(SR.IO_DriveNotFound_Drive, str));
case Win32Native.ERROR_INVALID_PARAMETER:
throw new IOException(Win32Native.GetMessage(errorCode), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath);
case Win32Native.ERROR_SHARING_VIOLATION:
if (str.Length == 0)
- throw new IOException(Environment.GetResourceString("IO.IO_SharingViolation_NoFileName"), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath);
+ throw new IOException(SR.IO_SharingViolation_NoFileName, Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath);
else
- throw new IOException(Environment.GetResourceString("IO.IO_SharingViolation_File", str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath);
+ throw new IOException(SR.Format(SR.IO_SharingViolation_File, str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath);
case Win32Native.ERROR_FILE_EXISTS:
if (str.Length == 0)
goto default;
- throw new IOException(Environment.GetResourceString("IO.IO_FileExists_Name", str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath);
+ throw new IOException(SR.Format(SR.IO_FileExists_Name, str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath);
case Win32Native.ERROR_OPERATION_ABORTED:
throw new OperationCanceledException();
internal static void WriteNotSupported()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnwritableStream"));
+ throw new NotSupportedException(SR.NotSupported_UnwritableStream);
}
// From WinError.h
return m_value - ((Int16)value).m_value;
}
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt16"));
+ throw new ArgumentException(SR.Arg_MustBeInt16);
}
public int CompareTo(Int16 value)
}
catch (OverflowException e)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Int16"), e);
+ throw new OverflowException(SR.Overflow_Int16, e);
}
// We need this check here since we don't allow signs to specified in hex numbers. So we fixup the result
{ // We are parsing a hexadecimal number
if ((i < 0) || (i > UInt16.MaxValue))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Int16"));
+ throw new OverflowException(SR.Overflow_Int16);
}
return (short)i;
}
- if (i < MinValue || i > MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_Int16"));
+ if (i < MinValue || i > MaxValue) throw new OverflowException(SR.Overflow_Int16);
return (short)i;
}
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Int16", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int16", "DateTime"));
}
/// <internalonly/>
if (m_value > i) return 1;
return 0;
}
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt32"));
+ throw new ArgumentException(SR.Arg_MustBeInt32);
}
public int CompareTo(int value)
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Int32", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int32", "DateTime"));
}
/// <internalonly/>
if (m_value > i) return 1;
return 0;
}
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt64"));
+ throw new ArgumentException(SR.Arg_MustBeInt64);
}
public int CompareTo(Int64 value)
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Int64", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int64", "DateTime"));
}
/// <internalonly/>
if (Size == 4 && (l > Int32.MaxValue || l < Int32.MinValue))
{
- throw new ArgumentException(Environment.GetResourceString("Serialization_InvalidPtrValue"));
+ throw new ArgumentException(SR.Serialization_InvalidPtrValue);
}
m_value = (void*)l;
public static double Round(double value, int digits)
{
if ((digits < 0) || (digits > maxRoundingDigits))
- throw new ArgumentOutOfRangeException(nameof(digits), Environment.GetResourceString("ArgumentOutOfRange_RoundingDigits"));
+ throw new ArgumentOutOfRangeException(nameof(digits), SR.ArgumentOutOfRange_RoundingDigits);
Contract.EndContractBlock();
return InternalRound(value, digits, MidpointRounding.ToEven);
}
public static double Round(double value, int digits, MidpointRounding mode)
{
if ((digits < 0) || (digits > maxRoundingDigits))
- throw new ArgumentOutOfRangeException(nameof(digits), Environment.GetResourceString("ArgumentOutOfRange_RoundingDigits"));
+ throw new ArgumentOutOfRangeException(nameof(digits), SR.ArgumentOutOfRange_RoundingDigits);
if (mode < MidpointRounding.ToEven || mode > MidpointRounding.AwayFromZero)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidEnumValue", mode, nameof(MidpointRounding)), nameof(mode));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode, nameof(MidpointRounding)), nameof(mode));
}
Contract.EndContractBlock();
return InternalRound(value, digits, mode);
{
Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (workaround for JIT inlining)");
if (value == SByte.MinValue)
- throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum"));
+ throw new OverflowException(SR.Overflow_NegateTwosCompNum);
Contract.EndContractBlock();
return ((sbyte)(-value));
}
{
Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (workaround for JIT inlining)");
if (value == Int16.MinValue)
- throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum"));
+ throw new OverflowException(SR.Overflow_NegateTwosCompNum);
Contract.EndContractBlock();
return (short)-value;
}
{
Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (workaround for JIT inlining)");
if (value == Int32.MinValue)
- throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum"));
+ throw new OverflowException(SR.Overflow_NegateTwosCompNum);
Contract.EndContractBlock();
return -value;
}
{
Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (workaround for JIT inlining)");
if (value == Int64.MinValue)
- throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum"));
+ throw new OverflowException(SR.Overflow_NegateTwosCompNum);
Contract.EndContractBlock();
return -value;
}
private static void ThrowMinMaxException<T>(T min, T max)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_MinMaxValue", min, max));
+ throw new ArgumentException(SR.Format(SR.Argument_MinMaxValue, min, max));
}
/*=====================================Log======================================
return 1;
else if (value == 0)
return 0;
- throw new ArithmeticException(Environment.GetResourceString("Arithmetic_NaN"));
+ throw new ArithmeticException(SR.Arithmetic_NaN);
}
public static int Sign(double value)
return 1;
else if (value == 0)
return 0;
- throw new ArithmeticException(Environment.GetResourceString("Arithmetic_NaN"));
+ throw new ArithmeticException(SR.Arithmetic_NaN);
}
public static int Sign(Decimal value)
{
if ((digits < 0) || (digits > maxRoundingDigits))
{
- throw new ArgumentOutOfRangeException(nameof(digits), Environment.GetResourceString("ArgumentOutOfRange_RoundingDigits"));
+ throw new ArgumentOutOfRangeException(nameof(digits), SR.ArgumentOutOfRange_RoundingDigits);
}
Contract.EndContractBlock();
{
if ((digits < 0) || (digits > maxRoundingDigits))
{
- throw new ArgumentOutOfRangeException(nameof(digits), Environment.GetResourceString("ArgumentOutOfRange_RoundingDigits"));
+ throw new ArgumentOutOfRangeException(nameof(digits), SR.ArgumentOutOfRange_RoundingDigits);
}
if (mode < MidpointRounding.ToEven || mode > MidpointRounding.AwayFromZero)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidEnumx", mode, nameof(MidpointRounding)), nameof(mode));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidEnum, mode, nameof(MidpointRounding)), nameof(mode));
}
Contract.EndContractBlock();
{
if (mode < MidpointRounding.ToEven || mode > MidpointRounding.AwayFromZero)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidEnumx", mode, nameof(MidpointRounding)), nameof(mode));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidEnum, mode, nameof(MidpointRounding)), nameof(mode));
}
Contract.EndContractBlock();
public class MissingFieldException : MissingMemberException, ISerializable
{
public MissingFieldException()
- : base(Environment.GetResourceString("Arg_MissingFieldException"))
+ : base(SR.Arg_MissingFieldException)
{
SetErrorCode(__HResults.COR_E_MISSINGFIELD);
}
else
{
// do any desired fixups to classname here.
- return Environment.GetResourceString("MissingField_Name",
- (Signature != null ? FormatSignature(Signature) + " " : "") +
- ClassName + "." + MemberName);
+ return SR.Format(SR.MissingField_Name, (Signature != null ? FormatSignature(Signature) + " " : "") + ClassName + "." + MemberName);
}
}
}
public class MissingMemberException : MemberAccessException, ISerializable
{
public MissingMemberException()
- : base(Environment.GetResourceString("Arg_MissingMemberException"))
+ : base(SR.Arg_MissingMemberException)
{
SetErrorCode(__HResults.COR_E_MISSINGMEMBER);
}
else
{
// do any desired fixups to classname here.
- return Environment.GetResourceString("MissingMember_Name",
- ClassName + "." + MemberName +
- (Signature != null ? " " + FormatSignature(Signature) : ""));
+ return SR.Format(SR.MissingMember_Name, ClassName + "." + MemberName + (Signature != null ? " " + FormatSignature(Signature) : ""));
}
}
}
public class MissingMethodException : MissingMemberException, ISerializable
{
public MissingMethodException()
- : base(Environment.GetResourceString("Arg_MissingMethodException"))
+ : base(SR.Arg_MissingMethodException)
{
SetErrorCode(__HResults.COR_E_MISSINGMETHOD);
}
else
{
// do any desired fixups to classname here.
- return Environment.GetResourceString("MissingMethod_Name",
- ClassName + "." + MemberName +
- (Signature != null ? " " + FormatSignature(Signature) : ""));
+ return SR.Format(SR.MissingMethod_Name, ClassName + "." + MemberName + (Signature != null ? " " + FormatSignature(Signature) : ""));
}
}
}
// One can only create delegates on RuntimeMethodInfo and DynamicMethod.
// If it is not a RuntimeMethodInfo (must be a DynamicMethod) or if it is an unmanaged function pointer, throw
if (!(method is RuntimeMethodInfo) || IsUnmanagedFunctionPtr())
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidDelegateType"));
+ throw new SerializationException(SR.Serialization_InvalidDelegateType);
// We can't deal with secure delegates either.
if (!InvocationListLogicallyNull() && !_invocationCount.IsNull() && !_methodPtrAux.IsNull())
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidDelegateType"));
+ throw new SerializationException(SR.Serialization_InvalidDelegateType);
DelegateSerializationHolder.GetDelegateSerializationInfo(info, this.GetType(), Target, method, targetIndex);
}
}
// if nothing was serialized it is a delegate over a DynamicMethod, so just throw
if (nextDe == null)
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidDelegateType"));
+ throw new SerializationException(SR.Serialization_InvalidDelegateType);
}
}
// Verify that the types are the same...
if (!InternalEqualTypes(this, follow))
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTypeMis"));
+ throw new ArgumentException(SR.Arg_DlgtTypeMis);
MulticastDelegate dFollow = (MulticastDelegate)follow;
Object[] resultList;
[System.Diagnostics.DebuggerNonUserCode]
private void ThrowNullThisInDelegateToInstance()
{
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtNullInst"));
+ throw new ArgumentException(SR.Arg_DlgtNullInst);
}
[System.Diagnostics.DebuggerNonUserCode]
if (!NumberBufferToDecimal(number.PackForNative(), ref result))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Decimal"));
+ throw new OverflowException(SR.Overflow_Decimal);
}
return result;
}
{
return Double.NaN;
}
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
if (!NumberBufferToDouble(number.PackForNative(), ref d))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Double"));
+ throw new OverflowException(SR.Overflow_Double);
}
return d;
{
if (!HexNumberToInt32(ref number, ref i))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Int32"));
+ throw new OverflowException(SR.Overflow_Int32);
}
}
else
{
if (!NumberToInt32(ref number, ref i))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Int32"));
+ throw new OverflowException(SR.Overflow_Int32);
}
}
return i;
{
if (!HexNumberToInt64(ref number, ref i))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Int64"));
+ throw new OverflowException(SR.Overflow_Int64);
}
}
else
{
if (!NumberToInt64(ref number, ref i))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Int64"));
+ throw new OverflowException(SR.Overflow_Int64);
}
}
return i;
{
return Single.NaN;
}
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
if (!NumberBufferToDouble(number.PackForNative(), ref d))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Single"));
+ throw new OverflowException(SR.Overflow_Single);
}
Single castSingle = (Single)d;
if (Single.IsInfinity(castSingle))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_Single"));
+ throw new OverflowException(SR.Overflow_Single);
}
return castSingle;
}
{
if (!HexNumberToUInt32(ref number, ref i))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_UInt32"));
+ throw new OverflowException(SR.Overflow_UInt32);
}
}
else
{
if (!NumberToUInt32(ref number, ref i))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_UInt32"));
+ throw new OverflowException(SR.Overflow_UInt32);
}
}
{
if (!HexNumberToUInt64(ref number, ref i))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_UInt64"));
+ throw new OverflowException(SR.Overflow_UInt64);
}
}
else
{
if (!NumberToUInt64(ref number, ref i))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_UInt64"));
+ throw new OverflowException(SR.Overflow_UInt64);
}
}
return i;
if (!ParseNumber(ref p, options, ref number, null, info, parseDecimal)
|| (p - stringPointer < str.Length && !TrailingZeros(str, (int)(p - stringPointer))))
{
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
}
}
FieldInfo fldInfo = GetFieldInfo(typeName, fieldName);
if (fldInfo.IsInitOnly)
- throw new FieldAccessException(Environment.GetResourceString("FieldAccess_InitOnly"));
+ throw new FieldAccessException(SR.FieldAccess_InitOnly);
// Make sure that the value is compatible with the type
// of field
Console.Write("Exception thrown: ");
Console.WriteLine(e);
#endif
- throw new COMException(Environment.GetResourceString("Interop.COM_TypeMismatch"), unchecked((int)0x80020005));
+ throw new COMException(SR.Interop_COM_TypeMismatch, unchecked((int)0x80020005));
}
}
}
if (platform < PlatformID.Win32S || platform > PlatformID.MacOSX)
{
throw new ArgumentException(
- Environment.GetResourceString("Arg_EnumIllegalVal", (int)platform),
+ SR.Format(SR.Arg_EnumIllegalVal, (int)platform),
nameof(platform));
}
if (_version == null)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_MissField", "_version"));
+ throw new SerializationException(SR.Format(SR.Serialization_MissField, "_version"));
}
}
}
public OperationCanceledException()
- : base(Environment.GetResourceString("OperationCanceled"))
+ : base(SR.OperationCanceled)
{
SetErrorCode(__HResults.COR_E_OPERATIONCANCELED);
}
{
if (minValue > maxValue)
{
- throw new ArgumentOutOfRangeException(nameof(minValue), Environment.GetResourceString("Argument_MinMaxValue", nameof(minValue), nameof(maxValue)));
+ throw new ArgumentOutOfRangeException(nameof(minValue), SR.Format(SR.Argument_MinMaxValue, nameof(minValue), nameof(maxValue)));
}
Contract.EndContractBlock();
{
if (maxValue < 0)
{
- throw new ArgumentOutOfRangeException(nameof(maxValue), Environment.GetResourceString("ArgumentOutOfRange_MustBePositive", nameof(maxValue)));
+ throw new ArgumentOutOfRangeException(nameof(maxValue), SR.Format(SR.ArgumentOutOfRange_MustBePositive, nameof(maxValue)));
}
Contract.EndContractBlock();
return (int)(Sample() * maxValue);
public sealed class AmbiguousMatchException : SystemException
{
public AmbiguousMatchException()
- : base(Environment.GetResourceString("RFLCT.Ambiguous"))
+ : base(SR.RFLCT_Ambiguous)
{
SetErrorCode(__HResults.COR_E_AMBIGUOUSMATCH);
}
byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AssemblyLoadFromHash"));
+ throw new NotSupportedException(SR.NotSupported_AssemblyLoadFromHash);
}
// Locate an assembly by the long form of the assembly name.
if (assemblyRef != null && assemblyRef.CodeBase != null)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AssemblyLoadCodeBase"));
+ throw new NotSupportedException(SR.NotSupported_AssemblyLoadCodeBase);
}
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
if (assemblyRef != null && assemblyRef.CodeBase != null)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AssemblyLoadCodeBase"));
+ throw new NotSupportedException(SR.NotSupported_AssemblyLoadCodeBase);
}
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
if (PathInternal.IsPartiallyQualified(path))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), nameof(path));
+ throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(path));
}
string normalizedPath = Path.GetFullPath(path);
Contract.EndContractBlock();
if ((assemblyName.Length == 0) ||
(assemblyName[0] == '\0'))
- throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength"));
+ throw new ArgumentException(SR.Format_StringZeroLength);
_Name = assemblyName;
nInit();
{
// Should be a rare case where the app tries to feed an invalid Unicode surrogates pair
if (count == 1 || count == end - i)
- throw new FormatException(Environment.GetResourceString("Arg_FormatException"));
+ throw new FormatException(SR.Arg_FormatException);
// need to grab one more char as a Surrogate except when it's a bogus input
++count;
}
// This is the only exception that built in UriParser can throw after a Uri ctor.
// Should not happen unless the app tries to feed an invalid Unicode String
if (numberOfBytes == 0)
- throw new FormatException(Environment.GetResourceString("Arg_FormatException"));
+ throw new FormatException(SR.Arg_FormatException);
i += (count - 1);
if (type.IsValueType)
return CustomAttributeEncoding.Undefined;
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidKindOfTypeForCA"), nameof(type));
+ throw new ArgumentException(SR.Argument_InvalidKindOfTypeForCA, nameof(type));
}
private static CustomAttributeType InitCustomAttributeType(RuntimeType parameterType)
{
else if (property != null)
type = property.PropertyType;
else
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidMemberForNamedArgument"));
+ throw new ArgumentException(SR.Argument_InvalidMemberForNamedArgument);
m_memberInfo = memberInfo;
m_value = new CustomAttributeTypedArgument(type, value);
return typeof(object);
default:
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)encodedType), nameof(encodedType));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)encodedType), nameof(encodedType));
}
}
unsafe { return *(double*)&val; }
default:
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)val), nameof(val));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)val), nameof(val));
}
}
private static RuntimeType ResolveType(RuntimeModule scope, string typeName)
if (type == null)
throw new InvalidOperationException(
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Arg_CATypeResolutionFailed"), typeName));
+ String.Format(CultureInfo.CurrentUICulture, SR.Arg_CATypeResolutionFailed, typeName));
return type;
}
RuntimeModule decoratedModule, int decoratedMetadataToken, RuntimeType attributeFilterType, int attributeCtorToken, bool mustBeInheritable)
{
if (decoratedModule.Assembly.ReflectionOnly)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyCA"));
+ throw new InvalidOperationException(SR.Arg_ReflectionOnlyCA);
Contract.EndContractBlock();
CustomAttributeRecord[] car = CustomAttributeData.GetCustomAttributeRecords(decoratedModule, decoratedMetadataToken);
RuntimeType attributeFilterType, bool mustBeInheritable, IList derivedAttributes, bool isDecoratedTargetSecurityTransparent)
{
if (decoratedModule.Assembly.ReflectionOnly)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyCA"));
+ throw new InvalidOperationException(SR.Arg_ReflectionOnlyCA);
Contract.EndContractBlock();
MetadataImport scope = decoratedModule.MetadataImport;
if (property == null)
{
throw new CustomAttributeFormatException(
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString(
- isProperty ? "RFLCT.InvalidPropFail" : "RFLCT.InvalidFieldFail"), name));
+ String.Format(CultureInfo.CurrentUICulture,
+ isProperty ? SR.RFLCT_InvalidPropFail : SR.RFLCT_InvalidFieldFail, name));
}
RuntimeMethodInfo setMethod = property.GetSetMethod(true) as RuntimeMethodInfo;
catch (Exception e)
{
throw new CustomAttributeFormatException(
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString(
- isProperty ? "RFLCT.InvalidPropFail" : "RFLCT.InvalidFieldFail"), name), e);
+ String.Format(CultureInfo.CurrentUICulture,
+ isProperty ? SR.RFLCT_InvalidPropFail : SR.RFLCT_InvalidFieldFail, name), e);
}
#endregion
}
if (attributeUsageAttribute != null)
throw new FormatException(String.Format(
- CultureInfo.CurrentUICulture, Environment.GetResourceString("Format_AttributeUsage"), attributeType));
+ CultureInfo.CurrentUICulture, SR.Format_AttributeUsage, attributeType));
AttributeTargets targets;
bool inherited, allowMultiple;
public class CustomAttributeFormatException : FormatException
{
public CustomAttributeFormatException()
- : base(Environment.GetResourceString("Arg_CustomAttributeFormatException"))
+ : base(SR.Arg_CustomAttributeFormatException)
{
SetErrorCode(__HResults.COR_E_CUSTOMATTRIBUTEFORMAT);
}
#region Methods inherited from Assembly
public override String[] GetManifestResourceNames()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly"));
+ throw new NotSupportedException(SR.NotSupported_DynamicAssembly);
}
public override FileStream GetFile(String name)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly"));
+ throw new NotSupportedException(SR.NotSupported_DynamicAssembly);
}
public override FileStream[] GetFiles(bool getResourceModules)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly"));
+ throw new NotSupportedException(SR.NotSupported_DynamicAssembly);
}
public override Stream GetManifestResourceStream(Type type, String name)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly"));
+ throw new NotSupportedException(SR.NotSupported_DynamicAssembly);
}
public override Stream GetManifestResourceStream(String name)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly"));
+ throw new NotSupportedException(SR.NotSupported_DynamicAssembly);
}
public override ManifestResourceInfo GetManifestResourceInfo(String resourceName)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly"));
+ throw new NotSupportedException(SR.NotSupported_DynamicAssembly);
}
public override String Location
{
get
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly"));
+ throw new NotSupportedException(SR.NotSupported_DynamicAssembly);
}
}
{
get
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly"));
+ throw new NotSupportedException(SR.NotSupported_DynamicAssembly);
}
}
public override Type[] GetExportedTypes()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly"));
+ throw new NotSupportedException(SR.NotSupported_DynamicAssembly);
}
public override String ImageRuntimeVersion
&& access != AssemblyBuilderAccess.RunAndCollect
)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)access), nameof(access));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)access), nameof(access));
}
if (securityContextSource < SecurityContextSource.CurrentAppDomain ||
if (name == null)
throw new ArgumentNullException(nameof(name));
if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
if (name[0] == '\0')
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidName"), nameof(name));
+ throw new ArgumentException(SR.Argument_InvalidName, nameof(name));
Contract.Ensures(Contract.Result<ModuleBuilder>() != null);
Contract.EndContractBlock();
// create the dynamic module- only one ModuleBuilder per AssemblyBuilder can be created
if (m_fManifestModuleUsedAsDefinedModule == true)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NoMultiModuleAssembly"));
+ throw new InvalidOperationException(SR.InvalidOperation_NoMultiModuleAssembly);
// Init(...) has already been called on m_manifestModuleBuilder in InitManifestModule()
dynModule = m_manifestModuleBuilder;
continue;
if (type.Module == null || type.Module.Assembly == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_TypeNotValid"));
+ throw new ArgumentException(SR.Argument_TypeNotValid);
if (type.Module.Assembly == typeof(object).Module.Assembly)
continue;
if (type.Module.Assembly.ReflectionOnly && !ReflectionOnly)
- throw new InvalidOperationException(Environment.GetResourceString("Arugment_EmitMixedContext1", type.AssemblyQualifiedName));
+ throw new InvalidOperationException(SR.Format(SR.Arugment_EmitMixedContext1, type.AssemblyQualifiedName));
if (!type.Module.Assembly.ReflectionOnly && ReflectionOnly)
- throw new InvalidOperationException(Environment.GetResourceString("Arugment_EmitMixedContext2", type.AssemblyQualifiedName));
+ throw new InvalidOperationException(SR.Format(SR.Arugment_EmitMixedContext2, type.AssemblyQualifiedName));
}
}
if (name == null)
throw new ArgumentNullException(nameof(name));
if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
Contract.EndContractBlock();
BCLDebug.Log("DYNIL", "## DYNIL LOGGING: AssemblyBuilder.GetDynamicModule( " + name + " )");
// if (enclosingType == null && m_assembly.GetType(strTypeName, false, false) != null)
// {
// // Cannot have two types with the same name
- // throw new ArgumentException(Environment.GetResourceString("Argument_DuplicateTypeName"));
+ // throw new ArgumentException(SR.Argument_DuplicateTypeName);
// }
}
#region MethodBase Overrides
public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
[Pure]
#region ConstructorInfo Overrides
public override Object Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
#endregion
public ILGenerator GetILGenerator()
{
if (m_isDefaultConstructor)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_DefaultConstructorILGen"));
+ throw new InvalidOperationException(SR.InvalidOperation_DefaultConstructorILGen);
return m_methodBuilder.GetILGenerator();
}
public ILGenerator GetILGenerator(int streamSize)
{
if (m_isDefaultConstructor)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_DefaultConstructorILGen"));
+ throw new InvalidOperationException(SR.InvalidOperation_DefaultConstructorILGen);
return m_methodBuilder.GetILGenerator(streamSize);
}
if (fieldValues == null)
throw new ArgumentNullException(nameof(fieldValues));
if (namedProperties.Length != propertyValues.Length)
- throw new ArgumentException(Environment.GetResourceString("Arg_ArrayLengthsDiffer"), "namedProperties, propertyValues");
+ throw new ArgumentException(SR.Arg_ArrayLengthsDiffer, "namedProperties, propertyValues");
if (namedFields.Length != fieldValues.Length)
- throw new ArgumentException(Environment.GetResourceString("Arg_ArrayLengthsDiffer"), "namedFields, fieldValues");
+ throw new ArgumentException(SR.Arg_ArrayLengthsDiffer, "namedFields, fieldValues");
Contract.EndContractBlock();
if ((con.Attributes & MethodAttributes.Static) == MethodAttributes.Static ||
(con.Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Private)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadConstructor"));
+ throw new ArgumentException(SR.Argument_BadConstructor);
if ((con.CallingConvention & CallingConventions.Standard) != CallingConventions.Standard)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadConstructorCallConv"));
+ throw new ArgumentException(SR.Argument_BadConstructorCallConv);
// Cache information used elsewhere.
m_con = con;
// Since we're guaranteed a non-var calling convention, the number of arguments must equal the number of parameters.
if (paramTypes.Length != constructorArgs.Length)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadParameterCountsForConstructor"));
+ throw new ArgumentException(SR.Argument_BadParameterCountsForConstructor);
// Verify that the constructor has a valid signature (custom attributes only support a subset of our type system).
for (i = 0; i < paramTypes.Length; i++)
if (!ValidateType(paramTypes[i]))
- throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeInCustomAttribute"));
+ throw new ArgumentException(SR.Argument_BadTypeInCustomAttribute);
// Now verify that the types of the actual parameters are compatible with the types of the formal parameters.
for (i = 0; i < paramTypes.Length; i++)
// Validate property type.
if (!ValidateType(propType))
- throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeInCustomAttribute"));
+ throw new ArgumentException(SR.Argument_BadTypeInCustomAttribute);
// Property has to be writable.
if (!property.CanWrite)
- throw new ArgumentException(Environment.GetResourceString("Argument_NotAWritableProperty"));
+ throw new ArgumentException(SR.Argument_NotAWritableProperty);
// Property has to be from the same class or base class as ConstructorInfo.
if (property.DeclaringType != con.DeclaringType
// type is one.
if (!(property.DeclaringType is TypeBuilder) ||
!con.DeclaringType.IsSubclassOf(((TypeBuilder)property.DeclaringType).BakedRuntimeType))
- throw new ArgumentException(Environment.GetResourceString("Argument_BadPropertyForConstructorBuilder"));
+ throw new ArgumentException(SR.Argument_BadPropertyForConstructorBuilder);
}
}
// Validate field type.
if (!ValidateType(fldType))
- throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeInCustomAttribute"));
+ throw new ArgumentException(SR.Argument_BadTypeInCustomAttribute);
// Field has to be from the same class or base class as ConstructorInfo.
if (namedField.DeclaringType != con.DeclaringType
// type is one.
if (!(namedField.DeclaringType is TypeBuilder) ||
!con.DeclaringType.IsSubclassOf(((TypeBuilder)namedFields[i].DeclaringType).BakedRuntimeType))
- throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldForConstructorBuilder"));
+ throw new ArgumentException(SR.Argument_BadFieldForConstructorBuilder);
}
}
{
if (type != typeof(object) && Type.GetTypeCode(passedType) != Type.GetTypeCode(type))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch"));
+ throw new ArgumentException(SR.Argument_ConstantDoesntMatch);
}
if (passedType == typeof(IntPtr) || passedType == typeof(UIntPtr))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_BadParameterTypeForCAB"), paramName);
+ throw new ArgumentException(SR.Argument_BadParameterTypeForCAB, paramName);
}
}
{
String typeName = TypeNameBuilder.ToString((Type)value, TypeNameBuilder.Format.AssemblyQualifiedName);
if (typeName == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTypeForCA",
- value.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidTypeForCA, value.GetType()));
EmitString(writer, typeName);
}
}
// value cannot be a "System.Object" object.
// If we allow this we will get into an infinite recursion
if (ot == typeof(object))
- throw new ArgumentException(Environment.GetResourceString("Argument_BadParameterTypeForCAB", ot.ToString()));
+ throw new ArgumentException(SR.Format(SR.Argument_BadParameterTypeForCAB, ot.ToString()));
EmitType(writer, ot);
EmitValue(writer, ot, value);
if (value != null)
typename = value.GetType().ToString();
- throw new ArgumentException(Environment.GetResourceString("Argument_BadParameterTypeForCAB", typename));
+ throw new ArgumentException(SR.Format(SR.Argument_BadParameterTypeForCAB, typename));
}
}
RuntimeType rtType = localType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType);
localBuilder = new LocalBuilder(m_localCount, localType, m_methodBuilder);
// add the localType to local signature
{
RuntimeMethodInfo rtMeth = meth as RuntimeMethodInfo;
if (rtMeth == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(meth));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(meth));
RuntimeType declaringType = rtMeth.GetRuntimeType();
if (declaringType != null && (declaringType.IsGenericType || declaringType.IsArray))
// rule out not allowed operations on DynamicMethods
if (opcode.Equals(OpCodes.Ldtoken) || opcode.Equals(OpCodes.Ldftn) || opcode.Equals(OpCodes.Ldvirtftn))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOpCodeOnDynamicMethod"));
+ throw new ArgumentException(SR.Argument_InvalidOpCodeOnDynamicMethod);
}
token = GetTokenFor(dynMeth);
}
RuntimeConstructorInfo rtConstructor = con as RuntimeConstructorInfo;
if (rtConstructor == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(con));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(con));
RuntimeType declaringType = rtConstructor.GetRuntimeType();
int token;
RuntimeType rtType = type as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType);
int token = GetTokenFor(rtType);
EnsureCapacity(7);
RuntimeFieldInfo runtimeField = field as RuntimeFieldInfo;
if (runtimeField == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo"), nameof(field));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo, nameof(field));
int token;
if (field.DeclaringType == null)
if (optionalParameterTypes != null)
if ((callingConvention & CallingConventions.VarArgs) == 0)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAVarArgCallingConvention"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention);
sig = GetMemberRefSignature(callingConvention,
returnType,
throw new ArgumentNullException(nameof(methodInfo));
if (!(opcode.Equals(OpCodes.Call) || opcode.Equals(OpCodes.Callvirt) || opcode.Equals(OpCodes.Newobj)))
- throw new ArgumentException(Environment.GetResourceString("Argument_NotMethodCallOpcode"), nameof(opcode));
+ throw new ArgumentException(SR.Argument_NotMethodCallOpcode, nameof(opcode));
if (methodInfo.ContainsGenericParameters)
- throw new ArgumentException(Environment.GetResourceString("Argument_GenericsInvalid"), nameof(methodInfo));
+ throw new ArgumentException(SR.Argument_GenericsInvalid, nameof(methodInfo));
if (methodInfo.DeclaringType != null && methodInfo.DeclaringType.ContainsGenericParameters)
- throw new ArgumentException(Environment.GetResourceString("Argument_GenericsInvalid"), nameof(methodInfo));
+ throw new ArgumentException(SR.Argument_GenericsInvalid, nameof(methodInfo));
Contract.EndContractBlock();
int tk;
// Begins an exception filter block. Emits a branch instruction to the end of the current exception block.
if (CurrExcStackCount == 0)
- throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock"));
+ throw new NotSupportedException(SR.Argument_NotInExceptionBlock);
__ExceptionInfo current = CurrExcStack[CurrExcStackCount - 1];
public override void BeginCatchBlock(Type exceptionType)
{
if (CurrExcStackCount == 0)
- throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock"));
+ throw new NotSupportedException(SR.Argument_NotInExceptionBlock);
Contract.EndContractBlock();
__ExceptionInfo current = CurrExcStack[CurrExcStackCount - 1];
{
if (exceptionType != null)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_ShouldNotSpecifyExceptionType"));
+ throw new ArgumentException(SR.Argument_ShouldNotSpecifyExceptionType);
}
this.Emit(OpCodes.Endfilter);
throw new ArgumentNullException(nameof(exceptionType));
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType);
Label endLabel = current.GetEndLabel();
this.Emit(OpCodes.Leave, endLabel);
[SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
public override void UsingNamespace(String ns)
{
- throw new NotSupportedException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod"));
+ throw new NotSupportedException(SR.InvalidOperation_NotAllowedInDynamicMethod);
}
[SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
int endLine,
int endColumn)
{
- throw new NotSupportedException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod"));
+ throw new NotSupportedException(SR.InvalidOperation_NotAllowedInDynamicMethod);
}
public override void BeginScope()
{
- throw new NotSupportedException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod"));
+ throw new NotSupportedException(SR.InvalidOperation_NotAllowedInDynamicMethod);
}
public override void EndScope()
{
- throw new NotSupportedException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod"));
+ throw new NotSupportedException(SR.InvalidOperation_NotAllowedInDynamicMethod);
}
private int GetMemberRefToken(MethodBase methodInfo, Type[] optionalParameterTypes)
Type[] parameterTypes;
if (optionalParameterTypes != null && (methodInfo.CallingConvention & CallingConventions.VarArgs) == 0)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAVarArgCallingConvention"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention);
RuntimeMethodInfo rtMeth = methodInfo as RuntimeMethodInfo;
DynamicMethod dm = methodInfo as DynamicMethod;
if (rtMeth == null && dm == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(methodInfo));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(methodInfo));
ParameterInfo[] paramInfo = methodInfo.GetParametersNoCopy();
if (paramInfo != null && paramInfo.Length != 0)
Type t = m.DeclaringType.GetGenericTypeDefinition();
throw new ArgumentException(String.Format(
- CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_MethodDeclaringTypeGenericLcg"), m, t));
+ CultureInfo.CurrentCulture, SR.Argument_MethodDeclaringTypeGenericLcg, m, t));
}
}
{
// only static public for method attributes
if ((attributes & ~MethodAttributes.MemberAccessMask) != MethodAttributes.Static)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicMethodFlags"));
+ throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags);
if ((attributes & MethodAttributes.MemberAccessMask) != MethodAttributes.Public)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicMethodFlags"));
+ throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags);
Contract.EndContractBlock();
// only standard or varargs supported
if (callingConvention != CallingConventions.Standard && callingConvention != CallingConventions.VarArgs)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicMethodFlags"));
+ throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags);
// vararg is not supported at the moment
if (callingConvention == CallingConventions.VarArgs)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicMethodFlags"));
+ throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags);
}
// We create a transparent assembly to host DynamicMethods. Since the assembly does not have any
for (int i = 0; i < signature.Length; i++)
{
if (signature[i] == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidTypeInSignature"));
+ throw new ArgumentException(SR.Arg_InvalidTypeInSignature);
m_parameterTypes[i] = signature[i].UnderlyingSystemType as RuntimeType;
if (m_parameterTypes[i] == null || !(m_parameterTypes[i] is RuntimeType) || m_parameterTypes[i] == (RuntimeType)typeof(void))
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidTypeInSignature"));
+ throw new ArgumentException(SR.Arg_InvalidTypeInSignature);
}
}
else
// check and store the return value
m_returnType = (returnType == null) ? (RuntimeType)typeof(void) : returnType.UnderlyingSystemType as RuntimeType;
if ((m_returnType == null) || !(m_returnType is RuntimeType) || m_returnType.IsByRef)
- throw new NotSupportedException(Environment.GetResourceString("Arg_InvalidTypeInRetType"));
+ throw new NotSupportedException(SR.Arg_InvalidTypeInRetType);
if (transparentMethod)
{
{
if (rtOwner.HasElementType || rtOwner.ContainsGenericParameters
|| rtOwner.IsGenericParameter || rtOwner.IsInterface)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTypeForDynamicMethod"));
+ throw new ArgumentException(SR.Argument_InvalidTypeForDynamicMethod);
m_typeOwner = rtOwner;
m_module = rtOwner.GetRuntimeModule();
else
{
if (m_ilGenerator == null || m_ilGenerator.ILOffset == 0)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadEmptyMethodBody", Name));
+ throw new InvalidOperationException(SR.Format(SR.InvalidOperation_BadEmptyMethodBody, Name));
m_ilGenerator.GetCallableMethod(m_module, this);
}
public override Module Module { get { return m_dynMethod.Module; } }
// we cannot return a MethodHandle because we cannot track it via GC so this method is off limits
- public override RuntimeMethodHandle MethodHandle { get { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod")); } }
+ public override RuntimeMethodHandle MethodHandle { get { throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInDynamicMethod); } }
public override MethodAttributes Attributes { get { return m_dynMethod.Attributes; } }
public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
{
if ((CallingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_CallToVarArg"));
+ throw new NotSupportedException(SR.NotSupported_CallToVarArg);
Contract.EndContractBlock();
//
int formalCount = sig.Arguments.Length;
int actualCount = (parameters != null) ? parameters.Length : 0;
if (formalCount != actualCount)
- throw new TargetParameterCountException(Environment.GetResourceString("Arg_ParmCnt"));
+ throw new TargetParameterCountException(SR.Arg_ParmCnt);
// if we are here we passed all the previous checks. Time to look at the arguments
Object retValue = null;
public ParameterBuilder DefineParameter(int position, ParameterAttributes attributes, String parameterName)
{
if (position < 0 || position > m_parameterTypes.Length)
- throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_ParamSequence"));
+ throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_ParamSequence);
position--; // it's 1 based. 0 is the return value
if (position >= 0)
public override RuntimeMethodHandle MethodHandle
{
- get { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod")); }
+ get { throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInDynamicMethod); }
}
public override MethodAttributes Attributes
// If we allowed use of RTDynamicMethod, the creator of the DynamicMethod would
// not be able to bound access to the DynamicMethod. Hence, we do not allow
// direct use of RTDynamicMethod.
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), "this");
+ throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, "this");
}
public override Object[] GetCustomAttributes(Type attributeType, bool inherit)
protected override PropertyInfo GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder,
Type returnType, Type[] types, ParameterModifier[] modifiers)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
{
// Client should not set any bits other than the visibility bits.
if ((visibility & ~TypeAttributes.VisibilityMask) != 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_ShouldOnlySetVisibilityFlags"), nameof(name));
+ throw new ArgumentException(SR.Argument_ShouldOnlySetVisibilityFlags, nameof(name));
m_typeBuilder = new TypeBuilder(name, visibility | TypeAttributes.Sealed, typeof(System.Enum), null, module, PackingSize.Unspecified, TypeBuilder.UnspecifiedTypeSize, null);
// Define the underlying field for the enum. It will be a non-static, private field with special name bit set.
throw new ArgumentNullException(nameof(fieldName));
if (fieldName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(fieldName));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(fieldName));
if (fieldName[0] == '\0')
- throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), nameof(fieldName));
+ throw new ArgumentException(SR.Argument_IllegalName, nameof(fieldName));
if (type == null)
throw new ArgumentNullException(nameof(type));
if (type == typeof(void))
- throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldType"));
+ throw new ArgumentException(SR.Argument_BadFieldType);
Contract.EndContractBlock();
m_fieldName = fieldName;
// a NotSupportedException for Save-only dynamic assemblies.
// Otherwise, it could cause the .cctor to be executed.
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override void SetValue(Object obj, Object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
// a NotSupportedException for Save-only dynamic assemblies.
// Otherwise, it could cause the .cctor to be executed.
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override RuntimeFieldHandle FieldHandle
{
- get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); }
+ get { throw new NotSupportedException(SR.NotSupported_DynamicModule); }
}
public override FieldAttributes Attributes
#region ICustomAttributeProvider Implementation
public override Object[] GetCustomAttributes(bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override Object[] GetCustomAttributes(Type attributeType, bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override bool IsDefined(Type attributeType, bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
#endregion
public override Type GetGenericTypeDefinition() { throw new InvalidOperationException(); }
- public override Type MakeGenericType(params Type[] typeArguments) { throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericTypeDefinition")); }
+ public override Type MakeGenericType(params Type[] typeArguments) { throw new InvalidOperationException(SR.Arg_NotGenericTypeDefinition); }
protected override bool IsValueTypeImpl() { return false; }
if (m_currExcStackCount != 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_UnclosedExceptionBlock"));
+ throw new ArgumentException(SR.Argument_UnclosedExceptionBlock);
}
if (m_length == 0)
return null;
//Verify that our one-byte arg will fit into a Signed Byte.
if (updateAddr < SByte.MinValue || updateAddr > SByte.MaxValue)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_IllegalOneByteBranch", m_fixupData[i].m_fixupPos, updateAddr));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_IllegalOneByteBranch, m_fixupData[i].m_fixupPos, updateAddr));
}
//Place the one-byte arg
__ExceptionInfo[] temp;
if (m_currExcStackCount != 0)
{
- throw new NotSupportedException(Environment.GetResourceString(ResId.Argument_UnclosedExceptionBlock));
+ throw new NotSupportedException(SR.GetResourceString(ResId.Argument_UnclosedExceptionBlock));
}
if (m_exceptionCount == 0)
int index = lbl.GetLabelValue();
if (index < 0 || index >= m_labelCount)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadLabel"));
+ throw new ArgumentException(SR.Argument_BadLabel);
if (m_labelList[index] < 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadLabelContent"));
+ throw new ArgumentException(SR.Argument_BadLabelContent);
return m_labelList[index];
}
if ((callingConvention & CallingConventions.VarArgs) == 0)
{
// Client should not supply optional parameter in default calling convention
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAVarArgCallingConvention"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention);
}
}
throw new ArgumentNullException(nameof(methodInfo));
if (!(opcode.Equals(OpCodes.Call) || opcode.Equals(OpCodes.Callvirt) || opcode.Equals(OpCodes.Newobj)))
- throw new ArgumentException(Environment.GetResourceString("Argument_NotMethodCallOpcode"), nameof(opcode));
+ throw new ArgumentException(SR.Argument_NotMethodCallOpcode, nameof(opcode));
Contract.EndContractBlock();
int tempVal = local.GetLocalIndex();
if (local.GetMethodBuilder() != m_methodBuilder)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_UnmatchedMethodForLocal"), nameof(local));
+ throw new ArgumentException(SR.Argument_UnmatchedMethodForLocal, nameof(local));
}
// If the instruction is a ldloc, ldloca a stloc, morph it to the optimal form.
if (opcode.Equals(OpCodes.Ldloc))
//Handle stloc_1, ldloc_1
if (tempVal > Byte.MaxValue)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadInstructionOrIndexOutOfBound"));
+ throw new InvalidOperationException(SR.InvalidOperation_BadInstructionOrIndexOutOfBound);
}
m_ILStream[m_length++] = (byte)tempVal;
}
{
if (m_currExcStackCount == 0)
{
- throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock"));
+ throw new NotSupportedException(SR.Argument_NotInExceptionBlock);
}
// Pop the current exception block
if (state == __ExceptionInfo.State_Filter ||
state == __ExceptionInfo.State_Try)
{
- throw new InvalidOperationException(Environment.GetResourceString("Argument_BadExceptionCodeGen"));
+ throw new InvalidOperationException(SR.Argument_BadExceptionCodeGen);
}
if (state == __ExceptionInfo.State_Catch)
// Begins an exception filter block. Emits a branch instruction to the end of the current exception block.
if (m_currExcStackCount == 0)
- throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock"));
+ throw new NotSupportedException(SR.Argument_NotInExceptionBlock);
__ExceptionInfo current = m_currExcStack[m_currExcStackCount - 1];
if (m_currExcStackCount == 0)
{
- throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock"));
+ throw new NotSupportedException(SR.Argument_NotInExceptionBlock);
}
__ExceptionInfo current = m_currExcStack[m_currExcStackCount - 1];
{
if (exceptionType != null)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_ShouldNotSpecifyExceptionType"));
+ throw new ArgumentException(SR.Argument_ShouldNotSpecifyExceptionType);
}
this.Emit(OpCodes.Endfilter);
{
if (m_currExcStackCount == 0)
{
- throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock"));
+ throw new NotSupportedException(SR.Argument_NotInExceptionBlock);
}
__ExceptionInfo current = m_currExcStack[m_currExcStackCount - 1];
{
if (m_currExcStackCount == 0)
{
- throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock"));
+ throw new NotSupportedException(SR.Argument_NotInExceptionBlock);
}
__ExceptionInfo current = m_currExcStack[m_currExcStackCount - 1];
int state = current.GetCurrentState();
//This should never happen.
if (labelIndex < 0 || labelIndex >= m_labelList.Length)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidLabel"));
+ throw new ArgumentException(SR.Argument_InvalidLabel);
}
if (m_labelList[labelIndex] != -1)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_RedefinedLabel"));
+ throw new ArgumentException(SR.Argument_RedefinedLabel);
}
m_labelList[labelIndex] = m_length;
if (!excType.IsSubclassOf(typeof(Exception)) && excType != typeof(Exception))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_NotExceptionType"));
+ throw new ArgumentException(SR.Argument_NotExceptionType);
}
Contract.EndContractBlock();
ConstructorInfo con = excType.GetConstructor(Type.EmptyTypes);
if (con == null)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_MissingDefaultConstructor"));
+ throw new ArgumentException(SR.Argument_MissingDefaultConstructor);
}
this.Emit(OpCodes.Newobj, con);
this.Emit(OpCodes.Throw);
Object cls;
if (m_methodBuilder == null)
{
- throw new ArgumentException(Environment.GetResourceString("InvalidOperation_BadILGeneratorUsage"));
+ throw new ArgumentException(SR.InvalidOperation_BadILGeneratorUsage);
}
MethodInfo prop = GetConsoleType().GetMethod("get_Out");
cls = localBuilder.LocalType;
if (cls is TypeBuilder || cls is EnumBuilder)
{
- throw new ArgumentException(Environment.GetResourceString("NotSupported_OutputStreamUsingTypeBuilder"));
+ throw new ArgumentException(SR.NotSupported_OutputStreamUsingTypeBuilder);
}
parameterTypes[0] = (Type)cls;
MethodInfo mi = prop.ReturnType.GetMethod("WriteLine", parameterTypes);
if (mi == null)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_EmitWriteLineType"), nameof(localBuilder));
+ throw new ArgumentException(SR.Argument_EmitWriteLineType, nameof(localBuilder));
}
Emit(OpCodes.Callvirt, mi);
cls = fld.FieldType;
if (cls is TypeBuilder || cls is EnumBuilder)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_OutputStreamUsingTypeBuilder"));
+ throw new NotSupportedException(SR.NotSupported_OutputStreamUsingTypeBuilder);
}
parameterTypes[0] = (Type)cls;
MethodInfo mi = prop.ReturnType.GetMethod("WriteLine", parameterTypes);
if (mi == null)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_EmitWriteLineType"), nameof(fld));
+ throw new ArgumentException(SR.Argument_EmitWriteLineType, nameof(fld));
}
Emit(OpCodes.Callvirt, mi);
}
if (methodBuilder.IsTypeCreated())
{
// cannot change method after its containing type has been created
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TypeHasBeenCreated"));
+ throw new InvalidOperationException(SR.InvalidOperation_TypeHasBeenCreated);
}
if (localType == null)
if (methodBuilder.m_bIsBaked)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MethodBaked"));
+ throw new InvalidOperationException(SR.InvalidOperation_MethodBaked);
}
// add the localType to local signature
throw new ArgumentNullException(nameof(usingNamespace));
if (usingNamespace.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(usingNamespace));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(usingNamespace));
Contract.EndContractBlock();
int index;
{
if (m_endFinally != -1)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_TooManyFinallyClause"));
+ throw new ArgumentException(SR.Argument_TooManyFinallyClause);
}
else
{
{
if (sa == ScopeAction.Close && m_iOpenScopeCount <= 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_UnmatchingSymScope"));
+ throw new ArgumentException(SR.Argument_UnmatchingSymScope);
}
Contract.EndContractBlock();
if (methodBuilder.IsTypeCreated())
{
// cannot change method after its containing type has been created
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TypeHasBeenCreated"));
+ throw new InvalidOperationException(SR.InvalidOperation_TypeHasBeenCreated);
}
// set the name and range of offset for the local
if (dynMod.GetSymWriter() == null)
{
// cannot set local name if not debug module
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotADebugModule"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotADebugModule);
}
sigHelp = SignatureHelper.GetFieldSigHelper(dynMod);
throw new ArgumentNullException(nameof(name));
if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
if (name[0] == '\0')
- throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), nameof(name));
+ throw new ArgumentException(SR.Argument_IllegalName, nameof(name));
if (mod == null)
throw new ArgumentNullException(nameof(mod));
else if ((attributes & MethodAttributes.Virtual) != 0)
{
// A method can't be both static and virtual
- throw new ArgumentException(Environment.GetResourceString("Arg_NoStaticVirtual"));
+ throw new ArgumentException(SR.Arg_NoStaticVirtual);
}
if ((attributes & MethodAttributes.SpecialName) != MethodAttributes.SpecialName)
if ((attributes & (MethodAttributes.Abstract | MethodAttributes.Virtual)) !=
(MethodAttributes.Abstract | MethodAttributes.Virtual) &&
(attributes & MethodAttributes.Static) == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadAttributeOnInterfaceMethod"));
+ throw new ArgumentException(SR.Argument_BadAttributeOnInterfaceMethod);
}
}
if (m_bIsBaked)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MethodHasBody"));
+ throw new InvalidOperationException(SR.InvalidOperation_MethodHasBody);
}
if (il.m_methodBuilder != this && il.m_methodBuilder != null)
// through MethodBuilder::GetILGenerator.
//
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadILGeneratorUsage"));
+ throw new InvalidOperationException(SR.InvalidOperation_BadILGeneratorUsage);
}
ThrowIfShouldNotHaveBody();
if (il.m_ScopeTree.m_iOpenScopeCount != 0)
{
// There are still unclosed local scope
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_OpenLocalVariableScope"));
+ throw new InvalidOperationException(SR.InvalidOperation_OpenLocalVariableScope);
}
#region MethodBase Overrides
public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override MethodImplAttributes GetMethodImplementationFlags()
public override RuntimeMethodHandle MethodHandle
{
- get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); }
+ get { throw new NotSupportedException(SR.NotSupported_DynamicModule); }
}
public override bool IsSecurityCritical
public override ParameterInfo[] GetParameters()
{
if (!m_bIsBaked || m_containingType == null || m_containingType.BakedRuntimeType == null)
- throw new NotSupportedException(Environment.GetResourceString("InvalidOperation_TypeNotCreated"));
+ throw new NotSupportedException(SR.InvalidOperation_TypeNotCreated);
MethodInfo rmi = m_containingType.GetMethod(m_strName, m_parameterTypes);
get
{
if (!m_bIsBaked || m_containingType == null || m_containingType.BakedRuntimeType == null)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TypeNotCreated"));
+ throw new InvalidOperationException(SR.InvalidOperation_TypeNotCreated);
MethodInfo rmi = m_containingType.GetMethod(m_strName, m_parameterTypes);
#region ICustomAttributeProvider Implementation
public override Object[] GetCustomAttributes(bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override Object[] GetCustomAttributes(Type attributeType, bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override bool IsDefined(Type attributeType, bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
#endregion
throw new ArgumentNullException(nameof(names));
if (names.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_EmptyArray"), nameof(names));
+ throw new ArgumentException(SR.Arg_EmptyArray, nameof(names));
Contract.EndContractBlock();
if (m_inst != null)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GenericParametersAlreadySet"));
+ throw new InvalidOperationException(SR.InvalidOperation_GenericParametersAlreadySet);
for (int i = 0; i < names.Length; i++)
if (names[i] == null)
throw new ArgumentNullException(nameof(names));
if (m_tkMethod.Token != 0)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MethodBuilderBaked"));
+ throw new InvalidOperationException(SR.InvalidOperation_MethodBuilderBaked);
m_bIsGenMethDef = true;
m_inst = new GenericTypeParameterBuilder[names.Length];
public ParameterBuilder DefineParameter(int position, ParameterAttributes attributes, String strParamName)
{
if (position < 0)
- throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_ParamSequence"));
+ throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_ParamSequence);
Contract.EndContractBlock();
ThrowIfGeneric();
m_containingType.ThrowIfCreated();
if (position > 0 && (m_parameterTypes == null || position > m_parameterTypes.Length))
- throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_ParamSequence"));
+ throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_ParamSequence);
attributes = attributes & ~ParameterAttributes.ReservedMask;
return new ParameterBuilder(this, position, attributes, strParamName);
{
// cannot attach method body if methodimpl is marked not marked as managed IL
//
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ShouldNotHaveMethodBody"));
+ throw new InvalidOperationException(SR.InvalidOperation_ShouldNotHaveMethodBody);
}
}
[Pure]
public override ParameterInfo[] GetParameters() { throw new NotSupportedException(); }
public override MethodImplAttributes GetMethodImplementationFlags() { return m_method.GetMethodImplementationFlags(); }
- public override RuntimeMethodHandle MethodHandle { get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } }
+ public override RuntimeMethodHandle MethodHandle { get { throw new NotSupportedException(SR.NotSupported_DynamicModule); } }
public override MethodAttributes Attributes { get { return m_method.Attributes; } }
public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
{
public override MethodInfo MakeGenericMethod(params Type[] arguments)
{
- throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericMethodDefinition"));
+ throw new InvalidOperationException(SR.Arg_NotGenericMethodDefinition);
}
public override bool IsGenericMethod { get { return true; } }
object.ReferenceEquals(foundType.DeclaringType, enclosingType))
{
// Cannot have two types with the same name
- throw new ArgumentException(Environment.GetResourceString("Argument_DuplicateTypeName"));
+ throw new ArgumentException(SR.Argument_DuplicateTypeName);
}
}
// go through the slower code path, i.e. retrieve parameters and form signature helper.
ParameterInfo[] parameters = con.GetParameters();
if (parameters == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidConstructorInfo"));
+ throw new ArgumentException(SR.Argument_InvalidConstructorInfo);
Type[] parameterTypes = new Type[parameters.Length];
Type[][] requiredCustomModifiers = new Type[parameters.Length][];
for (int i = 0; i < parameters.Length; i++)
{
if (parameters[i] == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidConstructorInfo"));
+ throw new ArgumentException(SR.Argument_InvalidConstructorInfo);
parameterTypes[i] = parameters[i].ParameterType;
requiredCustomModifiers[i] = parameters[i].GetRequiredCustomModifiers();
if ((method.CallingConvention & CallingConventions.VarArgs) == 0)
{
// Client should not supply optional parameter in default calling convention
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAVarArgCallingConvention"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention);
}
}
Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
{
if (m_moduleData.m_fGlobalBeenCreated == true)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GlobalsHaveBeenCreated"));
+ throw new InvalidOperationException(SR.InvalidOperation_GlobalsHaveBeenCreated);
if (name == null)
throw new ArgumentNullException(nameof(name));
if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
if ((attributes & MethodAttributes.Static) == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_GlobalFunctionHasToBeStatic"));
+ throw new ArgumentException(SR.Argument_GlobalFunctionHasToBeStatic);
Contract.Ensures(Contract.Result<MethodBuilder>() != null);
Contract.EndContractBlock();
if (m_moduleData.m_fGlobalBeenCreated)
{
// cannot create globals twice
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotADebugModule"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotADebugModule);
}
m_moduleData.m_globalTypeBuilder.CreateType();
m_moduleData.m_fGlobalBeenCreated = true;
// will be the signature for the Field.
if (m_moduleData.m_fGlobalBeenCreated == true)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GlobalsHaveBeenCreated"));
+ throw new InvalidOperationException(SR.InvalidOperation_GlobalsHaveBeenCreated);
}
Contract.Ensures(Contract.Result<FieldBuilder>() != null);
Contract.EndContractBlock();
if (m_moduleData.m_fGlobalBeenCreated == true)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GlobalsHaveBeenCreated"));
+ throw new InvalidOperationException(SR.InvalidOperation_GlobalsHaveBeenCreated);
}
Contract.Ensures(Contract.Result<FieldBuilder>() != null);
Contract.EndContractBlock();
// We should also be aware of multiple dynamic modules and multiple implementation of Type!!!
if (type.IsByRef)
- throw new ArgumentException(Environment.GetResourceString("Argument_CannotGetTypeTokenForByRef"));
+ throw new ArgumentException(SR.Argument_CannotGetTypeTokenForByRef);
if ((type.IsGenericType && (!type.IsGenericTypeDefinition || !getGenericDefinition)) ||
type.IsGenericParameter ||
return new MethodToken(methodToken);
if (method.DeclaringType == null)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotImportGlobalFromDifferentModule"));
+ throw new InvalidOperationException(SR.InvalidOperation_CannotImportGlobalFromDifferentModule);
// method is defined in a different module
tr = getGenericTypeDefinition ? GetTypeToken(method.DeclaringType).Token : GetTypeTokenInternal(method.DeclaringType).Token;
// We need to get the TypeRef tokens
if (declaringType == null)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotImportGlobalFromDifferentModule"));
+ throw new InvalidOperationException(SR.InvalidOperation_CannotImportGlobalFromDifferentModule);
RuntimeMethodInfo rtMeth = null;
throw new ArgumentNullException(nameof(methodName));
if (methodName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(methodName));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(methodName));
if (arrayClass.IsArray == false)
- throw new ArgumentException(Environment.GetResourceString("Argument_HasToBeArrayClass"));
+ throw new ArgumentException(SR.Argument_HasToBeArrayClass);
Contract.EndContractBlock();
CheckContext(returnType, arrayClass);
// field is defined in a different module
if (field.DeclaringType == null)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotImportGlobalFromDifferentModule"));
+ throw new InvalidOperationException(SR.InvalidOperation_CannotImportGlobalFromDifferentModule);
}
tr = GetTypeTokenInternal(field.DeclaringType).Token;
mr = GetMemberRef(field.ReflectedType.Module, tr, fdBuilder.GetToken().Token);
// We need to get the TypeRef tokens
if (field.DeclaringType == null)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotImportGlobalFromDifferentModule"));
+ throw new InvalidOperationException(SR.InvalidOperation_CannotImportGlobalFromDifferentModule);
}
if (field.DeclaringType != null && field.DeclaringType.IsGenericType)
if (m_iSymWriter == null)
{
// Cannot DefineDocument when it is not a debug module
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotADebugModule"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotADebugModule);
}
return m_iSymWriter.DefineDocument(url, language, languageVendor, documentType);
if (strExtension == null || strExtension == String.Empty)
{
// This is required by our loader. It cannot load module file that does not have file extension.
- throw new ArgumentException(Environment.GetResourceString("Argument_NoModuleFileExtension", strFileName));
+ throw new ArgumentException(SR.Format(SR.Argument_NoModuleFileExtension, strFileName));
}
m_strFileName = strFileName;
}
if (name == null)
throw new ArgumentNullException(nameof(name));
if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
if (name[0] == '\0')
- throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), nameof(name));
+ throw new ArgumentException(SR.Argument_IllegalName, nameof(name));
Contract.EndContractBlock();
m_name = name;
// Not supported functions in dynamic module.
public override Object GetValue(Object obj, Object[] index)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override Object GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override void SetValue(Object obj, Object value, Object[] index)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override void SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override MethodInfo[] GetAccessors(bool nonPublic)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override MethodInfo GetGetMethod(bool nonPublic)
public override ParameterInfo[] GetIndexParameters()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override Type PropertyType
public override Object[] GetCustomAttributes(bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override Object[] GetCustomAttributes(Type attributeType, bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override bool IsDefined(Type attributeType, bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override String Name
}
else
{
- throw new ArgumentException(Environment.GetResourceString("Argument_UnknownUnmanagedCallConv"), nameof(unmanagedCallConv));
+ throw new ArgumentException(SR.Argument_UnknownUnmanagedCallConv, nameof(unmanagedCallConv));
}
sigHelp = new SignatureHelper(mod, intCall, returnType, null, null);
Init(mod, callingConvention, cGenericParameters);
if (callingConvention == MdSigCallingConvention.Field)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldSig"));
+ throw new ArgumentException(SR.Argument_BadFieldSig);
AddOneArgTypeHelper(returnType, requiredCustomModifiers, optionalCustomModifiers);
}
m_sizeLoc = NO_SIZE_IN_SIG;
if (m_module == null && mod != null)
- throw new ArgumentException(Environment.GetResourceString("NotSupported_MustBeModuleBuilder"));
+ throw new ArgumentException(SR.NotSupported_MustBeModuleBuilder);
}
private void Init(Module mod, MdSigCallingConvention callingConvention)
throw new ArgumentNullException(nameof(optionalCustomModifiers));
if (t.HasElementType)
- throw new ArgumentException(Environment.GetResourceString("Argument_ArraysInvalid"), nameof(optionalCustomModifiers));
+ throw new ArgumentException(SR.Argument_ArraysInvalid, nameof(optionalCustomModifiers));
if (t.ContainsGenericParameters)
- throw new ArgumentException(Environment.GetResourceString("Argument_GenericsInvalid"), nameof(optionalCustomModifiers));
+ throw new ArgumentException(SR.Argument_GenericsInvalid, nameof(optionalCustomModifiers));
AddElementType(CorElementType.CModOpt);
throw new ArgumentNullException(nameof(requiredCustomModifiers));
if (t.HasElementType)
- throw new ArgumentException(Environment.GetResourceString("Argument_ArraysInvalid"), nameof(requiredCustomModifiers));
+ throw new ArgumentException(SR.Argument_ArraysInvalid, nameof(requiredCustomModifiers));
if (t.ContainsGenericParameters)
- throw new ArgumentException(Environment.GetResourceString("Argument_GenericsInvalid"), nameof(requiredCustomModifiers));
+ throw new ArgumentException(SR.Argument_GenericsInvalid, nameof(requiredCustomModifiers));
AddElementType(CorElementType.CModReqd);
}
else
{
- throw new ArgumentException(Environment.GetResourceString("Argument_LargeInteger"));
+ throw new ArgumentException(SR.Argument_LargeInteger);
}
}
if (rid > 0x3FFFFFF)
{
// token is too big to be compressed
- throw new ArgumentException(Environment.GetResourceString("Argument_LargeInteger"));
+ throw new ArgumentException(SR.Argument_LargeInteger);
}
rid = (rid << 2);
temp[sigCopyIndex++] = (byte)((argCount) & 0xFF);
}
else
- throw new ArgumentException(Environment.GetResourceString("Argument_LargeInteger"));
+ throw new ArgumentException(SR.Argument_LargeInteger);
// copy the sig part of the sig
Buffer.BlockCopy(m_signature, 2, temp, sigCopyIndex, currSigLength - 2);
// mark the end of sig
public void AddArguments(Type[] arguments, Type[][] requiredCustomModifiers, Type[][] optionalCustomModifiers)
{
if (requiredCustomModifiers != null && (arguments == null || requiredCustomModifiers.Length != arguments.Length))
- throw new ArgumentException(Environment.GetResourceString("Argument_MismatchedArrays", nameof(requiredCustomModifiers), nameof(arguments)));
+ throw new ArgumentException(SR.Format(SR.Argument_MismatchedArrays, nameof(requiredCustomModifiers), nameof(arguments)));
if (optionalCustomModifiers != null && (arguments == null || optionalCustomModifiers.Length != arguments.Length))
- throw new ArgumentException(Environment.GetResourceString("Argument_MismatchedArrays", nameof(optionalCustomModifiers), nameof(arguments)));
+ throw new ArgumentException(SR.Format(SR.Argument_MismatchedArrays, nameof(optionalCustomModifiers), nameof(arguments)));
if (arguments != null)
{
public void AddArgument(Type argument, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers)
{
if (m_sigDone)
- throw new ArgumentException(Environment.GetResourceString("Argument_SigIsFinalized"));
+ throw new ArgumentException(SR.Argument_SigIsFinalized);
if (argument == null)
throw new ArgumentNullException(nameof(argument));
[Pure]
public override ParameterInfo[] GetParameters()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod"));
+ throw new NotSupportedException(SR.NotSupported_SymbolMethod);
}
public override MethodImplAttributes GetMethodImplementationFlags()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod"));
+ throw new NotSupportedException(SR.NotSupported_SymbolMethod);
}
public override MethodAttributes Attributes
{
- get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod")); }
+ get { throw new NotSupportedException(SR.NotSupported_SymbolMethod); }
}
public override CallingConventions CallingConvention
public override RuntimeMethodHandle MethodHandle
{
- get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod")); }
+ get { throw new NotSupportedException(SR.NotSupported_SymbolMethod); }
}
#endregion
public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod"));
+ throw new NotSupportedException(SR.NotSupported_SymbolMethod);
}
public override MethodInfo GetBaseDefinition()
#region ICustomAttributeProvider Implementation
public override Object[] GetCustomAttributes(bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod"));
+ throw new NotSupportedException(SR.NotSupported_SymbolMethod);
}
public override Object[] GetCustomAttributes(Type attributeType, bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod"));
+ throw new NotSupportedException(SR.NotSupported_SymbolMethod);
}
public override bool IsDefined(Type attributeType, bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod"));
+ throw new NotSupportedException(SR.NotSupported_SymbolMethod);
}
#endregion
if (curIndex != format.Length)
// ByRef has to be the last char!!
- throw new ArgumentException(Environment.GetResourceString("Argument_BadSigFormat"));
+ throw new ArgumentException(SR.Argument_BadSigFormat);
symbolType.SetElementType(baseType);
return symbolType;
if (format[curIndex] != '.')
{
// bad format!! Throw exception
- throw new ArgumentException(Environment.GetResourceString("Argument_BadSigFormat"));
+ throw new ArgumentException(SR.Argument_BadSigFormat);
}
curIndex++;
{
// User specified upper bound less than lower bound, this is an error.
// Throw error exception.
- throw new ArgumentException(Environment.GetResourceString("Argument_BadSigFormat"));
+ throw new ArgumentException(SR.Argument_BadSigFormat);
}
}
}
}
else if (format[curIndex] != ']')
{
- throw new ArgumentException(Environment.GetResourceString("Argument_BadSigFormat"));
+ throw new ArgumentException(SR.Argument_BadSigFormat);
}
}
public override int GetArrayRank()
{
if (!IsArray)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_SubclassOverride"));
+ throw new NotSupportedException(SR.NotSupported_SubclassOverride);
Contract.EndContractBlock();
return m_cRank;
public override Guid GUID
{
- get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); }
+ get { throw new NotSupportedException(SR.NotSupported_NonReflectedType); }
}
public override Object InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target,
Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override Module Module
public override RuntimeTypeHandle TypeHandle
{
- get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); }
+ get { throw new NotSupportedException(SR.NotSupported_NonReflectedType); }
}
public override String Name
protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder,
CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
protected override MethodInfo GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder,
CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override FieldInfo GetField(String name, BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override FieldInfo[] GetFields(BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override Type GetInterface(String name, bool ignoreCase)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override Type[] GetInterfaces()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override EventInfo GetEvent(String name, BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override EventInfo[] GetEvents()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
protected override PropertyInfo GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder,
Type returnType, Type[] types, ParameterModifier[] modifiers)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override Type[] GetNestedTypes(BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override Type GetNestedType(String name, BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override MemberInfo[] GetMember(String name, MemberTypes type, BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override InterfaceMapping GetInterfaceMap(Type interfaceType)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override EventInfo[] GetEvents(BindingFlags bindingAttr)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
protected override TypeAttributes GetAttributeFlagsImpl()
public override Object[] GetCustomAttributes(bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override Object[] GetCustomAttributes(Type attributeType, bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
public override bool IsDefined(Type attributeType, bool inherit)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType"));
+ throw new NotSupportedException(SR.NotSupported_NonReflectedType);
}
#endregion
}
public static MethodInfo GetMethod(Type type, MethodInfo method)
{
if (!(type is TypeBuilder) && !(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeTypeBuilder"));
+ throw new ArgumentException(SR.Argument_MustBeTypeBuilder);
// The following checks establishes invariants that more simply put require type to be generic and
// method to be a generic method definition declared on the generic type definition of type.
// if we wanted to but that just complicates things so these checks are designed to prevent that scenario.
if (method.IsGenericMethod && !method.IsGenericMethodDefinition)
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedGenericMethodDefinition"), nameof(method));
+ throw new ArgumentException(SR.Argument_NeedGenericMethodDefinition, nameof(method));
if (method.DeclaringType == null || !method.DeclaringType.IsGenericTypeDefinition)
- throw new ArgumentException(Environment.GetResourceString("Argument_MethodNeedGenericDeclaringType"), nameof(method));
+ throw new ArgumentException(SR.Argument_MethodNeedGenericDeclaringType, nameof(method));
if (type.GetGenericTypeDefinition() != method.DeclaringType)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidMethodDeclaringType"), nameof(type));
+ throw new ArgumentException(SR.Argument_InvalidMethodDeclaringType, nameof(type));
Contract.EndContractBlock();
// The following converts from Type or TypeBuilder of G<T> to TypeBuilderInstantiation G<T>. These types
type = type.MakeGenericType(type.GetGenericArguments());
if (!(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(type));
+ throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(type));
return MethodOnTypeBuilderInstantiation.GetMethod(method, type as TypeBuilderInstantiation);
}
public static ConstructorInfo GetConstructor(Type type, ConstructorInfo constructor)
{
if (!(type is TypeBuilder) && !(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeTypeBuilder"));
+ throw new ArgumentException(SR.Argument_MustBeTypeBuilder);
if (!constructor.DeclaringType.IsGenericTypeDefinition)
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstructorNeedGenericDeclaringType"), nameof(constructor));
+ throw new ArgumentException(SR.Argument_ConstructorNeedGenericDeclaringType, nameof(constructor));
Contract.EndContractBlock();
if (!(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(type));
+ throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(type));
// TypeBuilder G<T> ==> TypeBuilderInstantiation G<T>
if (type is TypeBuilder && type.IsGenericTypeDefinition)
type = type.MakeGenericType(type.GetGenericArguments());
if (type.GetGenericTypeDefinition() != constructor.DeclaringType)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidConstructorDeclaringType"), nameof(type));
+ throw new ArgumentException(SR.Argument_InvalidConstructorDeclaringType, nameof(type));
return ConstructorOnTypeBuilderInstantiation.GetConstructor(constructor, type as TypeBuilderInstantiation);
}
public static FieldInfo GetField(Type type, FieldInfo field)
{
if (!(type is TypeBuilder) && !(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeTypeBuilder"));
+ throw new ArgumentException(SR.Argument_MustBeTypeBuilder);
if (!field.DeclaringType.IsGenericTypeDefinition)
- throw new ArgumentException(Environment.GetResourceString("Argument_FieldNeedGenericDeclaringType"), nameof(field));
+ throw new ArgumentException(SR.Argument_FieldNeedGenericDeclaringType, nameof(field));
Contract.EndContractBlock();
if (!(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(type));
+ throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(type));
// TypeBuilder G<T> ==> TypeBuilderInstantiation G<T>
if (type is TypeBuilder && type.IsGenericTypeDefinition)
type = type.MakeGenericType(type.GetGenericArguments());
if (type.GetGenericTypeDefinition() != field.DeclaringType)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFieldDeclaringType"), nameof(type));
+ throw new ArgumentException(SR.Argument_InvalidFieldDeclaringType, nameof(type));
return FieldOnTypeBuilderInstantiation.GetField(field, type as TypeBuilderInstantiation);
}
// The constant value supplied should match either the baked enum type or its underlying type
// we don't need to compare it with the EnumBuilder itself because you can never have an object of that type
if (type != enumBldr.m_typeBuilder.m_bakedRuntimeType && type != underlyingType)
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch"));
+ throw new ArgumentException(SR.Argument_ConstantDoesntMatch);
}
else if ((typeBldr = destType as TypeBuilder) != null)
{
// The constant value supplied should match either the baked enum type or its underlying type
// typeBldr.m_enumUnderlyingType is null if the user hasn't created a "value__" field on the enum
if (underlyingType == null || (type != typeBldr.UnderlyingSystemType && type != underlyingType))
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch"));
+ throw new ArgumentException(SR.Argument_ConstantDoesntMatch);
}
else // must be a runtime Enum Type
{
// The constant value supplied should match either the enum itself or its underlying type
if (type != destType && type != underlyingType)
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch"));
+ throw new ArgumentException(SR.Argument_ConstantDoesntMatch);
}
type = underlyingType;
{
// Note that it is non CLS compliant if destType != type. But RefEmit never guarantees CLS-Compliance.
if (!destType.IsAssignableFrom(type))
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch"));
+ throw new ArgumentException(SR.Argument_ConstantDoesntMatch);
}
CorElementType corType = RuntimeTypeHandle.GetCorElementType((RuntimeType)type);
}
else
{
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantNotSupported", type.ToString()));
+ throw new ArgumentException(SR.Format(SR.Argument_ConstantNotSupported, type.ToString()));
}
break;
}
{
// nullable types can hold null value.
if (!(destType.IsGenericType && destType.GetGenericTypeDefinition() == typeof(Nullable<>)))
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantNull"));
+ throw new ArgumentException(SR.Argument_ConstantNull);
}
SetConstantValue(module.GetNativeHandle(), tk, (int)CorElementType.Class, null);
throw new ArgumentNullException(nameof(fullname));
if (fullname.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(fullname));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(fullname));
if (fullname[0] == '\0')
- throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), nameof(fullname));
+ throw new ArgumentException(SR.Argument_IllegalName, nameof(fullname));
if (fullname.Length > 1023)
- throw new ArgumentException(Environment.GetResourceString("Argument_TypeNameTooLong"), nameof(fullname));
+ throw new ArgumentException(SR.Argument_TypeNameTooLong, nameof(fullname));
Contract.EndContractBlock();
int i;
// Nested Type should have nested attribute set.
// If we are renumbering TypeAttributes' bit, we need to change the logic here.
if (((attr & TypeAttributes.VisibilityMask) == TypeAttributes.Public) || ((attr & TypeAttributes.VisibilityMask) == TypeAttributes.NotPublic))
- throw new ArgumentException(Environment.GetResourceString("Argument_BadNestedTypeFlags"), nameof(attr));
+ throw new ArgumentException(SR.Argument_BadNestedTypeFlags, nameof(attr));
}
int[] interfaceTokens = null;
throw new ArgumentNullException(nameof(name));
if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
if (size <= 0 || size >= 0x003f0000)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadSizeForData"));
+ throw new ArgumentException(SR.Argument_BadSizeForData);
Contract.EndContractBlock();
ThrowIfCreated();
// Not a nested class.
if (((attr & TypeAttributes.VisibilityMask) != TypeAttributes.NotPublic) && ((attr & TypeAttributes.VisibilityMask) != TypeAttributes.Public))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeAttrNestedVisibilityOnNonNestedType"));
+ throw new ArgumentException(SR.Argument_BadTypeAttrNestedVisibilityOnNonNestedType);
}
}
else
// Nested class.
if (((attr & TypeAttributes.VisibilityMask) == TypeAttributes.NotPublic) || ((attr & TypeAttributes.VisibilityMask) == TypeAttributes.Public))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeAttrNonNestedVisibilityNestedType"));
+ throw new ArgumentException(SR.Argument_BadTypeAttrNonNestedVisibilityNestedType);
}
}
// Verify that the layout mask is valid.
if (((attr & TypeAttributes.LayoutMask) != TypeAttributes.AutoLayout) && ((attr & TypeAttributes.LayoutMask) != TypeAttributes.SequentialLayout) && ((attr & TypeAttributes.LayoutMask) != TypeAttributes.ExplicitLayout))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeAttrInvalidLayout"));
+ throw new ArgumentException(SR.Argument_BadTypeAttrInvalidLayout);
}
// Check if the user attempted to set any reserved bits.
if ((attr & TypeAttributes.ReservedMask) != 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeAttrReservedBitsSet"));
+ throw new ArgumentException(SR.Argument_BadTypeAttrReservedBitsSet);
}
}
internal void ThrowIfCreated()
{
if (IsCreated())
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TypeHasBeenCreated"));
+ throw new InvalidOperationException(SR.InvalidOperation_TypeHasBeenCreated);
}
internal object SyncRoot
get
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GUID;
Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.InvokeMember(name, invokeAttr, binder, target, args, modifiers, culture, namedParameters);
public override RuntimeTypeHandle TypeHandle
{
- get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); }
+ get { throw new NotSupportedException(SR.NotSupported_DynamicModule); }
}
public override String FullName
CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetConstructor(bindingAttr, binder, callConvention, types, modifiers);
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetConstructors(bindingAttr);
CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
if (types == null)
public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetMethods(bindingAttr);
public override FieldInfo GetField(String name, BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetField(name, bindingAttr);
public override FieldInfo[] GetFields(BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetFields(bindingAttr);
public override Type GetInterface(String name, bool ignoreCase)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetInterface(name, ignoreCase);
public override EventInfo GetEvent(String name, BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetEvent(name, bindingAttr);
public override EventInfo[] GetEvents()
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetEvents();
protected override PropertyInfo GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder,
Type returnType, Type[] types, ParameterModifier[] modifiers)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetProperties(bindingAttr);
public override Type[] GetNestedTypes(BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetNestedTypes(bindingAttr);
public override Type GetNestedType(String name, BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetNestedType(name, bindingAttr);
public override MemberInfo[] GetMember(String name, MemberTypes type, BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetMember(name, type, bindingAttr);
public override InterfaceMapping GetInterfaceMap(Type interfaceType)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetInterfaceMap(interfaceType);
public override EventInfo[] GetEvents(BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetEvents(bindingAttr);
public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return m_bakedRuntimeType.GetMembers(bindingAttr);
public override Type GetElementType()
{
// You will never have to deal with a TypeBuilder if you are just referring to arrays.
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
}
protected override bool HasElementTypeImpl()
if (IsEnum)
{
if (m_enumUnderlyingType == null)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NoUnderlyingTypeOnEnum"));
+ throw new InvalidOperationException(SR.InvalidOperation_NoUnderlyingTypeOnEnum);
return m_enumUnderlyingType;
}
public override Object[] GetCustomAttributes(bool inherit)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
Contract.EndContractBlock();
return CustomAttribute.GetCustomAttributes(m_bakedRuntimeType, typeof(object) as RuntimeType, inherit);
public override Object[] GetCustomAttributes(Type attributeType, bool inherit)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
if (attributeType == null)
throw new ArgumentNullException(nameof(attributeType));
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(m_bakedRuntimeType, attributeRuntimeType, inherit);
}
public override bool IsDefined(Type attributeType, bool inherit)
{
if (!IsCreated())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated"));
+ throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
if (attributeType == null)
throw new ArgumentNullException(nameof(attributeType));
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(m_bakedRuntimeType, attributeRuntimeType, inherit);
}
if (!object.ReferenceEquals(methodInfoBody.DeclaringType, this))
// Loader restriction: body method has to be from this class
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_BadMethodImplBody"));
+ throw new ArgumentException(SR.ArgumentException_BadMethodImplBody);
MethodToken tkBody;
MethodToken tkDecl;
throw new ArgumentNullException(nameof(name));
if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
Contract.Ensures(Contract.Result<MethodBuilder>() != null);
Contract.EndContractBlock();
if (parameterTypes != null)
{
if (parameterTypeOptionalCustomModifiers != null && parameterTypeOptionalCustomModifiers.Length != parameterTypes.Length)
- throw new ArgumentException(Environment.GetResourceString("Argument_MismatchedArrays", nameof(parameterTypeOptionalCustomModifiers), nameof(parameterTypes)));
+ throw new ArgumentException(SR.Format(SR.Argument_MismatchedArrays, nameof(parameterTypeOptionalCustomModifiers), nameof(parameterTypes)));
if (parameterTypeRequiredCustomModifiers != null && parameterTypeRequiredCustomModifiers.Length != parameterTypes.Length)
- throw new ArgumentException(Environment.GetResourceString("Argument_MismatchedArrays", nameof(parameterTypeRequiredCustomModifiers), nameof(parameterTypes)));
+ throw new ArgumentException(SR.Format(SR.Argument_MismatchedArrays, nameof(parameterTypeRequiredCustomModifiers), nameof(parameterTypes)));
}
ThrowIfCreated();
{
if (((m_iAttr & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface) &&
(attributes & MethodAttributes.Abstract) == 0 && (attributes & MethodAttributes.Static) == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadAttributeOnInterfaceMethod"));
+ throw new ArgumentException(SR.Argument_BadAttributeOnInterfaceMethod);
}
// pass in Method attributes
{
if ((m_iAttr & TypeAttributes.Interface) == TypeAttributes.Interface)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ConstructorNotAllowedOnInterface"));
+ throw new InvalidOperationException(SR.InvalidOperation_ConstructorNotAllowedOnInterface);
}
lock (SyncRoot)
genericTypeDefinition = ((TypeBuilder)genericTypeDefinition).m_bakedRuntimeType;
if (genericTypeDefinition == null)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule"));
+ throw new NotSupportedException(SR.NotSupported_DynamicModule);
Type inst = genericTypeDefinition.MakeGenericType(m_typeParent.GetGenericArguments());
}
if (con == null)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NoParentDefaultConstructor"));
+ throw new NotSupportedException(SR.NotSupported_NoParentDefaultConstructor);
// Define the constructor Builder
constBuilder = DefineConstructor(attributes, CallingConventions.Standard, null);
{
if ((m_iAttr & TypeAttributes.Interface) == TypeAttributes.Interface && (attributes & MethodAttributes.Static) != MethodAttributes.Static)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ConstructorNotAllowedOnInterface"));
+ throw new InvalidOperationException(SR.InvalidOperation_ConstructorNotAllowedOnInterface);
}
lock (SyncRoot)
if (name == null)
throw new ArgumentNullException(nameof(name));
if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
Contract.EndContractBlock();
CheckContext(returnType);
if (name == null)
throw new ArgumentNullException(nameof(name));
if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
if (name[0] == '\0')
- throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), nameof(name));
+ throw new ArgumentException(SR.Argument_IllegalName, nameof(name));
Contract.EndContractBlock();
int tkType;
// Check that they haven't declared an abstract method on a non-abstract class
if (((methodAttrs & MethodAttributes.Abstract) != 0) && ((m_iAttr & TypeAttributes.Abstract) == 0))
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadTypeAttributesNotAbstract"));
+ throw new InvalidOperationException(SR.InvalidOperation_BadTypeAttributesNotAbstract);
}
body = meth.GetBody();
//((m_iAttr & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface))
if (body != null)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadMethodBody"));
+ throw new InvalidOperationException(SR.InvalidOperation_BadMethodBody);
}
else if (body == null || body.Length == 0)
{
if ((body == null || body.Length == 0) && !meth.m_canBeRuntimeImpl)
throw new InvalidOperationException(
- Environment.GetResourceString("InvalidOperation_BadEmptyMethodBody", meth.Name));
+ SR.Format(SR.InvalidOperation_BadEmptyMethodBody, meth.Name));
}
int maxStack = meth.GetMaxStack();
CheckContext(parent);
if (parent.IsInterface)
- throw new ArgumentException(Environment.GetResourceString("Argument_CannotSetParentToInterface"));
+ throw new ArgumentException(SR.Argument_CannotSetParentToInterface);
m_typeParent = parent;
}
else
{
if ((m_iAttr & TypeAttributes.Abstract) == 0)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadInterfaceNotAbstract"));
+ throw new InvalidOperationException(SR.InvalidOperation_BadInterfaceNotAbstract);
// there is no extends for interface class
m_typeParent = null;
}
public override MethodBase DeclaringMethod { get { return null; } }
public override Type GetGenericTypeDefinition() { return m_type; }
- public override Type MakeGenericType(params Type[] inst) { throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericTypeDefinition")); }
+ public override Type MakeGenericType(params Type[] inst) { throw new InvalidOperationException(SR.Arg_NotGenericTypeDefinition); }
public override bool IsAssignableFrom(Type c) { throw new NotSupportedException(); }
[Pure]
public override MethodInfo MakeGenericMethod(params Type[] typeArgs)
{
if (!IsGenericMethodDefinition)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericMethodDefinition"));
+ throw new InvalidOperationException(SR.Arg_NotGenericMethodDefinition);
Contract.EndContractBlock();
return MethodBuilderInstantiation.MakeGenericMethod(this, typeArgs);
public static FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle)
{
if (handle.IsNullHandle())
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle"), nameof(handle));
+ throw new ArgumentException(SR.Argument_InvalidHandle, nameof(handle));
FieldInfo f = RuntimeType.GetFieldInfo(handle.GetRuntimeFieldInfo());
Type declaringType = f.DeclaringType;
if (declaringType != null && declaringType.IsGenericType)
throw new ArgumentException(String.Format(
- CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_FieldDeclaringTypeGeneric"),
+ CultureInfo.CurrentCulture, SR.Argument_FieldDeclaringTypeGeneric,
f.Name, declaringType.GetGenericTypeDefinition()));
return f;
public static FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle, RuntimeTypeHandle declaringType)
{
if (handle.IsNullHandle())
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle"));
+ throw new ArgumentException(SR.Argument_InvalidHandle);
return RuntimeType.GetFieldInfo(declaringType.GetRuntimeType(), handle.GetRuntimeFieldInfo());
}
public class InvalidFilterCriteriaException : ApplicationException
{
public InvalidFilterCriteriaException()
- : base(Environment.GetResourceString("Arg_InvalidFilterCriteriaException"))
+ : base(SR.Arg_InvalidFilterCriteriaException)
{
SetErrorCode(__HResults.COR_E_INVALIDFILTERCRITERIA);
}
break;
default:
- throw new FormatException(Environment.GetResourceString("Arg_BadLiteralFormat"));
+ throw new FormatException(SR.Arg_BadLiteralFormat);
#endregion
}
break;
default:
- throw new FormatException(Environment.GetResourceString("Arg_BadLiteralFormat"));
+ throw new FormatException(SR.Arg_BadLiteralFormat);
#endregion
}
return null;
default:
- throw new FormatException(Environment.GetResourceString("Arg_BadLiteralFormat"));
+ throw new FormatException(SR.Arg_BadLiteralFormat);
#endregion
}
}
[Diagnostics.DebuggerHidden]
public override void SetValueDirect(TypedReference obj, Object value)
{
- throw new FieldAccessException(Environment.GetResourceString("Acc_ReadOnly"));
+ throw new FieldAccessException(SR.Acc_ReadOnly);
}
[DebuggerStepThroughAttribute]
Object value = MdConstant.GetValue(GetRuntimeModule().MetadataImport, m_tkField, FieldType.GetTypeHandleInternal(), raw);
if (value == DBNull.Value)
- throw new NotSupportedException(Environment.GetResourceString("Arg_EnumLitValueNotFound"));
+ throw new NotSupportedException(SR.Arg_EnumLitValueNotFound);
return value;
}
[Diagnostics.DebuggerHidden]
public override void SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
{
- throw new FieldAccessException(Environment.GetResourceString("Acc_ReadOnly"));
+ throw new FieldAccessException(SR.Acc_ReadOnly);
}
public override Type FieldType
String typeName = info.GetString("ClassName");
if (assemblyName == null || typeName == null)
- throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState"));
+ throw new SerializationException(SR.Serialization_InsufficientState);
Assembly assem = FormatterServices.LoadAssemblyFromString(assemblyName);
m_reflectedType = assem.GetType(typeName, true, false) as RuntimeType;
#region ISerializable
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_Method));
+ throw new NotSupportedException(SR.GetResourceString(ResId.NotSupported_Method));
}
#endregion
public virtual Object GetRealObject(StreamingContext context)
{
if (m_memberName == null || m_reflectedType == null || m_memberType == 0)
- throw new SerializationException(Environment.GetResourceString(ResId.Serialization_InsufficientState));
+ throw new SerializationException(SR.GetResourceString(ResId.Serialization_InsufficientState));
BindingFlags bindingFlags =
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic |
FieldInfo[] fields = m_reflectedType.GetMember(m_memberName, MemberTypes.Field, bindingFlags) as FieldInfo[];
if (fields.Length == 0)
- throw new SerializationException(Environment.GetResourceString("Serialization_UnknownMember", m_memberName));
+ throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, m_memberName));
return fields[0];
}
EventInfo[] events = m_reflectedType.GetMember(m_memberName, MemberTypes.Event, bindingFlags) as EventInfo[];
if (events.Length == 0)
- throw new SerializationException(Environment.GetResourceString("Serialization_UnknownMember", m_memberName));
+ throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, m_memberName));
return events[0];
}
PropertyInfo[] properties = m_reflectedType.GetMember(m_memberName, MemberTypes.Property, bindingFlags) as PropertyInfo[];
if (properties.Length == 0)
- throw new SerializationException(Environment.GetResourceString("Serialization_UnknownMember", m_memberName));
+ throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, m_memberName));
if (properties.Length == 1)
return properties[0];
}
}
- throw new SerializationException(Environment.GetResourceString(ResId.Serialization_UnknownMember, m_memberName));
+ throw new SerializationException(SR.Format(SR.GetResourceString(ResId.Serialization_UnknownMember), m_memberName));
}
#endregion
case MemberTypes.Constructor:
{
if (m_signature == null)
- throw new SerializationException(Environment.GetResourceString(ResId.Serialization_NullSignature));
+ throw new SerializationException(SR.GetResourceString(ResId.Serialization_NullSignature));
ConstructorInfo[] constructors = m_reflectedType.GetMember(m_memberName, MemberTypes.Constructor, bindingFlags) as ConstructorInfo[];
}
}
- throw new SerializationException(Environment.GetResourceString(ResId.Serialization_UnknownMember, m_memberName));
+ throw new SerializationException(SR.Format(SR.GetResourceString(ResId.Serialization_UnknownMember), m_memberName));
}
#endregion
MethodInfo methodInfo = null;
if (m_signature == null)
- throw new SerializationException(Environment.GetResourceString(ResId.Serialization_NullSignature));
+ throw new SerializationException(SR.GetResourceString(ResId.Serialization_NullSignature));
Type[] genericArguments = m_info.GetValueNoThrow("GenericArguments", typeof(Type[])) as Type[];
}
if (methodInfo == null)
- throw new SerializationException(Environment.GetResourceString(ResId.Serialization_UnknownMember, m_memberName));
+ throw new SerializationException(SR.Format(SR.GetResourceString(ResId.Serialization_UnknownMember), m_memberName));
if (!methodInfo.IsGenericMethodDefinition)
return methodInfo;
#endregion
default:
- throw new ArgumentException(Environment.GetResourceString("Serialization_MemberTypeNotRecognized"));
+ throw new ArgumentException(SR.Serialization_MemberTypeNotRecognized);
}
}
#endregion
public static MethodBase GetMethodFromHandle(RuntimeMethodHandle handle)
{
if (handle.IsNullHandle())
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle"));
+ throw new ArgumentException(SR.Argument_InvalidHandle);
MethodBase m = RuntimeType.GetMethodBase(handle.GetMethodInfo());
Type declaringType = m.DeclaringType;
if (declaringType != null && declaringType.IsGenericType)
throw new ArgumentException(String.Format(
- CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_MethodDeclaringTypeGeneric"),
+ CultureInfo.CurrentCulture, SR.Argument_MethodDeclaringTypeGeneric,
m, declaringType.GetGenericTypeDefinition()));
return m;
public static MethodBase GetMethodFromHandle(RuntimeMethodHandle handle, RuntimeTypeHandle declaringType)
{
if (handle.IsNullHandle())
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle"));
+ throw new ArgumentException(SR.Argument_InvalidHandle);
return RuntimeType.GetMethodBase(declaringType.GetRuntimeType(), handle.GetMethodInfo());
}
if (p == null)
p = GetParametersNoCopy();
if (p[i].DefaultValue == System.DBNull.Value)
- throw new ArgumentException(Environment.GetResourceString("Arg_VarMissNull"), nameof(parameters));
+ throw new ArgumentException(SR.Arg_VarMissNull, nameof(parameters));
arg = p[i].DefaultValue;
}
copyOfParameters[i] = argRT.CheckValue(arg, binder, culture, invokeAttr);
get
{
if (m_flags != ExceptionHandlingClauseOptions.Filter)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_EHClauseNotFilter"));
+ throw new InvalidOperationException(SR.Arg_EHClauseNotFilter);
return m_filterOffset;
}
get
{
if (m_flags != ExceptionHandlingClauseOptions.Clause)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_EHClauseNotClause"));
+ throw new InvalidOperationException(SR.Arg_EHClauseNotClause);
Type type = null;
public ParameterModifier(int parameterCount)
{
if (parameterCount <= 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_ParmArraySize"));
+ throw new ArgumentException(SR.Arg_ParmArraySize);
Contract.EndContractBlock();
_byRef = new bool[parameterCount];
if (type == null)
throw new ArgumentNullException(nameof(type));
if (!type.IsPointer)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBePointer"), nameof(ptr));
+ throw new ArgumentException(SR.Arg_MustBePointer, nameof(ptr));
Contract.EndContractBlock();
RuntimeType rt = type as RuntimeType;
if (rt == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBePointer"), nameof(ptr));
+ throw new ArgumentException(SR.Arg_MustBePointer, nameof(ptr));
Pointer x = new Pointer();
x._ptr = ptr;
public static unsafe void* Unbox(Object ptr)
{
if (!(ptr is Pointer))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBePointer"), nameof(ptr));
+ throw new ArgumentException(SR.Arg_MustBePointer, nameof(ptr));
return ((Pointer)ptr)._ptr;
}
// private constructor. This is not called.
private ReflectionTypeLoadException()
- : base(Environment.GetResourceString("ReflectionTypeLoad_LoadFailed"))
+ : base(SR.ReflectionTypeLoad_LoadFailed)
{
SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD);
}
{
if (target == null)
{
- throw new TargetException(Environment.GetResourceString("RFLCT.Targ_StatFldReqTarg"));
+ throw new TargetException(SR.RFLCT_Targ_StatFldReqTarg);
}
else
{
throw new ArgumentException(
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Arg_FieldDeclTarget"),
+ String.Format(CultureInfo.CurrentUICulture, SR.Arg_FieldDeclTarget,
Name, m_declaringType, target.GetType()));
}
}
if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NO_INVOKE) != 0)
{
if (declaringType != null && declaringType.ContainsGenericParameters)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_UnboundGenField"));
+ throw new InvalidOperationException(SR.Arg_UnboundGenField);
if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyField"));
+ throw new InvalidOperationException(SR.Arg_ReflectionOnlyField);
throw new FieldAccessException();
}
if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NO_INVOKE) != 0)
{
if (declaringType != null && DeclaringType.ContainsGenericParameters)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_UnboundGenField"));
+ throw new InvalidOperationException(SR.Arg_UnboundGenField);
if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyField"));
+ throw new InvalidOperationException(SR.Arg_ReflectionOnlyField);
throw new FieldAccessException();
}
public override Object GetValueDirect(TypedReference obj)
{
if (obj.IsNull)
- throw new ArgumentException(Environment.GetResourceString("Arg_TypedReference_Null"));
+ throw new ArgumentException(SR.Arg_TypedReference_Null);
Contract.EndContractBlock();
unsafe
public override void SetValueDirect(TypedReference obj, Object value)
{
if (obj.IsNull)
- throw new ArgumentException(Environment.GetResourceString("Arg_TypedReference_Null"));
+ throw new ArgumentException(SR.Arg_TypedReference_Null);
Contract.EndContractBlock();
unsafe
{
Type declaringType = DeclaringType;
if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInReflectionOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInReflectionOnly);
return new RuntimeFieldHandle(this);
}
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType);
}
if ((assemblyString.Length == 0) ||
(assemblyString[0] == '\0'))
- throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength"));
+ throw new ArgumentException(SR.Format_StringZeroLength);
if (forIntrospection)
AppDomain.CheckReflectionOnlyLoadSupported();
{
//Console.WriteLine("Creating an unmanaged memory stream of length "+length);
if (length > Int64.MaxValue)
- throw new NotImplementedException(Environment.GetResourceString("NotImplemented_ResourcesLongerThan2^63"));
+ throw new NotImplementedException(SR.NotImplemented_ResourcesLongerThanInt64Max);
return new UnmanagedMemoryStream(pbInMemoryResource, (long)length, (long)length, FileAccess.Read);
}
if (retAssembly == this || (retAssembly == null && throwOnFileNotFound))
{
- throw new FileNotFoundException(String.Format(culture, Environment.GetResourceString("IO.FileNotFound_FileName"), an.Name));
+ throw new FileNotFoundException(String.Format(culture, SR.IO_FileNotFound_FileName, an.Name));
}
return retAssembly;
if (!m_declaringType.IsInstanceOfType(target))
{
if (target == null)
- throw new TargetException(Environment.GetResourceString("RFLCT.Targ_StatMethReqTarg"));
+ throw new TargetException(SR.RFLCT_Targ_StatMethReqTarg);
- throw new TargetException(Environment.GetResourceString("RFLCT.Targ_ITargMismatch"));
+ throw new TargetException(SR.RFLCT_Targ_ITargMismatch);
}
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType);
}
{
Type declaringType = DeclaringType;
if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInReflectionOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInReflectionOnly);
return new RuntimeMethodHandle(this);
}
}
// ctor is ReflectOnly
if (declaringType is ReflectionOnlyType)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyInvoke"));
+ throw new InvalidOperationException(SR.Arg_ReflectionOnlyInvoke);
// ctor is declared on interface class
else if (declaringType.IsInterface)
throw new MemberAccessException(
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Acc_CreateInterfaceEx"), declaringType));
+ String.Format(CultureInfo.CurrentUICulture, SR.Acc_CreateInterfaceEx, declaringType));
// ctor is on an abstract class
else if (declaringType.IsAbstract)
throw new MemberAccessException(
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Acc_CreateAbstEx"), declaringType));
+ String.Format(CultureInfo.CurrentUICulture, SR.Acc_CreateAbstEx, declaringType));
// ctor is on a class that contains stack pointers
else if (declaringType.GetRootElementType() == typeof(ArgIterator))
else if (declaringType.ContainsGenericParameters)
{
throw new MemberAccessException(
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Acc_CreateGenericEx"), declaringType));
+ String.Format(CultureInfo.CurrentUICulture, SR.Acc_CreateGenericEx, declaringType));
}
// ctor is declared on System.Void
else if (declaringType == typeof(void))
- throw new MemberAccessException(Environment.GetResourceString("Access_Void"));
+ throw new MemberAccessException(SR.Access_Void);
}
internal void ThrowNoInvokeException()
// ctor is .cctor
if ((Attributes & MethodAttributes.Static) == MethodAttributes.Static)
- throw new MemberAccessException(Environment.GetResourceString("Acc_NotClassInit"));
+ throw new MemberAccessException(SR.Acc_NotClassInit);
throw new TargetException();
}
int formalCount = sig.Arguments.Length;
int actualCount = (parameters != null) ? parameters.Length : 0;
if (formalCount != actualCount)
- throw new TargetParameterCountException(Environment.GetResourceString("Arg_ParmCnt"));
+ throw new TargetParameterCountException(SR.Arg_ParmCnt);
// if we are here we passed all the previous checks. Time to look at the arguments
if (actualCount > 0)
int formalCount = sig.Arguments.Length;
int actualCount = (parameters != null) ? parameters.Length : 0;
if (formalCount != actualCount)
- throw new TargetParameterCountException(Environment.GetResourceString("Arg_ParmCnt"));
+ throw new TargetParameterCountException(SR.Arg_ParmCnt);
// We don't need to explicitly invoke the class constructor here,
// JIT/NGen will insert the call to .cctor in the instance ctor.
public override String ToString()
{
if (m_addMethod == null || m_addMethod.GetParametersNoCopy().Length == 0)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NoPublicAddMethod"));
+ throw new InvalidOperationException(SR.InvalidOperation_NoPublicAddMethod);
return m_addMethod.GetParametersNoCopy()[0].ParameterType.FormatTypeName() + " " + Name;
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType, inherit);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType, inherit);
}
{
Type declaringType = DeclaringType;
if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInReflectionOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInReflectionOnly);
return new RuntimeMethodHandle(this);
}
}
if (!m_declaringType.IsInstanceOfType(target))
{
if (target == null)
- throw new TargetException(Environment.GetResourceString("RFLCT.Targ_StatMethReqTarg"));
+ throw new TargetException(SR.RFLCT_Targ_StatMethReqTarg);
else
- throw new TargetException(Environment.GetResourceString("RFLCT.Targ_ITargMismatch"));
+ throw new TargetException(SR.RFLCT_Targ_ITargMismatch);
}
}
}
Type declaringType = DeclaringType;
if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType)
{
- throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyInvoke"));
+ throw new InvalidOperationException(SR.Arg_ReflectionOnlyInvoke);
}
// method is on a class that contains stack pointers
else if ((InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_CONTAINS_STACK_POINTERS) != 0)
// method is generic or on a generic class
else if (DeclaringType.ContainsGenericParameters || ContainsGenericParameters)
{
- throw new InvalidOperationException(Environment.GetResourceString("Arg_UnboundGenParam"));
+ throw new InvalidOperationException(SR.Arg_UnboundGenParam);
}
// method is abstract class
else if (IsAbstract)
// ByRef return are not allowed in reflection
else if (ReturnType.IsByRef)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ByRefReturn"));
+ throw new NotSupportedException(SR.NotSupported_ByRefReturn);
}
throw new TargetException();
CheckConsistency(obj);
if (formalCount != actualCount)
- throw new TargetParameterCountException(Environment.GetResourceString("Arg_ParmCnt"));
+ throw new TargetParameterCountException(SR.Arg_ParmCnt);
if (actualCount != 0)
return CheckArguments(parameters, binder, invokeAttr, culture, sig);
RuntimeType rtType = delegateType as RuntimeType;
if (rtType == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(delegateType));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(delegateType));
if (!rtType.IsDelegate())
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(delegateType));
+ throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(delegateType));
Delegate d = Delegate.CreateDelegateInternal(rtType, this, firstArgument, bindingFlags, ref stackMark);
if (d == null)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth"));
+ throw new ArgumentException(SR.Arg_DlgtTargMeth);
}
return d;
if (!IsGenericMethodDefinition)
throw new InvalidOperationException(
- Environment.GetResourceString("Arg_NotGenericMethodDefinition", this));
+ SR.Format(SR.Arg_NotGenericMethodDefinition, this));
for (int i = 0; i < methodInstantiation.Length; i++)
{
Contract.EndContractBlock();
if (m_reflectedTypeCache.IsGlobal)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_GlobalMethodSerialization"));
+ throw new NotSupportedException(SR.NotSupported_GlobalMethodSerialization);
MemberInfoSerializationHolder.GetSerializationInfo(
info,
{
Type typeArg = genericArguments[i];
if (typeArg == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidGenericInstArray"));
+ throw new ArgumentException(SR.Argument_InvalidGenericInstArray);
typeArg = typeArg.UnderlyingSystemType;
if (typeArg == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidGenericInstArray"));
+ throw new ArgumentException(SR.Argument_InvalidGenericInstArray);
if (!(typeArg is RuntimeType))
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidGenericInstArray"));
+ throw new ArgumentException(SR.Argument_InvalidGenericInstArray);
typeHandleArgs[i] = typeArg.GetTypeHandleInternal();
}
return typeHandleArgs;
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
- Environment.GetResourceString("Argument_InvalidToken", tk, this));
+ SR.Format(SR.Argument_InvalidToken, tk, this));
if (!tk.IsMemberRef && !tk.IsMethodDef && !tk.IsTypeSpec && !tk.IsSignature && !tk.IsFieldDef)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidToken", tk, this),
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidToken, tk, this),
nameof(metadataToken));
ConstArray signature;
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
- Environment.GetResourceString("Argument_InvalidToken", tk, this));
+ SR.Format(SR.Argument_InvalidToken, tk, this));
RuntimeTypeHandle[] typeArgs = ConvertToTypeHandleArray(genericTypeArguments);
RuntimeTypeHandle[] methodArgs = ConvertToTypeHandleArray(genericMethodArguments);
if (!tk.IsMethodDef && !tk.IsMethodSpec)
{
if (!tk.IsMemberRef)
- throw new ArgumentException(Environment.GetResourceString("Argument_ResolveMethod", tk, this),
+ throw new ArgumentException(SR.Format(SR.Argument_ResolveMethod, tk, this),
nameof(metadataToken));
unsafe
ConstArray sig = MetadataImport.GetMemberRefProps(tk);
if (*(MdSigCallingConvention*)sig.Signature.ToPointer() == MdSigCallingConvention.Field)
- throw new ArgumentException(Environment.GetResourceString("Argument_ResolveMethod", tk, this),
+ throw new ArgumentException(SR.Format(SR.Argument_ResolveMethod, tk, this),
nameof(metadataToken));
}
}
}
catch (BadImageFormatException e)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_BadImageFormatExceptionResolve"), e);
+ throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e);
}
}
if (!MetadataImport.IsValidToken(tk) || !tk.IsFieldDef)
throw new ArgumentOutOfRangeException(nameof(metadataToken),
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Argument_InvalidToken", tk, this)));
+ String.Format(CultureInfo.CurrentUICulture, SR.Format(SR.Argument_InvalidToken, tk, this)));
int tkDeclaringType;
string fieldName;
}
catch
{
- throw new ArgumentException(Environment.GetResourceString("Argument_ResolveField", tk, this), nameof(metadataToken));
+ throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this), nameof(metadataToken));
}
}
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
- Environment.GetResourceString("Argument_InvalidToken", tk, this));
+ SR.Format(SR.Argument_InvalidToken, tk, this));
RuntimeTypeHandle[] typeArgs = ConvertToTypeHandleArray(genericTypeArguments);
RuntimeTypeHandle[] methodArgs = ConvertToTypeHandleArray(genericMethodArguments);
if (!tk.IsFieldDef)
{
if (!tk.IsMemberRef)
- throw new ArgumentException(Environment.GetResourceString("Argument_ResolveField", tk, this),
+ throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this),
nameof(metadataToken));
unsafe
ConstArray sig = MetadataImport.GetMemberRefProps(tk);
if (*(MdSigCallingConvention*)sig.Signature.ToPointer() != MdSigCallingConvention.Field)
- throw new ArgumentException(Environment.GetResourceString("Argument_ResolveField", tk, this),
+ throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this),
nameof(metadataToken));
}
}
catch (BadImageFormatException e)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_BadImageFormatExceptionResolve"), e);
+ throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e);
}
}
MetadataToken tk = new MetadataToken(metadataToken);
if (tk.IsGlobalTypeDefToken)
- throw new ArgumentException(Environment.GetResourceString("Argument_ResolveModuleType", tk), nameof(metadataToken));
+ throw new ArgumentException(SR.Format(SR.Argument_ResolveModuleType, tk), nameof(metadataToken));
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
- Environment.GetResourceString("Argument_InvalidToken", tk, this));
+ SR.Format(SR.Argument_InvalidToken, tk, this));
if (!tk.IsTypeDef && !tk.IsTypeSpec && !tk.IsTypeRef)
- throw new ArgumentException(Environment.GetResourceString("Argument_ResolveType", tk, this), nameof(metadataToken));
+ throw new ArgumentException(SR.Format(SR.Argument_ResolveType, tk, this), nameof(metadataToken));
RuntimeTypeHandle[] typeArgs = ConvertToTypeHandleArray(genericTypeArguments);
RuntimeTypeHandle[] methodArgs = ConvertToTypeHandleArray(genericMethodArguments);
Type t = GetModuleHandleImpl().ResolveTypeHandle(metadataToken, typeArgs, methodArgs).GetRuntimeType();
if (t == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_ResolveType", tk, this), nameof(metadataToken));
+ throw new ArgumentException(SR.Format(SR.Argument_ResolveType, tk, this), nameof(metadataToken));
return t;
}
catch (BadImageFormatException e)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_BadImageFormatExceptionResolve"), e);
+ throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e);
}
}
MetadataToken tk = new MetadataToken(metadataToken);
if (tk.IsProperty)
- throw new ArgumentException(Environment.GetResourceString("InvalidOperation_PropertyInfoNotAvailable"));
+ throw new ArgumentException(SR.InvalidOperation_PropertyInfoNotAvailable);
if (tk.IsEvent)
- throw new ArgumentException(Environment.GetResourceString("InvalidOperation_EventInfoNotAvailable"));
+ throw new ArgumentException(SR.InvalidOperation_EventInfoNotAvailable);
if (tk.IsMethodSpec || tk.IsMethodDef)
return ResolveMethod(metadataToken, genericTypeArguments, genericMethodArguments);
{
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
- Environment.GetResourceString("Argument_InvalidToken", tk, this));
+ SR.Format(SR.Argument_InvalidToken, tk, this));
ConstArray sig = MetadataImport.GetMemberRefProps(tk);
}
}
- throw new ArgumentException(Environment.GetResourceString("Argument_ResolveMember", tk, this),
+ throw new ArgumentException(SR.Format(SR.Argument_ResolveMember, tk, this),
nameof(metadataToken));
}
MetadataToken tk = new MetadataToken(metadataToken);
if (!tk.IsString)
throw new ArgumentException(
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Argument_ResolveString"), metadataToken, ToString()));
+ String.Format(CultureInfo.CurrentUICulture, SR.Argument_ResolveString, metadataToken, ToString()));
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Argument_InvalidToken", tk, this)));
+ String.Format(CultureInfo.CurrentUICulture, SR.Format(SR.Argument_InvalidToken, tk, this)));
string str = MetadataImport.GetUserString(metadataToken);
if (str == null)
throw new ArgumentException(
- String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Argument_ResolveString"), metadataToken, ToString()));
+ String.Format(CultureInfo.CurrentUICulture, SR.Argument_ResolveString, metadataToken, ToString()));
return str;
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType);
}
// Not all parameters have tokens. Parameters may have no token
// if they have no name and no attributes.
if (cParamDefs > sigArgCount + 1 /* return type */)
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ParameterSignatureMismatch"));
+ throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch);
for (int i = 0; i < cParamDefs; i++)
{
{
// more than one return parameter?
if (returnParameter != null)
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ParameterSignatureMismatch"));
+ throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch);
returnParameter = new RuntimeParameterInfo(sig, scope, tkParamDef, position, attr, member);
}
{
// position beyong sigArgCount?
if (position >= sigArgCount)
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ParameterSignatureMismatch"));
+ throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch);
args[position] = new RuntimeParameterInfo(sig, scope, tkParamDef, position, attr, member);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType);
}
if (defaultValue == DBNull.Value)
// Arg_EnumLitValueNotFound -> "Literal value was not found."
- throw new InvalidOperationException(Environment.GetResourceString("Arg_EnumLitValueNotFound"));
+ throw new InvalidOperationException(SR.Arg_EnumLitValueNotFound);
return defaultValue;
}
{
MethodInfo m = GetGetMethod(true);
if (m == null)
- throw new ArgumentException(System.Environment.GetResourceString("Arg_GetMethNotFnd"));
+ throw new ArgumentException(System.SR.Arg_GetMethNotFnd);
return m.Invoke(obj, invokeAttr, binder, index, null);
}
MethodInfo m = GetSetMethod(true);
if (m == null)
- throw new ArgumentException(System.Environment.GetResourceString("Arg_SetMethNotFnd"));
+ throw new ArgumentException(System.SR.Arg_SetMethNotFnd);
Object[] args = null;
// This exception is not creatable without specifying the
// inner exception.
private TargetInvocationException()
- : base(Environment.GetResourceString("Arg_TargetInvocationException"))
+ : base(SR.Arg_TargetInvocationException)
{
SetErrorCode(__HResults.COR_E_TARGETINVOCATION);
}
}
public TargetInvocationException(System.Exception inner)
- : base(Environment.GetResourceString("Arg_TargetInvocationException"), inner)
+ : base(SR.Arg_TargetInvocationException, inner)
{
SetErrorCode(__HResults.COR_E_TARGETINVOCATION);
}
public sealed class TargetParameterCountException : ApplicationException
{
public TargetParameterCountException()
- : base(Environment.GetResourceString("Arg_TargetParameterCountException"))
+ : base(SR.Arg_TargetParameterCountException)
{
SetErrorCode(__HResults.COR_E_TARGETPARAMCOUNT);
}
{
// We really don't think this should happen - we always
// expect the neutral locale's resources to be present.
- throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_NoNeutralDisk") + Environment.NewLine + "baseName: " + _mediator.BaseNameField + " locationInfo: " + (_mediator.LocationInfo == null ? "<null>" : _mediator.LocationInfo.FullName) + " fileName: " + _mediator.GetResourceFileName(culture));
+ throw new MissingManifestResourceException(SR.MissingManifestResource_NoNeutralDisk + Environment.NewLine + "baseName: " + _mediator.BaseNameField + " locationInfo: " + (_mediator.LocationInfo == null ? "<null>" : _mediator.LocationInfo.FullName) + " fileName: " + _mediator.GetResourceFileName(culture));
}
}
}
}
catch (MissingMethodException e)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResMgrBadResSet_Type", _mediator.UserResourceSet.AssemblyQualifiedName), e);
+ throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResMgrBadResSet_Type, _mediator.UserResourceSet.AssemblyQualifiedName), e);
}
}
}
if (typeName == null)
throw new ArgumentNullException(nameof(typeName));
if (looselyLinkedResourceName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(looselyLinkedResourceName));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(looselyLinkedResourceName));
if (typeName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(typeName));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(typeName));
Contract.EndContractBlock();
_manifestResourceName = looselyLinkedResourceName;
Stream data = assembly.GetManifestResourceStream(_manifestResourceName);
if (data == null)
- throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_LooselyLinked", _manifestResourceName, assembly.FullName));
+ throw new MissingManifestResourceException(SR.Format(SR.MissingManifestResource_LooselyLinked, _manifestResourceName, assembly.FullName));
Type type = Type.GetType(_typeName, true);
{
if ((UltimateResourceFallbackLocation)fallback < UltimateResourceFallbackLocation.MainAssembly || (UltimateResourceFallbackLocation)fallback > UltimateResourceFallbackLocation.Satellite)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidNeutralResourcesLanguage_FallbackLoc", fallback));
+ throw new ArgumentException(SR.Format(SR.Arg_InvalidNeutralResourcesLanguage_FallbackLoc, fallback));
}
fallbackLocation = (UltimateResourceFallbackLocation)fallback;
}
return CultureInfo.InvariantCulture;
}
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidNeutralResourcesLanguage_Asm_Culture", a.ToString(), cultureName), e);
+ throw new ArgumentException(SR.Format(SR.Arg_InvalidNeutralResourcesLanguage_Asm_Culture, a.ToString(), cultureName), e);
}
}
// resMgrHeaderVersion is older than this ResMgr version.
// We should add in backwards compatibility support here.
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ObsoleteResourcesFile", _mediator.MainAssembly.GetSimpleName()));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_ObsoleteResourcesFile, _mediator.MainAssembly.GetSimpleName()));
}
store.Position = startPos;
}
catch (MissingMethodException e)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResMgrBadResSet_Type", _mediator.UserResourceSet.AssemblyQualifiedName), e);
+ throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResMgrBadResSet_Type, _mediator.UserResourceSet.AssemblyQualifiedName), e);
}
}
}
}
else
{
- throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_MultipleBlobs", givenName, satellite.ToString()));
+ throw new MissingManifestResourceException(SR.Format(SR.MissingManifestResource_MultipleBlobs, givenName, satellite.ToString()));
}
}
}
{
missingCultureName = "<invariant>";
}
- throw new MissingSatelliteAssemblyException(Environment.GetResourceString("MissingSatelliteAssembly_Culture_Name", _mediator.NeutralResourcesCulture, satAssemName), missingCultureName);
+ throw new MissingSatelliteAssemblyException(SR.Format(SR.MissingSatelliteAssembly_Culture_Name, _mediator.NeutralResourcesCulture, satAssemName), missingCultureName);
}
private void HandleResourceStreamMissing(String fileName)
if (_mediator.LocationInfo != null && _mediator.LocationInfo.Namespace != null)
resName = _mediator.LocationInfo.Namespace + Type.Delimiter;
resName += fileName;
- throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_NoNeutralAsm", resName, _mediator.MainAssembly.GetSimpleName()));
+ throw new MissingManifestResourceException(SR.Format(SR.MissingManifestResource_NoNeutralAsm, resName, _mediator.MainAssembly.GetSimpleName()));
}
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
public class MissingManifestResourceException : SystemException
{
public MissingManifestResourceException()
- : base(Environment.GetResourceString("Arg_MissingManifestResourceException"))
+ : base(SR.Arg_MissingManifestResourceException)
{
SetErrorCode(System.__HResults.COR_E_MISSINGMANIFESTRESOURCE);
}
private String _cultureName;
public MissingSatelliteAssemblyException()
- : base(Environment.GetResourceString("MissingSatelliteAssembly_Default"))
+ : base(SR.MissingSatelliteAssembly_Default)
{
SetErrorCode(System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY);
}
if (cultureName == null)
throw new ArgumentNullException(nameof(cultureName));
if (!Enum.IsDefined(typeof(UltimateResourceFallbackLocation), location))
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidNeutralResourcesLanguage_FallbackLoc", location));
+ throw new ArgumentException(SR.Format(SR.Arg_InvalidNeutralResourcesLanguage_FallbackLoc, location));
Contract.EndContractBlock();
_culture = cultureName;
Contract.EndContractBlock();
if (!(assembly is RuntimeAssembly))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeAssembly"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeAssembly);
MainAssembly = assembly;
BaseNameField = baseName;
Contract.EndContractBlock();
if (!(assembly is RuntimeAssembly))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeAssembly"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeAssembly);
MainAssembly = assembly;
BaseNameField = baseName;
if (usingResourceSet != null && (usingResourceSet != _minResourceSet) && !(usingResourceSet.IsSubclassOf(_minResourceSet)))
- throw new ArgumentException(Environment.GetResourceString("Arg_ResMgrNotResSet"), nameof(usingResourceSet));
+ throw new ArgumentException(SR.Arg_ResMgrNotResSet, nameof(usingResourceSet));
_userResourceSet = usingResourceSet;
CommonAssemblyInit();
Contract.EndContractBlock();
if (!(resourceSource is RuntimeType))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType);
_locationInfo = resourceSource;
MainAssembly = _locationInfo.Assembly;
// Ensure that the assembly reference is not null
if (a == null)
{
- throw new ArgumentNullException(nameof(a), Environment.GetResourceString("ArgumentNull_Assembly"));
+ throw new ArgumentNullException(nameof(a), SR.ArgumentNull_Assembly);
}
Contract.EndContractBlock();
// Always throw if we did not fully succeed in initializing the WinRT Resource Manager.
if (_PRIExceptionInfo != null && _PRIExceptionInfo._PackageSimpleName != null && _PRIExceptionInfo._ResWFile != null)
- throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_ResWFileNotLoaded", _PRIExceptionInfo._ResWFile, _PRIExceptionInfo._PackageSimpleName));
+ throw new MissingManifestResourceException(SR.Format(SR.MissingManifestResource_ResWFileNotLoaded, _PRIExceptionInfo._ResWFile, _PRIExceptionInfo._PackageSimpleName));
- throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_NoPRIresources"));
+ throw new MissingManifestResourceException(SR.MissingManifestResource_NoPRIresources);
}
// Throws WinRT hresults.
Object obj = GetObject(name, culture, false);
UnmanagedMemoryStream ums = obj as UnmanagedMemoryStream;
if (ums == null && obj != null)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotStream_Name", name));
+ throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotStream_Name, name));
return ums;
}
if (stream == null)
throw new ArgumentNullException(nameof(stream));
if (!stream.CanRead)
- throw new ArgumentException(Environment.GetResourceString("Argument_StreamNotReadable"));
+ throw new ArgumentException(SR.Argument_StreamNotReadable);
Contract.EndContractBlock();
_resCache = new Dictionary<String, ResourceLocator>(FastResourceComparer.Default);
int stringLength = _store.Read7BitEncodedInt();
if (stringLength < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_NegativeStringLength"));
+ throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength);
}
_store.BaseStream.Seek(stringLength, SeekOrigin.Current);
}
r = ReadUnalignedI4(&_namePositionsPtr[index]);
if (r < 0 || r > _dataSectionOffset - _nameSectionOffset)
{
- throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesNameInvalidOffset", r));
+ throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesNameInvalidOffset, r));
}
return r;
}
public IDictionaryEnumerator GetEnumerator()
{
if (_resCache == null)
- throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed"));
+ throw new InvalidOperationException(SR.ResourceReaderIsClosed);
return new ResourceEnumerator(this);
}
int dataPos = _store.ReadInt32();
if (dataPos < 0 || dataPos >= _store.BaseStream.Length - _dataSectionOffset)
{
- throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesDataInvalidOffset", dataPos));
+ throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dataPos));
}
return dataPos;
}
int byteLen = _store.Read7BitEncodedInt();
if (byteLen < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_NegativeStringLength"));
+ throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength);
}
if (_ums != null)
{
_ums.Seek(byteLen, SeekOrigin.Current);
if (_ums.Position > _ums.Length)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesNameTooLong"));
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesNameTooLong);
}
// On 64-bit machines, these char*'s may be misaligned. Use a
{
int n = _store.Read(bytes, byteLen - numBytesToRead, numBytesToRead);
if (n == 0)
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceNameCorrupted"));
+ throw new BadImageFormatException(SR.BadImageFormat_ResourceNameCorrupted);
numBytesToRead -= n;
}
return FastResourceComparer.CompareOrdinal(bytes, byteLen / 2, name) == 0;
byteLen = _store.Read7BitEncodedInt();
if (byteLen < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_NegativeStringLength"));
+ throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength);
}
if (_ums != null)
{
if (_ums.Position > _ums.Length - byteLen)
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesIndexTooLong", index));
+ throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourcesIndexTooLong, index));
String s = null;
char* charPtr = (char*)_ums.PositionPointer;
dataOffset = _store.ReadInt32();
if (dataOffset < 0 || dataOffset >= _store.BaseStream.Length - _dataSectionOffset)
{
- throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesDataInvalidOffset", dataOffset));
+ throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dataOffset));
}
return s;
}
{
int n = _store.Read(bytes, byteLen - count, count);
if (n == 0)
- throw new EndOfStreamException(Environment.GetResourceString("BadImageFormat_ResourceNameCorrupted_NameIndex", index));
+ throw new EndOfStreamException(SR.Format(SR.BadImageFormat_ResourceNameCorrupted_NameIndex, index));
count -= n;
}
dataOffset = _store.ReadInt32();
if (dataOffset < 0 || dataOffset >= _store.BaseStream.Length - _dataSectionOffset)
{
- throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesDataInvalidOffset", dataOffset));
+ throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dataOffset));
}
}
return Encoding.Unicode.GetString(bytes, 0, byteLen);
int dataPos = _store.ReadInt32();
if (dataPos < 0 || dataPos >= _store.BaseStream.Length - _dataSectionOffset)
{
- throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesDataInvalidOffset", dataPos));
+ throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dataPos));
}
BCLDebug.Log("RESMGRFILEFORMAT", "GetValueForNameIndex: dataPos: " + dataPos);
ResourceTypeCode junk;
if (typeIndex == -1)
return null;
if (FindType(typeIndex) != typeof(String))
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotString_Type", FindType(typeIndex).FullName));
+ throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotString_Type, FindType(typeIndex).FullName));
s = _store.ReadString();
}
else
typeString = typeCode.ToString();
else
typeString = FindType(typeCode - ResourceTypeCode.StartOfUserTypes).FullName;
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotString_Type", typeString));
+ throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotString_Type, typeString));
}
if (typeCode == ResourceTypeCode.String) // ignore Null
s = _store.ReadString();
}
catch (EndOfStreamException eof)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_TypeMismatch"), eof);
+ throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof);
}
catch (ArgumentOutOfRangeException e)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_TypeMismatch"), e);
+ throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e);
}
}
}
else
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ResourceObjectSerialization"));
+ throw new NotSupportedException(SR.NotSupported_ResourceObjectSerialization);
}
}
}
catch (EndOfStreamException eof)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_TypeMismatch"), eof);
+ throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof);
}
catch (ArgumentOutOfRangeException e)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_TypeMismatch"), e);
+ throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e);
}
}
int len = _store.ReadInt32();
if (len < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceDataLengthInvalid", len));
+ throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len));
}
if (_ums == null)
{
if (len > _store.BaseStream.Length)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceDataLengthInvalid", len));
+ throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len));
}
return _store.ReadBytes(len);
}
if (len > _ums.Length - _ums.Position)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceDataLengthInvalid", len));
+ throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len));
}
byte[] bytes = new byte[len];
int len = _store.ReadInt32();
if (len < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceDataLengthInvalid", len));
+ throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len));
}
if (_ums == null)
{
// make sure we don't create an UnmanagedMemoryStream that is longer than the resource stream.
if (len > _ums.Length - _ums.Position)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceDataLengthInvalid", len));
+ throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len));
}
// For the case that we've memory mapped in the .resources
default:
if (typeCode < ResourceTypeCode.StartOfUserTypes)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_TypeMismatch"));
+ throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch);
}
break;
}
// Normal serialized objects
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ResourceObjectSerialization"));
+ throw new NotSupportedException(SR.NotSupported_ResourceObjectSerialization);
}
}
catch (EndOfStreamException eof)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"), eof);
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, eof);
}
catch (IndexOutOfRangeException e)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"), e);
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, e);
}
}
// Check for magic number
int magicNum = _store.ReadInt32();
if (magicNum != ResourceManager.MagicNumber)
- throw new ArgumentException(Environment.GetResourceString("Resources_StreamNotValid"));
+ throw new ArgumentException(SR.Resources_StreamNotValid);
// Assuming this is ResourceManager header V1 or greater, hopefully
// after the version number there is a number of bytes to skip
// to bypass the rest of the ResMgr header. For V2 or greater, we
int numBytesToSkip = _store.ReadInt32();
if (numBytesToSkip < 0 || resMgrHeaderVersion < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted);
}
if (resMgrHeaderVersion > 1)
{
AssemblyName mscorlib = new AssemblyName(ResourceManager.MscorlibName);
if (!ResourceManager.CompareNames(readerType, ResourceManager.ResReaderTypeName, mscorlib))
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_WrongResourceReader_Type", readerType));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_WrongResourceReader_Type, readerType));
// Skip over type name for a suitable ResourceSet
SkipString();
// Do file version check
int version = _store.ReadInt32();
if (version != RuntimeResourceSet.Version && version != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_ResourceFileUnsupportedVersion", RuntimeResourceSet.Version, version));
+ throw new ArgumentException(SR.Format(SR.Arg_ResourceFileUnsupportedVersion, RuntimeResourceSet.Version, version));
_version = version;
#if RESOURCE_FILE_FORMAT_DEBUG
_numResources = _store.ReadInt32();
if (_numResources < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted);
}
BCLDebug.Log("RESMGRFILEFORMAT", "ReadResources: Expecting " + _numResources + " resources.");
#if RESOURCE_FILE_FORMAT_DEBUG
int numTypes = _store.ReadInt32();
if (numTypes < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted);
}
_typeTable = new RuntimeType[numTypes];
_typeNamePositions = new int[numTypes];
int seekPos = unchecked(4 * _numResources);
if (seekPos < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted);
}
unsafe
{
int namePosition = _store.ReadInt32();
if (namePosition < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted);
}
_namePositions[i] = namePosition;
int seekPos = unchecked(4 * _numResources);
if (seekPos < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted);
}
unsafe
{
_dataSectionOffset = _store.ReadInt32();
if (_dataSectionOffset < 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted);
}
// Store current location as start of name section
// _nameSectionOffset should be <= _dataSectionOffset; if not, it's corrupt
if (_dataSectionOffset < _nameSectionOffset)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
+ throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted);
}
BCLDebug.Log("RESMGRFILEFORMAT", String.Format(CultureInfo.InvariantCulture, "ReadResources: _nameOffset = 0x{0:x} _dataOffset = 0x{1:x}", _nameSectionOffset, _dataSectionOffset));
{
if (typeIndex < 0 || typeIndex >= _typeTable.Length)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_InvalidType"));
+ throw new BadImageFormatException(SR.BadImageFormat_InvalidType);
}
if (_typeTable[typeIndex] == null)
{
// getting to Type.GetType -- this is costly with v1 resource formats.
catch (FileNotFoundException)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ResourceObjectSerialization"));
+ throw new NotSupportedException(SR.NotSupported_ResourceObjectSerialization);
}
finally
{
throw new ArgumentNullException(nameof(resourceName));
Contract.EndContractBlock();
if (_resCache == null)
- throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed"));
+ throw new InvalidOperationException(SR.ResourceReaderIsClosed);
// Get the type information from the data section. Also,
// sort all of the data section's indexes to compute length of
int dataPos = FindPosForResource(resourceName);
if (dataPos == -1)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_ResourceNameNotExist", resourceName));
+ throw new ArgumentException(SR.Format(SR.Arg_ResourceNameNotExist, resourceName));
}
lock (this)
int numBytesToSkip = _store.Read7BitEncodedInt();
if (numBytesToSkip < 0)
{
- throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesNameInvalidOffset", numBytesToSkip));
+ throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesNameInvalidOffset, numBytesToSkip));
}
_store.BaseStream.Position += numBytesToSkip;
int dPos = _store.ReadInt32();
if (dPos < 0 || dPos >= _store.BaseStream.Length - _dataSectionOffset)
{
- throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesDataInvalidOffset", dPos));
+ throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dPos));
}
sortedDataPositions[i] = dPos;
}
ResourceTypeCode typeCode = (ResourceTypeCode)_store.Read7BitEncodedInt();
if (typeCode < 0 || typeCode >= ResourceTypeCode.StartOfUserTypes + _typeTable.Length)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_InvalidType"));
+ throw new BadImageFormatException(SR.BadImageFormat_InvalidType);
}
resourceType = TypeNameFromTypeCode(typeCode);
len -= (int)(_store.BaseStream.Position - (_dataSectionOffset + dataPos));
byte[] bytes = _store.ReadBytes(len);
if (bytes.Length != len)
- throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourceNameCorrupted"));
+ throw new FormatException(SR.BadImageFormat_ResourceNameCorrupted);
resourceData = bytes;
}
}
{
get
{
- if (_currentName == ENUM_DONE) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded));
- if (!_currentIsValid) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
- if (_reader._resCache == null) throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed"));
+ if (_currentName == ENUM_DONE) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded));
+ if (!_currentIsValid) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
+ if (_reader._resCache == null) throw new InvalidOperationException(SR.ResourceReaderIsClosed);
return _reader.AllocateStringForNameIndex(_currentName, out _dataPosition);
}
{
get
{
- if (_currentName == ENUM_DONE) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded));
- if (!_currentIsValid) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
- if (_reader._resCache == null) throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed"));
+ if (_currentName == ENUM_DONE) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded));
+ if (!_currentIsValid) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
+ if (_reader._resCache == null) throw new InvalidOperationException(SR.ResourceReaderIsClosed);
String key;
Object value = null;
{
get
{
- if (_currentName == ENUM_DONE) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded));
- if (!_currentIsValid) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
- if (_reader._resCache == null) throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed"));
+ if (_currentName == ENUM_DONE) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded));
+ if (!_currentIsValid) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
+ if (_reader._resCache == null) throw new InvalidOperationException(SR.ResourceReaderIsClosed);
// Consider using _resCache here, eventually, if
// this proves to be an interesting perf scenario.
public void Reset()
{
- if (_reader._resCache == null) throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed"));
+ if (_reader._resCache == null) throw new InvalidOperationException(SR.ResourceReaderIsClosed);
_currentIsValid = false;
_currentName = ENUM_NOT_STARTED;
}
{
Hashtable copyOfTable = Table; // Avoid a race with Dispose
if (copyOfTable == null)
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet);
return copyOfTable.GetEnumerator();
}
}
catch (InvalidCastException)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotString_Name", name));
+ throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotString_Name, name));
}
}
}
catch (InvalidCastException)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotString_Name", name));
+ throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotString_Name, name));
}
// case-sensitive lookup succeeded
}
catch (InvalidCastException)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotString_Name", name));
+ throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotString_Name, name));
}
}
Hashtable copyOfTable = Table; // Avoid a race with Dispose
if (copyOfTable == null)
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet);
return copyOfTable[name];
}
Hashtable copyOfTable = Table; // Avoid a race with Dispose
if (copyOfTable == null)
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet);
Hashtable caseTable = _caseInsensitiveTable; // Avoid a race condition with Close
if (caseTable == null)
{
IResourceReader copyOfReader = Reader;
if (copyOfReader == null || _resCache == null)
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet);
return copyOfReader.GetEnumerator();
}
if (key == null)
throw new ArgumentNullException(nameof(key));
if (Reader == null || _resCache == null)
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet);
Contract.EndContractBlock();
Object value = null;
lock (Reader)
{
if (Reader == null)
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet);
if (_defaultReader != null)
{
if (!loaderAssuredCompatible)
throw new ArgumentException(String.Format(
- CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_ResolveMethodHandle"),
+ CultureInfo.CurrentCulture, SR.Argument_ResolveMethodHandle,
reflectedType.ToString(), declaredType.ToString()));
}
// Action<in string> is assignable from, but not a subclass of Action<in object>.
{
// ignoring instantiation is the ReflectedType is not a subtype of the DeclaringType
throw new ArgumentException(String.Format(
- CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_ResolveMethodHandle"),
+ CultureInfo.CurrentCulture, SR.Argument_ResolveMethodHandle,
reflectedType.ToString(), declaredType.ToString()));
}
{
// declaredType is not Array, not generic, and not assignable from reflectedType
throw new ArgumentException(String.Format(
- CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_ResolveMethodHandle"),
+ CultureInfo.CurrentCulture, SR.Argument_ResolveMethodHandle,
reflectedType.ToString(), declaredType.ToString()));
}
}
!RuntimeTypeHandle.CompareCanonicalHandles(declaredType, reflectedType))
{
throw new ArgumentException(String.Format(
- CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_ResolveFieldHandle"),
+ CultureInfo.CurrentCulture, SR.Argument_ResolveFieldHandle,
reflectedType.ToString(),
declaredType.ToString()));
}
{
if (type.IsPointer || type.IsByRef || type == typeof(void))
throw new ArgumentException(
- Environment.GetResourceString("Argument_NeverValidGenericArgument", type.ToString()));
+ SR.Format(SR.Argument_NeverValidGenericArgument, type.ToString()));
}
if (genericArguments.Length != genericParamters.Length)
throw new ArgumentException(
- Environment.GetResourceString("Argument_NotEnoughGenArguments", genericArguments.Length, genericParamters.Length));
+ SR.Format(SR.Argument_NotEnoughGenArguments, genericArguments.Length, genericParamters.Length));
}
internal static void ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)
typeContext, methodContext, genericArgument.GetTypeHandleInternal().GetTypeChecked()))
{
throw new ArgumentException(
- Environment.GetResourceString("Argument_GenConstraintViolation",
- i.ToString(CultureInfo.CurrentCulture), genericArgument.ToString(), definition.ToString(), genericParameter.ToString()), e);
+ SR.Format(SR.Argument_GenConstraintViolation, i.ToString(CultureInfo.CurrentCulture), genericArgument.ToString(), definition.ToString(), genericParameter.ToString()), e);
}
}
}
public override InterfaceMapping GetInterfaceMap(Type ifaceType)
{
if (IsGenericParameter)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_GenericParameter"));
+ throw new InvalidOperationException(SR.Arg_GenericParameter);
if ((object)ifaceType == null)
throw new ArgumentNullException(nameof(ifaceType));
RuntimeType ifaceRtType = ifaceType as RuntimeType;
if (ifaceRtType == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(ifaceType));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(ifaceType));
RuntimeTypeHandle ifaceRtTypeHandle = ifaceRtType.GetTypeHandleInternal();
// SZArrays implement the methods on IList`1, IEnumerable`1, and ICollection`1 with
// SZArrayHelper and some runtime magic. We don't have accurate interface maps for them.
if (IsSZArray && ifaceType.IsGenericType)
- throw new ArgumentException(Environment.GetResourceString("Argument_ArrayGetInterfaceMap"));
+ throw new ArgumentException(SR.Argument_ArrayGetInterfaceMap);
int ifaceInstanceMethodCount = RuntimeTypeHandle.GetNumVirtuals(ifaceRtType);
MethodInfo methodInfo = candidates[j];
if (!System.DefaultBinder.CompareMethodSigAndName(methodInfo, firstCandidate))
{
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
}
}
{
if ((object)returnType == null)
// if we are here we have no args or property type to select over and we have more than one property with that name
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
}
}
if ((bindingAttr & eventInfo.BindingFlags) == eventInfo.BindingFlags)
{
if (match != null)
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
match = eventInfo;
}
if (match != null)
{
if (Object.ReferenceEquals(fieldInfo.DeclaringType, match.DeclaringType))
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
if ((match.DeclaringType.IsInterface == true) && (fieldInfo.DeclaringType.IsInterface == true))
multipleStaticFieldMatches = true;
}
if (multipleStaticFieldMatches && match.DeclaringType.IsInterface)
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
return match;
}
if (RuntimeType.FilterApplyType(iface, bindingAttr, name, false, ns))
{
if (match != null)
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
match = iface;
}
if (RuntimeType.FilterApplyType(nestedType, bindingAttr, name, false, ns))
{
if (match != null)
- throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException"));
+ throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException);
match = nestedType;
}
get
{
if (!IsGenericParameter)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericParameter"));
+ throw new InvalidOperationException(SR.Arg_NotGenericParameter);
Contract.EndContractBlock();
IRuntimeMethodInfo declaringMethod = RuntimeTypeHandle.GetDeclaringMethod(this);
get
{
if (!IsGenericParameter)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericParameter"));
+ throw new InvalidOperationException(SR.Arg_NotGenericParameter);
Contract.EndContractBlock();
GenericParameterAttributes attributes;
public override int GetArrayRank()
{
if (!IsArrayImpl())
- throw new ArgumentException(Environment.GetResourceString("Argument_HasToBeArrayClass"));
+ throw new ArgumentException(SR.Argument_HasToBeArrayClass);
return RuntimeTypeHandle.GetArrayRank(this);
}
public override string[] GetEnumNames()
{
if (!IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), "enumType");
+ throw new ArgumentException(SR.Arg_MustBeEnum, "enumType");
Contract.EndContractBlock();
String[] ret = Enum.InternalGetNames(this);
public override Array GetEnumValues()
{
if (!IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), "enumType");
+ throw new ArgumentException(SR.Arg_MustBeEnum, "enumType");
Contract.EndContractBlock();
// Get all of the values
public override Type GetEnumUnderlyingType()
{
if (!IsEnum)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), "enumType");
+ throw new ArgumentException(SR.Arg_MustBeEnum, "enumType");
Contract.EndContractBlock();
return Enum.InternalGetUnderlyingType(this);
if (valueType.IsEnum)
{
if (!valueType.IsEquivalentTo(this))
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumAndObjectMustBeSameType", valueType.ToString(), this.ToString()));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumAndObjectMustBeSameType, valueType.ToString(), this.ToString()));
valueType = (RuntimeType)valueType.GetEnumUnderlyingType();
}
{
RuntimeType underlyingType = Enum.InternalGetUnderlyingType(this);
if (underlyingType != valueType)
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumUnderlyingTypeAndObjectMustBeSameType", valueType.ToString(), underlyingType.ToString()));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumUnderlyingTypeAndObjectMustBeSameType, valueType.ToString(), underlyingType.ToString()));
ulong[] ulValues = Enum.InternalGetValues(this);
ulong ulValue = Enum.ToUInt64(value);
}
else
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType"));
+ throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType);
}
}
Type valueType = value.GetType();
if (!(valueType.IsEnum || IsIntegerType(valueType)))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnumBaseTypeOrEnum"), nameof(value));
+ throw new ArgumentException(SR.Arg_MustBeEnumBaseTypeOrEnum, nameof(value));
ulong ulValue = Enum.ToUInt64(value);
if (!IsGenericTypeDefinition)
throw new InvalidOperationException(
- Environment.GetResourceString("Arg_NotGenericTypeDefinition", this));
+ SR.Format(SR.Arg_NotGenericTypeDefinition, this));
if (GetGenericArguments().Length != instantiation.Length)
- throw new ArgumentException(Environment.GetResourceString("Argument_GenericArgsCount"), nameof(instantiation));
+ throw new ArgumentException(SR.Argument_GenericArgsCount, nameof(instantiation));
for (int i = 0; i < instantiation.Length; i++)
{
get
{
if (!IsGenericParameter)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericParameter"));
+ throw new InvalidOperationException(SR.Arg_NotGenericParameter);
Contract.EndContractBlock();
return new RuntimeTypeHandle(this).GetGenericVariableIndex();
public override Type GetGenericTypeDefinition()
{
if (!IsGenericType)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotGenericType"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotGenericType);
Contract.EndContractBlock();
return RuntimeTypeHandle.GetGenericTypeDefinition(this);
public override Type[] GetGenericParameterConstraints()
{
if (!IsGenericParameter)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericParameter"));
+ throw new InvalidOperationException(SR.Arg_NotGenericParameter);
Contract.EndContractBlock();
Type[] constraints = new RuntimeTypeHandle(this).GetConstraints();
}
if ((invokeAttr & BindingFlags.ExactBinding) == BindingFlags.ExactBinding)
- throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Arg_ObjObjEx"), value.GetType(), this));
+ throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, SR.Arg_ObjObjEx, value.GetType(), this));
return TryChangeType(value, binder, culture, needsSpecialCast);
}
}
}
- throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Arg_ObjObjEx"), value.GetType(), this));
+ throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, SR.Arg_ObjObjEx, value.GetType(), this));
}
// GetDefaultMembers
Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
{
if (IsGenericParameter)
- throw new InvalidOperationException(Environment.GetResourceString("Arg_GenericParameter"));
+ throw new InvalidOperationException(SR.Arg_GenericParameter);
Contract.EndContractBlock();
#region Preconditions
if ((bindingFlags & InvocationMask) == 0)
// "Must specify binding flags describing the invoke operation required."
- throw new ArgumentException(Environment.GetResourceString("Arg_NoAccessSpec"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_NoAccessSpec, nameof(bindingFlags));
// Provide a default binding mask if none is provided
if ((bindingFlags & MemberBindingMask) == 0)
{
if (namedParams.Length > providedArgs.Length)
// "Named parameter array can not be bigger than argument array."
- throw new ArgumentException(Environment.GetResourceString("Arg_NamedParamTooBig"), nameof(namedParams));
+ throw new ArgumentException(SR.Arg_NamedParamTooBig, nameof(namedParams));
}
else
{
if (namedParams.Length != 0)
// "Named parameter array can not be bigger than argument array."
- throw new ArgumentException(Environment.GetResourceString("Arg_NamedParamTooBig"), nameof(namedParams));
+ throw new ArgumentException(SR.Arg_NamedParamTooBig, nameof(namedParams));
}
}
#endregion
{
#region Preconditions
if ((bindingFlags & ClassicBindingMask) == 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_COMAccess"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_COMAccess, nameof(bindingFlags));
if ((bindingFlags & BindingFlags.GetProperty) != 0 && (bindingFlags & ClassicBindingMask & ~(BindingFlags.GetProperty | BindingFlags.InvokeMethod)) != 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_PropSetGet"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_PropSetGet, nameof(bindingFlags));
if ((bindingFlags & BindingFlags.InvokeMethod) != 0 && (bindingFlags & ClassicBindingMask & ~(BindingFlags.GetProperty | BindingFlags.InvokeMethod)) != 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_PropSetInvoke"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_PropSetInvoke, nameof(bindingFlags));
if ((bindingFlags & BindingFlags.SetProperty) != 0 && (bindingFlags & ClassicBindingMask & ~BindingFlags.SetProperty) != 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_COMPropSetPut"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_COMPropSetPut, nameof(bindingFlags));
if ((bindingFlags & BindingFlags.PutDispProperty) != 0 && (bindingFlags & ClassicBindingMask & ~BindingFlags.PutDispProperty) != 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_COMPropSetPut"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_COMPropSetPut, nameof(bindingFlags));
if ((bindingFlags & BindingFlags.PutRefDispProperty) != 0 && (bindingFlags & ClassicBindingMask & ~BindingFlags.PutRefDispProperty) != 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_COMPropSetPut"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_COMPropSetPut, nameof(bindingFlags));
#endregion
{
#region Check that any named paramters are not null
if (namedParams != null && Array.IndexOf(namedParams, null) != -1)
// "Named parameter value must not be null."
- throw new ArgumentException(Environment.GetResourceString("Arg_NamedParamNull"), nameof(namedParams));
+ throw new ArgumentException(SR.Arg_NamedParamNull, nameof(namedParams));
#endregion
int argCnt = (providedArgs != null) ? providedArgs.Length : 0;
{
if ((bindingFlags & BindingFlags.CreateInstance) != 0 && (bindingFlags & BinderNonCreateInstance) != 0)
// "Can not specify both CreateInstance and another access type."
- throw new ArgumentException(Environment.GetResourceString("Arg_CreatInstAccess"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_CreatInstAccess, nameof(bindingFlags));
return Activator.CreateInstance(this, bindingFlags, binder, providedArgs, culture);
}
{
if (IsSetField)
// "Can not specify both Get and Set on a field."
- throw new ArgumentException(Environment.GetResourceString("Arg_FldSetGet"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_FldSetGet, nameof(bindingFlags));
if ((bindingFlags & BindingFlags.SetProperty) != 0)
// "Can not specify both GetField and SetProperty."
- throw new ArgumentException(Environment.GetResourceString("Arg_FldGetPropSet"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_FldGetPropSet, nameof(bindingFlags));
}
else
{
if ((bindingFlags & BindingFlags.GetProperty) != 0)
// "Can not specify both SetField and GetProperty."
- throw new ArgumentException(Environment.GetResourceString("Arg_FldSetPropGet"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_FldSetPropGet, nameof(bindingFlags));
if ((bindingFlags & BindingFlags.InvokeMethod) != 0)
// "Can not specify Set on a Field and Invoke on a method."
- throw new ArgumentException(Environment.GetResourceString("Arg_FldSetInvoke"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_FldSetInvoke, nameof(bindingFlags));
}
#endregion
}
catch (InvalidCastException)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_IndexMustBeInt"));
+ throw new ArgumentException(SR.Arg_IndexMustBeInt);
}
}
{
#region Get the field value
if (argCnt != 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_FldGetArgErr"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_FldGetArgErr, nameof(bindingFlags));
return selFld.GetValue(target);
#endregion
{
#region Set the field Value
if (argCnt != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_FldSetArgErr"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_FldSetArgErr, nameof(bindingFlags));
selFld.SetValue(target, providedArgs[0], bindingFlags, binder, culture);
Debug.Assert(!IsSetField);
if (isSetProperty)
- throw new ArgumentException(Environment.GetResourceString("Arg_PropSetGet"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_PropSetGet, nameof(bindingFlags));
}
else
{
Debug.Assert(!IsGetField);
if ((bindingFlags & BindingFlags.InvokeMethod) != 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_PropSetInvoke"), nameof(bindingFlags));
+ throw new ArgumentException(SR.Arg_PropSetInvoke, nameof(bindingFlags));
}
#endregion
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType, inherit);
}
RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType;
if (attributeRuntimeType == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType, inherit);
}
private void CreateInstanceCheckThis()
{
if (this is ReflectionOnlyType)
- throw new ArgumentException(Environment.GetResourceString("Arg_ReflectionOnlyInvoke"));
+ throw new ArgumentException(SR.Arg_ReflectionOnlyInvoke);
if (ContainsGenericParameters)
throw new ArgumentException(
- Environment.GetResourceString("Acc_CreateGenericEx", this));
+ SR.Format(SR.Acc_CreateGenericEx, this));
Contract.EndContractBlock();
Type elementType = this.GetRootElementType();
if (Object.ReferenceEquals(elementType, typeof(ArgIterator)))
- throw new NotSupportedException(Environment.GetResourceString("Acc_CreateArgIterator"));
+ throw new NotSupportedException(SR.Acc_CreateArgIterator);
if (Object.ReferenceEquals(elementType, typeof(void)))
- throw new NotSupportedException(Environment.GetResourceString("Acc_CreateVoid"));
+ throw new NotSupportedException(SR.Acc_CreateVoid);
}
internal Object CreateInstanceImpl(
if (cons == null)
{
- throw new MissingMethodException(Environment.GetResourceString("MissingConstructor_Name", FullName));
+ throw new MissingMethodException(SR.Format(SR.MissingConstructor_Name, FullName));
}
MethodBase invokeMethod;
if (invokeMethod == null)
{
- throw new MissingMethodException(Environment.GetResourceString("MissingConstructor_Name", FullName));
+ throw new MissingMethodException(SR.Format(SR.MissingConstructor_Name, FullName));
}
if (invokeMethod.GetParametersNoCopy().Length == 0)
Debug.Assert((invokeMethod.CallingConvention & CallingConventions.VarArgs) ==
CallingConventions.VarArgs);
throw new NotSupportedException(String.Format(CultureInfo.CurrentCulture,
- Environment.GetResourceString("NotSupported_CallToVarArg")));
+ SR.NotSupported_CallToVarArg));
}
// fast path??
internal Object CreateInstanceDefaultCtor(bool publicOnly, bool skipCheckThis, bool fillCache, ref StackCrawlMark stackMark)
{
if (GetType() == typeof(ReflectionOnlyType))
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInReflectionOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInReflectionOnly);
ActivatorCache activatorCache = s_ActivatorCache;
if (activatorCache != null)
if (ace.m_ctor != null &&
(ace.m_ctorAttributes & MethodAttributes.MemberAccessMask) != MethodAttributes.Public)
{
- throw new MissingMethodException(Environment.GetResourceString("Arg_NoDefCTor"));
+ throw new MissingMethodException(SR.Arg_NoDefCTor);
}
}
{
get
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInReflectionOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInReflectionOnly);
}
}
}
{
if (_invalid)
{
- throw new InvalidOperationException(Environment.GetResourceString("CollectionCorrupted"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionCorrupted);
}
}
public sealed class RuntimeWrappedException : Exception
{
private RuntimeWrappedException(Object thrownObject)
- : base(Environment.GetResourceString("RuntimeWrappedException"))
+ : base(SR.RuntimeWrappedException)
{
SetErrorCode(System.__HResults.COR_E_RUNTIMEWRAPPED);
m_wrappedException = thrownObject;
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/*=============================================================================
{
if (source == null)
{
- throw new ArgumentNullException(nameof(source), Environment.GetResourceString("ArgumentNull_Obj"));
+ throw new ArgumentNullException(nameof(source), SR.ArgumentNull_Obj);
}
return new ExceptionDispatchInfo(source);
{
if ((value < GCLatencyMode.Batch) || (value > GCLatencyMode.SustainedLowLatency))
{
- throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum"));
+ throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_Enum);
}
Contract.EndContractBlock();
if ((value < GCLargeObjectHeapCompactionMode.Default) ||
(value > GCLargeObjectHeapCompactionMode.CompactOnce))
{
- throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum"));
+ throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_Enum);
}
Contract.EndContractBlock();
public class COMException : ExternalException
{
public COMException()
- : base(Environment.GetResourceString("Arg_COMException"))
+ : base(SR.Arg_COMException)
{
SetErrorCode(__HResults.E_FAIL);
}
public CurrencyWrapper(Object obj)
{
if (!(obj is Decimal))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDecimal"), nameof(obj));
+ throw new ArgumentException(SR.Arg_MustBeDecimal, nameof(obj));
m_WrappedObject = (Decimal)obj;
}
public ErrorWrapper(Object errorCode)
{
if (!(errorCode is int))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt32"), nameof(errorCode));
+ throw new ArgumentException(SR.Arg_MustBeInt32, nameof(errorCode));
m_ErrorCode = (int)errorCode;
}
public class ExternalException : SystemException
{
public ExternalException()
- : base(Environment.GetResourceString("Arg_ExternalException"))
+ : base(SR.Arg_ExternalException)
{
SetErrorCode(__HResults.E_FAIL);
}
}
if (cookie == GCHandleCookie.Zero)
- throw new OutOfMemoryException(Environment.GetResourceString("OutOfMemory_GCHandleMDA"));
+ throw new OutOfMemoryException(SR.OutOfMemory_GCHandleMDA);
// This handle hasn't been added to the map yet so add it.
m_HandleToCookieMap.Add(handle, cookie);
ValidateHandle();
// You can only get the address of pinned handles.
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_HandleIsNotPinned"));
+ throw new InvalidOperationException(SR.InvalidOperation_HandleIsNotPinned);
}
// Get the address.
public class InvalidComObjectException : SystemException
{
public InvalidComObjectException()
- : base(Environment.GetResourceString("Arg_InvalidComObjectException"))
+ : base(SR.Arg_InvalidComObjectException)
{
SetErrorCode(__HResults.COR_E_INVALIDCOMOBJECT);
}
public class InvalidOleVariantTypeException : SystemException
{
public InvalidOleVariantTypeException()
- : base(Environment.GetResourceString("Arg_InvalidOleVariantTypeException"))
+ : base(SR.Arg_InvalidOleVariantTypeException)
{
SetErrorCode(__HResults.COR_E_INVALIDOLEVARIANTTYPE);
}
if (t == null)
throw new ArgumentNullException(nameof(t));
if (!(t is RuntimeType))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(t));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(t));
if (t.IsGenericType)
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(t));
+ throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(t));
Contract.EndContractBlock();
return SizeOfHelper(t, true);
FieldInfo f = t.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (f == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_OffsetOfFieldNotFound", t.FullName), nameof(fieldName));
+ throw new ArgumentException(SR.Format(SR.Argument_OffsetOfFieldNotFound, t.FullName), nameof(fieldName));
RtFieldInfo rtField = f as RtFieldInfo;
if (rtField == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo"), nameof(fieldName));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo, nameof(fieldName));
return OffsetOfHelper(rtField);
}
RuntimeMethodInfo rmi = m as RuntimeMethodInfo;
if (rmi == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo);
InternalPrelink(rmi);
}
throw new ArgumentNullException(nameof(structureType));
if (structureType.IsGenericType)
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(structureType));
+ throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(structureType));
RuntimeType rt = structureType.UnderlyingSystemType as RuntimeType;
if (rt == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(structureType));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(structureType));
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
}
if (rtModule == null)
- throw new ArgumentNullException(nameof(m), Environment.GetResourceString("Argument_MustBeRuntimeModule"));
+ throw new ArgumentNullException(nameof(m), SR.Argument_MustBeRuntimeModule);
return GetHINSTANCE(rtModule.GetNativeHandle());
}
}
catch (InvalidCastException)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_ObjNotComObject"), nameof(o));
+ throw new ArgumentException(SR.Argument_ObjNotComObject, nameof(o));
}
return co.ReleaseSelf();
}
catch (InvalidCastException)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_ObjNotComObject"), nameof(o));
+ throw new ArgumentException(SR.Argument_ObjNotComObject, nameof(o));
}
co.FinalReleaseSelf();
if (t == null)
throw new ArgumentNullException(nameof(t));
if (!t.IsCOMObject)
- throw new ArgumentException(Environment.GetResourceString("Argument_TypeNotComObject"), nameof(t));
+ throw new ArgumentException(SR.Argument_TypeNotComObject, nameof(t));
if (t.IsGenericType)
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(t));
+ throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(t));
Contract.EndContractBlock();
if (t.IsWindowsRuntimeObject)
- throw new ArgumentException(Environment.GetResourceString("Argument_TypeIsWinRTType"), nameof(t));
+ throw new ArgumentException(SR.Argument_TypeIsWinRTType, nameof(t));
// Check for the null case.
if (o == null)
// Make sure the object is a COM object.
if (!o.GetType().IsCOMObject)
- throw new ArgumentException(Environment.GetResourceString("Argument_ObjNotComObject"), nameof(o));
+ throw new ArgumentException(SR.Argument_ObjNotComObject, nameof(o));
if (o.GetType().IsWindowsRuntimeObject)
- throw new ArgumentException(Environment.GetResourceString("Argument_ObjIsWinRTObject"), nameof(o));
+ throw new ArgumentException(SR.Argument_ObjIsWinRTObject, nameof(o));
// Check to see if the type of the object is the requested type.
if (o.GetType() == t)
if (type == null)
throw new ArgumentNullException(nameof(type));
if (type.IsImport)
- throw new ArgumentException(Environment.GetResourceString("Argument_TypeMustNotBeComImport"), nameof(type));
+ throw new ArgumentException(SR.Argument_TypeMustNotBeComImport, nameof(type));
if (type.IsGenericType)
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(type));
+ throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(type));
Contract.EndContractBlock();
IList<CustomAttributeData> cas = CustomAttributeData.GetCustomAttributes(type);
Contract.EndContractBlock();
if ((t as RuntimeType) == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(t));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(t));
if (t.IsGenericType)
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(t));
+ throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(t));
Type c = t.BaseType;
if (c == null || (c != typeof(Delegate) && c != typeof(MulticastDelegate)))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(t));
+ throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(t));
return GetDelegateForFunctionPointerInternal(ptr, t);
}
public class MarshalDirectiveException : SystemException
{
public MarshalDirectiveException()
- : base(Environment.GetResourceString("Arg_MarshalDirectiveException"))
+ : base(SR.Arg_MarshalDirectiveException)
{
SetErrorCode(__HResults.COR_E_MARSHALDIRECTIVE);
}
public class SafeArrayRankMismatchException : SystemException
{
public SafeArrayRankMismatchException()
- : base(Environment.GetResourceString("Arg_SafeArrayRankMismatchException"))
+ : base(SR.Arg_SafeArrayRankMismatchException)
{
SetErrorCode(__HResults.COR_E_SAFEARRAYRANKMISMATCH);
}
public class SafeArrayTypeMismatchException : SystemException
{
public SafeArrayTypeMismatchException()
- : base(Environment.GetResourceString("Arg_SafeArrayTypeMismatchException"))
+ : base(SR.Arg_SafeArrayTypeMismatchException)
{
SetErrorCode(__HResults.COR_E_SAFEARRAYTYPEMISMATCH);
}
public void Initialize(ulong numBytes)
{
if (numBytes < 0)
- throw new ArgumentOutOfRangeException(nameof(numBytes), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(numBytes), SR.ArgumentOutOfRange_NeedNonNegNum);
if (IntPtr.Size == 4 && numBytes > UInt32.MaxValue)
- throw new ArgumentOutOfRangeException(nameof(numBytes), Environment.GetResourceString("ArgumentOutOfRange_AddressSpace"));
+ throw new ArgumentOutOfRangeException(nameof(numBytes), SR.ArgumentOutOfRange_AddressSpace);
Contract.EndContractBlock();
if (numBytes >= (ulong)Uninitialized)
- throw new ArgumentOutOfRangeException(nameof(numBytes), Environment.GetResourceString("ArgumentOutOfRange_UIntPtrMax-1"));
+ throw new ArgumentOutOfRangeException(nameof(numBytes), SR.ArgumentOutOfRange_UIntPtrMax);
_numBytes = (UIntPtr)numBytes;
}
public void Initialize(uint numElements, uint sizeOfEachElement)
{
if (numElements < 0)
- throw new ArgumentOutOfRangeException(nameof(numElements), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(numElements), SR.ArgumentOutOfRange_NeedNonNegNum);
if (sizeOfEachElement < 0)
- throw new ArgumentOutOfRangeException(nameof(sizeOfEachElement), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(sizeOfEachElement), SR.ArgumentOutOfRange_NeedNonNegNum);
if (IntPtr.Size == 4 && numElements * sizeOfEachElement > UInt32.MaxValue)
- throw new ArgumentOutOfRangeException("numBytes", Environment.GetResourceString("ArgumentOutOfRange_AddressSpace"));
+ throw new ArgumentOutOfRangeException("numBytes", SR.ArgumentOutOfRange_AddressSpace);
Contract.EndContractBlock();
if (numElements * sizeOfEachElement >= (ulong)Uninitialized)
- throw new ArgumentOutOfRangeException(nameof(numElements), Environment.GetResourceString("ArgumentOutOfRange_UIntPtrMax-1"));
+ throw new ArgumentOutOfRangeException(nameof(numElements), SR.ArgumentOutOfRange_UIntPtrMax);
_numBytes = checked((UIntPtr)(numElements * sizeOfEachElement));
}
where T : struct
{
if (array == null)
- throw new ArgumentNullException(nameof(array), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(array), SR.ArgumentNull_Buffer);
if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (array.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
if (_numBytes == Uninitialized)
where T : struct
{
if (array == null)
- throw new ArgumentNullException(nameof(array), Environment.GetResourceString("ArgumentNull_Buffer"));
+ throw new ArgumentNullException(nameof(array), SR.ArgumentNull_Buffer);
if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (array.Length - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
if (_numBytes == Uninitialized)
private static void NotEnoughRoom()
{
- throw new ArgumentException(Environment.GetResourceString("Arg_BufferTooSmall"));
+ throw new ArgumentException(SR.Arg_BufferTooSmall);
}
private static InvalidOperationException NotInitialized()
{
Debug.Assert(false, "Uninitialized SafeBuffer! Someone needs to call Initialize before using this instance!");
- return new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MustCallInitialize"));
+ return new InvalidOperationException(SR.InvalidOperation_MustCallInitialize);
}
// FCALL limitations mean we can't have generic FCALL methods. However, we can pass
uint size = _this.Size;
if (((uint)Int32.MaxValue) < size)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
return (int)size;
// ICollection expects the destination array to be single-dimensional.
if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
+ throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
int destLB = array.GetLowerBound(0);
// list.CopyTo(items, 0);
if (srcLen > (destLen - (arrayIndex - destLB)))
- throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection"));
+ throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection);
if (arrayIndex - destLB > destLen)
- throw new ArgumentException(Environment.GetResourceString("Argument_IndexOutOfArrayBounds"));
+ throw new ArgumentException(SR.Argument_IndexOutOfArrayBounds);
// We need to verify the index as we;
IBindableVector _this = JitHelpers.UnsafeCast<IBindableVector>(this);
uint size = _this.Size;
if (((uint)Int32.MaxValue) < size)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
return (int)(size - 1);
if (((uint)Int32.MaxValue) < index)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
return (int)index;
{
if (((uint)Int32.MaxValue) < index)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
RemoveAtHelper(_this, index);
public char GetChar16()
{
if (this.Type != PropertyType.Char16)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Char16"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Char16"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return (char)_data;
}
public Boolean GetBoolean()
{
if (this.Type != PropertyType.Boolean)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Boolean"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Boolean"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return (bool)_data;
}
public DateTimeOffset GetDateTime()
{
if (this.Type != PropertyType.DateTime)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "DateTime"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "DateTime"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return (DateTimeOffset)_data;
}
public TimeSpan GetTimeSpan()
{
if (this.Type != PropertyType.TimeSpan)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "TimeSpan"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "TimeSpan"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return (TimeSpan)_data;
}
public Point GetPoint()
{
if (this.Type != PropertyType.Point)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Point"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Point"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return Unbox<Point>(IReferenceFactory.s_pointType);
public Size GetSize()
{
if (this.Type != PropertyType.Size)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Size"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Size"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return Unbox<Size>(IReferenceFactory.s_sizeType);
public Rect GetRect()
{
if (this.Type != PropertyType.Rect)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Rect"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Rect"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return Unbox<Rect>(IReferenceFactory.s_rectType);
public char[] GetChar16Array()
{
if (this.Type != PropertyType.Char16Array)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Char16[]"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Char16[]"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return (char[])_data;
}
public Boolean[] GetBooleanArray()
{
if (this.Type != PropertyType.BooleanArray)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Boolean[]"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Boolean[]"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return (bool[])_data;
}
public Object[] GetInspectableArray()
{
if (this.Type != PropertyType.InspectableArray)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Inspectable[]"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Inspectable[]"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return (Object[])_data;
}
public DateTimeOffset[] GetDateTimeArray()
{
if (this.Type != PropertyType.DateTimeArray)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "DateTimeOffset[]"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "DateTimeOffset[]"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return (DateTimeOffset[])_data;
}
public TimeSpan[] GetTimeSpanArray()
{
if (this.Type != PropertyType.TimeSpanArray)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "TimeSpan[]"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "TimeSpan[]"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return (TimeSpan[])_data;
}
public Point[] GetPointArray()
{
if (this.Type != PropertyType.PointArray)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Point[]"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Point[]"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return UnboxArray<Point>(IReferenceFactory.s_pointType);
public Size[] GetSizeArray()
{
if (this.Type != PropertyType.SizeArray)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Size[]"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Size[]"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
public Rect[] GetRectArray()
{
if (this.Type != PropertyType.RectArray)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Rect[]"), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Rect[]"), __HResults.TYPE_E_TYPEMISMATCH);
Contract.EndContractBlock();
return UnboxArray<Rect>(IReferenceFactory.s_rectType);
Array dataArray = _data as Array;
if (dataArray == null)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, typeof(T).MakeArrayType().Name), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, typeof (T).MakeArrayType().Name), __HResults.TYPE_E_TYPEMISMATCH);
}
// Array types are 1024 larger than their equivilent scalar counterpart
}
catch (InvalidCastException elementCastException)
{
- Exception e = new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueArrayCoersion", this.Type, typeof(T).MakeArrayType().Name, i, elementCastException.Message), elementCastException);
+ Exception e = new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueArrayCoersion, this.Type, typeof (T).MakeArrayType().Name, i, elementCastException.Message), elementCastException);
e.SetErrorCode(elementCastException._HResult);
throw e;
}
// should not attempt coersion, even if the underlying value is technically convertable
if (!IsCoercable(type, value) && type != PropertyType.Inspectable)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", type, typeof(T).Name), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, type, typeof (T).Name), __HResults.TYPE_E_TYPEMISMATCH);
}
try
}
catch (FormatException)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", type, typeof(T).Name), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, type, typeof (T).Name), __HResults.TYPE_E_TYPEMISMATCH);
}
catch (InvalidCastException)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", type, typeof(T).Name), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, type, typeof (T).Name), __HResults.TYPE_E_TYPEMISMATCH);
}
catch (OverflowException)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueCoersion", type, value, typeof(T).Name), __HResults.DISP_E_OVERFLOW);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueCoersion, type, value, typeof (T).Name), __HResults.DISP_E_OVERFLOW);
}
// If the property type is IInspectable, and we have a nested IPropertyValue, then we need
}
// Otherwise, this is an invalid coersion
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", type, typeof(T).Name), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, type, typeof (T).Name), __HResults.TYPE_E_TYPEMISMATCH);
}
private static bool IsCoercable(PropertyType type, object data)
if (_data.GetType() != expectedBoxedType)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", _data.GetType(), expectedBoxedType.Name), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, _data.GetType(), expectedBoxedType.Name), __HResults.TYPE_E_TYPEMISMATCH);
}
T unboxed = new T();
Array dataArray = _data as Array;
if (dataArray == null || _data.GetType().GetElementType() != expectedArrayElementType)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", _data.GetType(), expectedArrayElementType.MakeArrayType().Name), __HResults.TYPE_E_TYPEMISMATCH);
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, _data.GetType(), expectedArrayElementType.MakeArrayType().Name), __HResults.TYPE_E_TYPEMISMATCH);
}
T[] converted = new T[dataArray.Length];
if (!found)
{
- Exception e = new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound"));
+ Exception e = new KeyNotFoundException(SR.Arg_KeyNotFound);
e.SetErrorCode(__HResults.E_BOUNDS);
throw e;
}
{
get
{
- if (_current < _start) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
- if (_current > _end) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded));
+ if (_current < _start) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
+ if (_current > _end) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded));
return new CLRIKeyValuePairImpl<TKey, TValue>(ref _array[_current]);
}
}
MethodInfo accessor = getValue ? m_property.GetGetMethod(true) : m_property.GetSetMethod(true);
if (accessor == null)
- throw new ArgumentException(System.Environment.GetResourceString(getValue ? "Arg_GetMethNotFnd" : "Arg_SetMethNotFnd"));
+ throw new ArgumentException(getValue ? SR.Arg_GetMethNotFnd : SR.Arg_SetMethNotFnd);
if (!accessor.IsPublic)
throw new MethodAccessException(
String.Format(
CultureInfo.CurrentCulture,
- Environment.GetResourceString("Arg_MethodAccessException_WithMethodName"),
+ SR.Arg_MethodAccessException_WithMethodName,
accessor.ToString(),
accessor.DeclaringType.FullName));
RuntimeMethodInfo rtMethod = accessor as RuntimeMethodInfo;
if (rtMethod == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo);
// We can safely skip access check because this is only used in full trust scenarios.
// And we have already verified that the property accessor is public.
if (index < 0)
throw new ArgumentOutOfRangeException(nameof(index));
if (array.Length <= index && this.Count > 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException"));
+ throw new ArgumentException(SR.Arg_IndexOutOfRangeException);
if (array.Length - index < dictionary.Count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection"));
+ throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection);
int i = index;
foreach (KeyValuePair<TKey, TValue> mapping in dictionary)
void ICollection<TKey>.Add(TKey item)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_KeyCollectionSet"));
+ throw new NotSupportedException(SR.NotSupported_KeyCollectionSet);
}
void ICollection<TKey>.Clear()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_KeyCollectionSet"));
+ throw new NotSupportedException(SR.NotSupported_KeyCollectionSet);
}
public bool Contains(TKey item)
bool ICollection<TKey>.Remove(TKey item)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_KeyCollectionSet"));
+ throw new NotSupportedException(SR.NotSupported_KeyCollectionSet);
}
IEnumerator IEnumerable.GetEnumerator()
if (!keyFound)
{
- Exception e = new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound"));
+ Exception e = new KeyNotFoundException(SR.Arg_KeyNotFound);
e.SetErrorCode(__HResults.E_BOUNDS);
throw e;
}
if (!removed)
{
- Exception e = new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound"));
+ Exception e = new KeyNotFoundException(SR.Arg_KeyNotFound);
e.SetErrorCode(__HResults.E_BOUNDS);
throw e;
}
if (index < 0)
throw new ArgumentOutOfRangeException(nameof(index));
if (array.Length <= index && this.Count > 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException"));
+ throw new ArgumentException(SR.Arg_IndexOutOfRangeException);
if (array.Length - index < dictionary.Count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection"));
+ throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection);
int i = index;
foreach (KeyValuePair<TKey, TValue> mapping in dictionary)
void ICollection<TValue>.Add(TValue item)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ValueCollectionSet"));
+ throw new NotSupportedException(SR.NotSupported_ValueCollectionSet);
}
void ICollection<TValue>.Clear()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ValueCollectionSet"));
+ throw new NotSupportedException(SR.NotSupported_ValueCollectionSet);
}
public bool Contains(TValue item)
bool ICollection<TValue>.Remove(TValue item)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ValueCollectionSet"));
+ throw new NotSupportedException(SR.NotSupported_ValueCollectionSet);
}
IEnumerator IEnumerable.GetEnumerator()
// static check at construction time
if (!typeof(Delegate).IsAssignableFrom(typeof(T)))
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EventTokenTableRequiresDelegate", typeof(T)));
+ throw new InvalidOperationException(SR.Format(SR.InvalidOperation_EventTokenTableRequiresDelegate, typeof (T)));
}
}
catch (Exception ex)
{
if (__HResults.E_BOUNDS == ex._HResult)
- throw new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound"));
+ throw new KeyNotFoundException(SR.Arg_KeyNotFound);
throw;
}
}
if (index < 0)
throw new ArgumentOutOfRangeException(nameof(index));
if (array.Length <= index && this.Count > 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException"));
+ throw new ArgumentException(SR.Arg_IndexOutOfRangeException);
if (array.Length - index < dictionary.Count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection"));
+ throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection);
int i = index;
foreach (KeyValuePair<TKey, TValue> mapping in dictionary)
if (index < 0)
throw new ArgumentOutOfRangeException(nameof(index));
if (array.Length <= index && this.Count > 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException"));
+ throw new ArgumentException(SR.Arg_IndexOutOfRangeException);
if (array.Length - index < dictionary.Count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection"));
+ throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection);
int i = index;
foreach (KeyValuePair<TKey, TValue> mapping in dictionary)
if (!keyFound)
{
- Exception e = new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound"));
+ Exception e = new KeyNotFoundException(SR.Arg_KeyNotFound);
e.SetErrorCode(__HResults.E_BOUNDS);
throw e;
}
// that Size > Int32.MaxValue:
if (((uint)Int32.MaxValue) <= index || index >= (uint)listCapacity)
{
- Exception e = new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_IndexLargerThanMaxValue"));
+ Exception e = new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_IndexLargerThanMaxValue);
e.SetErrorCode(__HResults.E_BOUNDS);
throw e;
}
IList _this = JitHelpers.UnsafeCast<IList>(this);
if (_this.Count == 0)
{
- Exception e = new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotRemoveLastFromEmptyCollection"));
+ Exception e = new InvalidOperationException(SR.InvalidOperation_CannotRemoveLastFromEmptyCollection);
e.SetErrorCode(__HResults.E_BOUNDS);
throw e;
}
// that Size > Int32.MaxValue:
if (((uint)Int32.MaxValue) <= index || index >= (uint)listCapacity)
{
- Exception e = new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_IndexLargerThanMaxValue"));
+ Exception e = new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_IndexLargerThanMaxValue);
e.SetErrorCode(__HResults.E_BOUNDS);
throw e;
}
// that Size > Int32.MaxValue:
if (((uint)Int32.MaxValue) <= index || index >= (uint)listCapacity)
{
- Exception e = new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_IndexLargerThanMaxValue"));
+ Exception e = new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_IndexLargerThanMaxValue);
e.SetErrorCode(__HResults.E_BOUNDS);
throw e;
}
IList<T> _this = JitHelpers.UnsafeCast<IList<T>>(this);
if (_this.Count == 0)
{
- Exception e = new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotRemoveLastFromEmptyCollection"));
+ Exception e = new InvalidOperationException(SR.InvalidOperation_CannotRemoveLastFromEmptyCollection);
e.SetErrorCode(__HResults.E_BOUNDS);
throw e;
}
// that Size > Int32.MaxValue:
if (((uint)Int32.MaxValue) <= index || index >= (uint)listCapacity)
{
- Exception e = new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_IndexLargerThanMaxValue"));
+ Exception e = new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_IndexLargerThanMaxValue);
e.SetErrorCode(__HResults.E_BOUNDS);
throw e;
}
// Check whether the type is "exported to WinRT", i.e. it is declared in a managed .winmd and is decorated
// with at least one ActivatableAttribute or StaticAttribute.
if (!(type is RuntimeType) || !type.IsExportedToWindowsRuntime)
- throw new ArgumentException(Environment.GetResourceString("Argument_TypeNotActivatableViaWindowsRuntime", type), nameof(type));
+ throw new ArgumentException(SR.Format(SR.Argument_TypeNotActivatableViaWindowsRuntime, type), nameof(type));
m_type = type;
}
if (((uint)Int32.MaxValue) < size)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingDictionaryTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingDictionaryTooLarge);
}
return (int)size;
if (((uint)Int32.MaxValue) < size)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
return (int)size;
throw new ArgumentOutOfRangeException(nameof(arrayIndex));
if (array.Length <= arrayIndex && Count<K, V>() > 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_IndexOutOfArrayBounds"));
+ throw new ArgumentException(SR.Argument_IndexOutOfArrayBounds);
if (array.Length - arrayIndex < Count<K, V>())
- throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection"));
+ throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection);
Contract.EndContractBlock();
if (((uint)Int32.MaxValue) < index)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
VectorToListAdapter.RemoveAtHelper<KeyValuePair<K, V>>(_this_vector, index);
throw new ArgumentNullException(nameof(key));
if (ContainsKey<K, V>(key))
- throw new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicate"));
+ throw new ArgumentException(SR.Argument_AddingDuplicate);
Contract.EndContractBlock();
catch (Exception ex)
{
if (__HResults.E_BOUNDS == ex._HResult)
- throw new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound"));
+ throw new KeyNotFoundException(SR.Arg_KeyNotFound);
throw;
}
}
if (((uint)Int32.MaxValue) < size)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingDictionaryTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingDictionaryTooLarge);
}
return (int)size;
if (((uint)Int32.MaxValue) < size)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
return (int)size;
uint size = _this.Size;
if (((uint)Int32.MaxValue) < size)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
return (int)size;
throw new ArgumentOutOfRangeException(nameof(arrayIndex));
if (array.Length <= arrayIndex && Count<T>() > 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_IndexOutOfArrayBounds"));
+ throw new ArgumentException(SR.Argument_IndexOutOfArrayBounds);
if (array.Length - arrayIndex < Count<T>())
- throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection"));
+ throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection);
Contract.EndContractBlock();
if (((uint)Int32.MaxValue) < index)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
VectorToListAdapter.RemoveAtHelper<T>(_this, index);
if (((uint)Int32.MaxValue) < index)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
return (int)index;
uint size = _this.Size;
if (((uint)Int32.MaxValue) < size)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge"));
+ throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge);
}
return (int)size;
string message = innerException.Message;
if (message == null && messageResource != null)
{
- message = Environment.GetResourceString(messageResource);
+ message = SR.GetResourceString(messageResource);
}
e = new Exception(message, innerException);
}
else
{
- string message = (messageResource != null ? Environment.GetResourceString(messageResource) : null);
+ string message = (messageResource != null ? SR.GetResourceString(messageResource): null);
e = new Exception(message);
}
public static IntPtr StringToHString(String s)
{
if (!Environment.IsWinRTSupported)
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT);
if (s == null)
throw new ArgumentNullException(nameof(s));
{
if (!Environment.IsWinRTSupported)
{
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT);
}
return HStringToString(ptr);
public static void FreeHString(IntPtr ptr)
{
if (!Environment.IsWinRTSupported)
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT);
if (ptr != IntPtr.Zero)
{
{
if (String.IsNullOrEmpty(assemblyFile))
{ // DesignerNamespaceResolve event returned null or empty file name - that is not allowed
- throw new ArgumentException(Environment.GetResourceString("Arg_EmptyOrNullString"), "DesignerNamespaceResolveEventArgs.ResolvedAssemblyFiles");
+ throw new ArgumentException(SR.Arg_EmptyOrNullString, "DesignerNamespaceResolveEventArgs.ResolvedAssemblyFiles");
}
retAssemblyFiles[retIndex] = assemblyFile;
retIndex++;
if (PathInternal.IsPartiallyQualified(assemblyPath))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), nameof(assemblyPath));
+ throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(assemblyPath));
}
RuntimeAssembly loadedAssembly = null;
if (PathInternal.IsPartiallyQualified(nativeImagePath))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), nameof(nativeImagePath));
+ throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(nativeImagePath));
}
if (assemblyPath != null && PathInternal.IsPartiallyQualified(assemblyPath))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), nameof(assemblyPath));
+ throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(assemblyPath));
}
// Basic validation has succeeded - lets try to load the NI image.
if (assembly.Length <= 0)
{
- throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_BadILFormat"));
+ throw new BadImageFormatException(SR.BadImageFormat_BadILFormat);
}
int iAssemblyStreamLength = (int)assembly.Length;
// The simple names should match at the very least
if (String.IsNullOrEmpty(loadedSimpleName) || (!requestedSimpleName.Equals(loadedSimpleName, StringComparison.InvariantCultureIgnoreCase)))
- throw new InvalidOperationException(Environment.GetResourceString("Argument_CustomAssemblyLoadContextRequestedNameMismatch"));
+ throw new InvalidOperationException(SR.Argument_CustomAssemblyLoadContextRequestedNameMismatch);
return assembly;
}
// throw an exception if we do not find any assembly.
if (assembly == null)
{
- throw new FileNotFoundException(Environment.GetResourceString("IO.FileLoad"), simpleName);
+ throw new FileNotFoundException(SR.IO_FileLoad, simpleName);
}
return assembly;
}
if (unmanagedDllPath.Length == 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyPath"), nameof(unmanagedDllPath));
+ throw new ArgumentException(SR.Argument_EmptyPath, nameof(unmanagedDllPath));
}
if (PathInternal.IsPartiallyQualified(unmanagedDllPath))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), nameof(unmanagedDllPath));
+ throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(unmanagedDllPath));
}
return InternalLoadUnmanagedDllFromPath(unmanagedDllPath);
public MemoryFailPoint(int sizeInMegabytes)
{
if (sizeInMegabytes <= 0)
- throw new ArgumentOutOfRangeException(nameof(sizeInMegabytes), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(sizeInMegabytes), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
#if !FEATURE_PAL // Remove this when CheckForAvailableMemory is able to provide legitimate estimates
// heap, and to check both the normal & large object heaps.
ulong segmentSize = (ulong)(Math.Ceiling((double)size / GCSegmentSize) * GCSegmentSize);
if (segmentSize >= TopOfMemory)
- throw new InsufficientMemoryException(Environment.GetResourceString("InsufficientMemory_MemFailPoint_TooBig"));
+ throw new InsufficientMemoryException(SR.InsufficientMemory_MemFailPoint_TooBig);
ulong requestedSizeRounded = (ulong)(Math.Ceiling((double)sizeInMegabytes / MemoryCheckGranularity) * MemoryCheckGranularity);
//re-convert into bytes
// state.
if (needPageFile || needAddressSpace)
{
- InsufficientMemoryException e = new InsufficientMemoryException(Environment.GetResourceString("InsufficientMemory_MemFailPoint"));
+ InsufficientMemoryException e = new InsufficientMemoryException(SR.InsufficientMemory_MemFailPoint);
#if _DEBUG
e.Data["MemFailPointState"] = new MemoryFailPointState(sizeInMegabytes, segmentSize,
needPageFile, needAddressSpace, needContiguousVASpace,
if (needContiguousVASpace)
{
- InsufficientMemoryException e = new InsufficientMemoryException(Environment.GetResourceString("InsufficientMemory_MemFailPoint_VAFrag"));
+ InsufficientMemoryException e = new InsufficientMemoryException(SR.InsufficientMemory_MemFailPoint_VAFrag);
#if _DEBUG
e.Data["MemFailPointState"] = new MemoryFailPointState(sizeInMegabytes, segmentSize,
needPageFile, needAddressSpace, needContiguousVASpace,
LastTimeCheckingAddressSpace = Environment.TickCount;
if (freeSpaceAfterGCHeap < size && shouldThrow)
- throw new InsufficientMemoryException(Environment.GetResourceString("InsufficientMemory_MemFailPoint_VAFrag"));
+ throw new InsufficientMemoryException(SR.InsufficientMemory_MemFailPoint_VAFrag);
return freeSpaceAfterGCHeap >= size;
}
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
if (!(type is RuntimeType))
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidType", type.ToString()));
+ throw new SerializationException(SR.Format(SR.Serialization_InvalidType, type.ToString()));
}
return nativeGetUninitializedObject((RuntimeType)type);
set
{
if (value < 1)
- throw new ArgumentException(Environment.GetResourceString("Serialization_OptionalFieldVersionValue"));
+ throw new ArgumentException(SR.Serialization_OptionalFieldVersionValue);
Contract.EndContractBlock();
versionAdded = value;
}
[Serializable]
public class SerializationException : SystemException
{
- private static String _nullMessage = Environment.GetResourceString("Arg_SerializationException");
+ private static String _nullMessage = SR.Arg_SerializationException;
// Creates a new SerializationException with its message
// string set to a default message.
if (m_nameToIndex.ContainsKey(name))
{
BCLDebug.Trace("SER", "[SerializationInfo.AddValue]Tried to add ", name, " twice to the SI.");
- throw new SerializationException(Environment.GetResourceString("Serialization_SameNameTwice"));
+ throw new SerializationException(SR.Serialization_SameNameTwice);
}
m_nameToIndex.Add(name, m_currMember);
int index = FindElement(name);
if (index == -1)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_NotFound", name));
+ throw new SerializationException(SR.Format(SR.Serialization_NotFound, name));
}
Debug.Assert(index < m_data.Length, "[SerializationInfo.GetElement]index<m_data.Length");
RuntimeType rt = type as RuntimeType;
if (rt == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeType);
Type foundType;
Object value;
{
if (m_current == false)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
return (Object)(new SerializationEntry(m_members[m_currItem], m_data[m_currItem], m_types[m_currItem]));
}
{
if (m_current == false)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
return (new SerializationEntry(m_members[m_currItem], m_data[m_currItem], m_types[m_currItem]));
}
{
if (m_current == false)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
return m_members[m_currItem];
}
{
if (m_current == false)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
return m_data[m_currItem];
}
{
if (m_current == false)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
+ throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen);
}
return m_types[m_currItem];
}
// Create local copy to avoid a race condition
RuntimeType type = m_type;
if (type == null)
- throw new ArgumentNullException(null, Environment.GetResourceString("Arg_InvalidHandle"));
+ throw new ArgumentNullException(null, SR.Arg_InvalidHandle);
return new RuntimeTypeHandle(type);
}
// Create local copy to avoid a race condition
RuntimeType type = m_type;
if (type == null)
- throw new ArgumentNullException(null, Environment.GetResourceString("Arg_InvalidHandle"));
+ throw new ArgumentNullException(null, SR.Arg_InvalidHandle);
return type;
}
if (name == null || name.Length == 0)
{
if (throwOnError)
- throw new TypeLoadException(Environment.GetResourceString("Arg_TypeLoadNullStr"));
+ throw new TypeLoadException(SR.Arg_TypeLoadNullStr);
return null;
}
RuntimeType type = GetTypeChecked();
if (!IsGenericVariable(type))
- throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericParameter"));
+ throw new InvalidOperationException(SR.Arg_NotGenericParameter);
return GetGenericVariableIndex(type);
}
m_type = m;
if (m_type == null)
- throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState"));
+ throw new SerializationException(SR.Serialization_InsufficientState);
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
Contract.EndContractBlock();
if (m_type == null)
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidFieldState"));
+ throw new SerializationException(SR.Serialization_InvalidFieldState);
info.AddValue("TypeObj", m_type, typeof(RuntimeType));
}
internal static IRuntimeMethodInfo EnsureNonNullMethodInfo(IRuntimeMethodInfo method)
{
if (method == null)
- throw new ArgumentNullException(null, Environment.GetResourceString("Arg_InvalidHandle"));
+ throw new ArgumentNullException(null, SR.Arg_InvalidHandle);
return method;
}
m_value = m.MethodHandle.m_value;
if (m_value == null)
- throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState"));
+ throw new SerializationException(SR.Serialization_InsufficientState);
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
Contract.EndContractBlock();
if (m_value == null)
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidFieldState"));
+ throw new SerializationException(SR.Serialization_InvalidFieldState);
// This is either a RuntimeMethodInfo or a RuntimeConstructorInfo
MethodBase methodInfo = RuntimeType.GetMethodBase(m_value);
// Create local copy to avoid a race condition
IRuntimeFieldInfo field = m_ptr;
if (field == null)
- throw new ArgumentNullException(null, Environment.GetResourceString("Arg_InvalidHandle"));
+ throw new ArgumentNullException(null, SR.Arg_InvalidHandle);
return new RuntimeFieldHandle(field);
}
FieldInfo f = (RuntimeFieldInfo)info.GetValue("FieldObj", typeof(RuntimeFieldInfo));
if (f == null)
- throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState"));
+ throw new SerializationException(SR.Serialization_InsufficientState);
m_ptr = f.FieldHandle.m_ptr;
if (m_ptr == null)
- throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState"));
+ throw new SerializationException(SR.Serialization_InsufficientState);
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
Contract.EndContractBlock();
if (m_ptr == null)
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidFieldState"));
+ throw new SerializationException(SR.Serialization_InvalidFieldState);
RuntimeFieldInfo fldInfo = (RuntimeFieldInfo)RuntimeType.GetFieldInfo(this.GetRuntimeFieldInfo());
{
// Make sure we have a valid Module to resolve against.
if (module == null)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NullModuleHandle"));
+ throw new InvalidOperationException(SR.InvalidOperation_NullModuleHandle);
}
// SQL-CLR LKG9 Compiler dependency
ValidateModulePointer(module);
if (!ModuleHandle.GetMetadataImport(module).IsValidToken(typeToken))
throw new ArgumentOutOfRangeException(nameof(typeToken),
- Environment.GetResourceString("Argument_InvalidToken", typeToken, new ModuleHandle(module)));
+ SR.Format(SR.Argument_InvalidToken, typeToken, new ModuleHandle(module)));
int typeInstCount, methodInstCount;
IntPtr[] typeInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, out typeInstCount);
ValidateModulePointer(module);
if (!ModuleHandle.GetMetadataImport(module.GetNativeHandle()).IsValidToken(methodToken))
throw new ArgumentOutOfRangeException(nameof(methodToken),
- Environment.GetResourceString("Argument_InvalidToken", methodToken, new ModuleHandle(module)));
+ SR.Format(SR.Argument_InvalidToken, methodToken, new ModuleHandle(module)));
fixed (IntPtr* typeInstArgs = typeInstantiationContext, methodInstArgs = methodInstantiationContext)
{
ValidateModulePointer(module);
if (!ModuleHandle.GetMetadataImport(module.GetNativeHandle()).IsValidToken(fieldToken))
throw new ArgumentOutOfRangeException(nameof(fieldToken),
- Environment.GetResourceString("Argument_InvalidToken", fieldToken, new ModuleHandle(module)));
+ SR.Format(SR.Argument_InvalidToken, fieldToken, new ModuleHandle(module)));
// defensive copy to be sure array is not mutated from the outside during processing
int typeInstCount, methodInstCount;
}
if (!(obj is SByte))
{
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeSByte"));
+ throw new ArgumentException(SR.Arg_MustBeSByte);
}
return m_value - ((SByte)obj).m_value;
}
}
catch (OverflowException e)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_SByte"), e);
+ throw new OverflowException(SR.Overflow_SByte, e);
}
if ((style & NumberStyles.AllowHexSpecifier) != 0)
{ // We are parsing a hexadecimal number
if ((i < 0) || i > Byte.MaxValue)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_SByte"));
+ throw new OverflowException(SR.Overflow_SByte);
}
return (sbyte)i;
}
- if (i < MinValue || i > MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_SByte"));
+ if (i < MinValue || i > MaxValue) throw new OverflowException(SR.Overflow_SByte);
return (sbyte)i;
}
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "SByte", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "SByte", "DateTime"));
}
/// <internalonly/>
PathInternal.MaxLongPath))
#endif
{
- throw new PathTooLongException(Environment.GetResourceString("IO.PathTooLong"));
+ throw new PathTooLongException(SR.IO_PathTooLong);
}
}
}
public class VerificationException : SystemException
{
public VerificationException()
- : base(Environment.GetResourceString("Verification_Exception"))
+ : base(SR.Verification_Exception)
{
SetErrorCode(__HResults.COR_E_VERIFICATION);
}
else // f is NaN.
return 1;
}
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeSingle"));
+ throw new ArgumentException(SR.Arg_MustBeSingle);
}
/// <internalonly/>
char IConvertible.ToChar(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Single", "Char"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Single", "Char"));
}
/// <internalonly/>
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Single", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Single", "DateTime"));
}
/// <internalonly/>
// Single comparison to check if comparisonType is within [CurrentCulture .. OrdinalIgnoreCase]
if ((uint)(comparisonType - StringComparison.CurrentCulture) > (uint)(StringComparison.OrdinalIgnoreCase - StringComparison.CurrentCulture))
{
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
Contract.EndContractBlock();
return CompareInfo.CompareOrdinalIgnoreCase(strA, 0, strA.Length, strB, 0, strB.Length);
default:
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_StringComparison"));
+ throw new NotSupportedException(SR.NotSupported_StringComparison);
}
}
{
if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase)
{
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
Contract.EndContractBlock();
if (length < 0)
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength);
}
if (indexA < 0 || indexB < 0)
{
string paramName = indexA < 0 ? nameof(indexA) : nameof(indexB);
- throw new ArgumentOutOfRangeException(paramName, Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(paramName, SR.ArgumentOutOfRange_Index);
}
if (strA.Length - indexA < 0 || strB.Length - indexB < 0)
{
string paramName = strA.Length - indexA < 0 ? nameof(indexA) : nameof(indexB);
- throw new ArgumentOutOfRangeException(paramName, Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(paramName, SR.ArgumentOutOfRange_Index);
}
if (length == 0 || (object.ReferenceEquals(strA, strB) && indexA == indexB))
return (CompareInfo.CompareOrdinalIgnoreCase(strA, indexA, lengthA, strB, indexB, lengthB));
default:
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"));
+ throw new ArgumentException(SR.NotSupported_StringComparison);
}
}
if (length < 0)
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeCount"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeCount);
}
if (indexA < 0 || indexB < 0)
{
string paramName = indexA < 0 ? nameof(indexA) : nameof(indexB);
- throw new ArgumentOutOfRangeException(paramName, Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(paramName, SR.ArgumentOutOfRange_Index);
}
int lengthA = Math.Min(length, strA.Length - indexA);
if (lengthA < 0 || lengthB < 0)
{
string paramName = lengthA < 0 ? nameof(indexA) : nameof(indexB);
- throw new ArgumentOutOfRangeException(paramName, Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(paramName, SR.ArgumentOutOfRange_Index);
}
if (length == 0 || (object.ReferenceEquals(strA, strB) && indexA == indexB))
if (other == null)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeString"));
+ throw new ArgumentException(SR.Arg_MustBeString);
}
return CompareTo(other); // will call the string-based overload
if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase)
{
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
Contract.EndContractBlock();
case StringComparison.OrdinalIgnoreCase:
return this.Length < value.Length ? false : (CompareInfo.CompareOrdinalIgnoreCase(this, this.Length - value.Length, value.Length, value, 0, value.Length) == 0);
default:
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
}
public bool Equals(String value, StringComparison comparisonType)
{
if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase)
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
Contract.EndContractBlock();
if ((Object)this == (Object)value)
return (CompareInfo.CompareOrdinalIgnoreCase(this, 0, this.Length, value, 0, value.Length) == 0);
default:
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
}
public static bool Equals(String a, String b, StringComparison comparisonType)
{
if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase)
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
Contract.EndContractBlock();
if ((Object)a == (Object)b)
}
default:
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
}
if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase)
{
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
Contract.EndContractBlock();
return (CompareInfo.CompareOrdinalIgnoreCase(this, 0, value.Length, value, 0, value.Length) == 0);
default:
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
}
}
if (startIndex < 0)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NegativeCount"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NegativeCount);
}
if (startIndex > value.Length - count)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_IndexCountBuffer);
}
if (count <= 1)
public String PadLeft(int totalWidth, char paddingChar)
{
if (totalWidth < 0)
- throw new ArgumentOutOfRangeException(nameof(totalWidth), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(totalWidth), SR.ArgumentOutOfRange_NeedNonNegNum);
int oldLength = Length;
int count = totalWidth - oldLength;
if (count <= 0)
public String PadRight(int totalWidth, char paddingChar)
{
if (totalWidth < 0)
- throw new ArgumentOutOfRangeException(nameof(totalWidth), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(totalWidth), SR.ArgumentOutOfRange_NeedNonNegNum);
int oldLength = Length;
int count = totalWidth - oldLength;
if (count <= 0)
{
if (startIndex < 0)
throw new ArgumentOutOfRangeException(nameof(startIndex),
- Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ SR.ArgumentOutOfRange_StartIndex);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NegativeCount"));
+ SR.ArgumentOutOfRange_NegativeCount);
if (count > Length - startIndex)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCount"));
+ SR.ArgumentOutOfRange_IndexCount);
Contract.Ensures(Contract.Result<String>() != null);
Contract.Ensures(Contract.Result<String>().Length == this.Length - count);
Contract.EndContractBlock();
if (startIndex < 0)
{
throw new ArgumentOutOfRangeException(nameof(startIndex),
- Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ SR.ArgumentOutOfRange_StartIndex);
}
if (startIndex >= Length)
{
throw new ArgumentOutOfRangeException(nameof(startIndex),
- Environment.GetResourceString("ArgumentOutOfRange_StartIndexLessThanLength"));
+ SR.ArgumentOutOfRange_StartIndexLessThanLength);
}
Contract.Ensures(Contract.Result<String>() != null);
return ReplaceCore(oldValue, newValue, CultureInfo.InvariantCulture, CompareOptions.OrdinalIgnoreCase);
default:
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
}
{
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NegativeCount"));
+ SR.ArgumentOutOfRange_NegativeCount);
if (options < StringSplitOptions.None || options > StringSplitOptions.RemoveEmptyEntries)
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", options));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, options));
Contract.Ensures(Contract.Result<String[]>() != null);
Contract.EndContractBlock();
if (count < 0)
{
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NegativeCount"));
+ SR.ArgumentOutOfRange_NegativeCount);
}
if (options < StringSplitOptions.None || options > StringSplitOptions.RemoveEmptyEntries)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)options));
+ throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)options));
}
Contract.EndContractBlock();
//Bounds Checking.
if (startIndex < 0)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
if (startIndex > Length)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndexLargerThanLength"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndexLargerThanLength);
}
if (length < 0)
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength);
}
if (startIndex > Length - length)
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_IndexLength"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_IndexLength);
}
Contract.EndContractBlock();
public unsafe int IndexOf(char value, int startIndex, int count)
{
if (startIndex < 0 || startIndex > Length)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
if (count < 0 || count > Length - startIndex)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
fixed (char* pChars = &m_firstChar)
{
{
if (startIndex < 0 || startIndex > this.Length)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
}
if (count < 0 || count > this.Length - startIndex)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
}
Contract.EndContractBlock();
throw new ArgumentNullException(nameof(value));
if (startIndex < 0 || startIndex > this.Length)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
if (count < 0 || startIndex > this.Length - count)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
Contract.EndContractBlock();
switch (comparisonType)
return TextInfo.IndexOfStringOrdinalIgnoreCase(this, value, startIndex, count);
default:
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
}
return -1;
if (startIndex < 0 || startIndex >= Length)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
if (count < 0 || count - 1 > startIndex)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
fixed (char* pChars = &m_firstChar)
{
{
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
}
Contract.EndContractBlock();
// Now after handling empty strings, make sure we're not out of range
if (startIndex < 0 || startIndex > this.Length)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
// Make sure that we allow startIndex == this.Length
if (startIndex == this.Length)
// 2nd half of this also catches when startIndex == MAXINT, so MAXINT - 0 + 1 == -1, which is < 0.
if (count < 0 || startIndex - count + 1 < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
switch (comparisonType)
else
return TextInfo.LastIndexOfStringOrdinalIgnoreCase(this, value, startIndex, count);
default:
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
}
}
if (destination == null)
throw new ArgumentNullException(nameof(destination));
if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NegativeCount"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NegativeCount);
if (sourceIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(sourceIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(sourceIndex), SR.ArgumentOutOfRange_Index);
if (count > Length - sourceIndex)
- throw new ArgumentOutOfRangeException(nameof(sourceIndex), Environment.GetResourceString("ArgumentOutOfRange_IndexCount"));
+ throw new ArgumentOutOfRangeException(nameof(sourceIndex), SR.ArgumentOutOfRange_IndexCount);
if (destinationIndex > destination.Length - count || destinationIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(destinationIndex), Environment.GetResourceString("ArgumentOutOfRange_IndexCount"));
+ throw new ArgumentOutOfRangeException(nameof(destinationIndex), SR.ArgumentOutOfRange_IndexCount);
Contract.EndContractBlock();
// Note: fixed does not like empty arrays
{
// Range check everything.
if (startIndex < 0 || startIndex > Length || startIndex > Length - length)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
if (length < 0)
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_Index);
Contract.EndContractBlock();
if (length > 0)
return new String(value, startIndex, length); // default to ANSI
if (length < 0)
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NeedNonNegNum);
if (startIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
if ((value + startIndex) < value)
{
// overflow check
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_PartialWCHAR"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_PartialWCHAR);
}
byte[] b = new byte[length];
// If we got a NullReferencException. It means the pointer or
// the index is out of range
throw new ArgumentOutOfRangeException(nameof(value),
- Environment.GetResourceString("ArgumentOutOfRange_PartialWCHAR"));
+ SR.ArgumentOutOfRange_PartialWCHAR);
}
return enc.GetString(b);
if (0 != DefaultCharUsed)
{
- throw new ArgumentException(Environment.GetResourceString("Interop_Marshal_Unmappable_Char"));
+ throw new ArgumentException(SR.Interop_Marshal_Unmappable_Char);
}
pbNativeBuffer[nb] = 0;
throw new ArgumentNullException(nameof(value));
if (startIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
if (length < 0)
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength);
if (startIndex > value.Length - length)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
Contract.EndContractBlock();
if (length > 0)
else if (count == 0)
return String.Empty;
else
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegNum", nameof(count)));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.ArgumentOutOfRange_MustBeNonNegNum, nameof(count)));
}
private static unsafe int wcslen(char* ptr)
#if !FEATURE_PAL
if (ptr < (char*)64000)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeStringPtrNotAtom"));
+ throw new ArgumentException(SR.Arg_MustBeStringPtrNotAtom);
#endif // FEATURE_PAL
Debug.Assert(this == null, "this == null"); // this is the string constructor, we allocate it
}
catch (NullReferenceException)
{
- throw new ArgumentOutOfRangeException(nameof(ptr), Environment.GetResourceString("ArgumentOutOfRange_PartialWCHAR"));
+ throw new ArgumentOutOfRangeException(nameof(ptr), SR.ArgumentOutOfRange_PartialWCHAR);
}
}
{
if (length < 0)
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength);
}
if (startIndex < 0)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
Contract.EndContractBlock();
Debug.Assert(this == null, "this == null"); // this is the string constructor, we allocate it
if (pFrom < ptr)
{
// This means that the pointer operation has had an overflow
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_PartialWCHAR"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_PartialWCHAR);
}
if (length == 0)
}
catch (NullReferenceException)
{
- throw new ArgumentOutOfRangeException(nameof(ptr), Environment.GetResourceString("ArgumentOutOfRange_PartialWCHAR"));
+ throw new ArgumentOutOfRangeException(nameof(ptr), SR.ArgumentOutOfRange_PartialWCHAR);
}
}
case StringComparison.OrdinalIgnoreCase:
return OrdinalIgnoreCase;
default:
- throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType));
+ throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
}
return ia.CompareTo(y);
}
- throw new ArgumentException(Environment.GetResourceString("Argument_ImplementIComparable"));
+ throw new ArgumentException(SR.Argument_ImplementIComparable);
}
internal static unsafe IntPtr ConvertToNative(string managed)
{
if (!Environment.IsWinRTSupported)
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT);
if (managed == null)
throw new ArgumentNullException(); // We don't have enough information to get the argument name
[Out] HSTRING_HEADER* hstringHeader)
{
if (!Environment.IsWinRTSupported)
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT);
if (managed == null)
throw new ArgumentNullException(); // We don't have enough information to get the argument name
{
if (!Environment.IsWinRTSupported)
{
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT);
}
return WindowsRuntimeMarshal.HStringToString(hstring);
}
default:
- throw new ArgumentException(Environment.GetResourceString("Arg_NDirectBadObject"));
+ throw new ArgumentException(SR.Arg_NDirectBadObject);
}
// marshal the object as C-style array (UnmanagedType.LPArray)
return IntPtr.Zero;
if (pManagedHome is ArrayWithOffset)
- throw new ArgumentException(Environment.GetResourceString("Arg_MarshalAsAnyRestriction"));
+ throw new ArgumentException(SR.Arg_MarshalAsAnyRestriction);
IntPtr pNativeHome;
else
{
// this type is not supported for AsAny marshaling
- throw new ArgumentException(Environment.GetResourceString("Arg_NDirectBadObject"));
+ throw new ArgumentException(SR.Arg_NDirectBadObject);
}
}
{
if (!Environment.IsWinRTSupported)
{
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT);
}
string typeName;
{
if (managedType.GetType() != typeof(System.RuntimeType))
{ // The type should be exactly System.RuntimeType (and not its child System.ReflectionOnlyType, or other System.Type children)
- throw new ArgumentException(Environment.GetResourceString("Argument_WinRTSystemRuntimeType", managedType.GetType().ToString()));
+ throw new ArgumentException(SR.Format(SR.Argument_WinRTSystemRuntimeType, managedType.GetType().ToString()));
}
bool isPrimitive;
{
if (!Environment.IsWinRTSupported)
{
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT);
}
string typeName = WindowsRuntimeMarshal.HStringToString(pNativeType->typeName);
// TypeSource must match
if (isPrimitive != (pNativeType->typeKind == TypeKind.Primitive))
- throw new ArgumentException(Environment.GetResourceString("Argument_Unexpected_TypeSource"));
+ throw new ArgumentException(SR.Argument_Unexpected_TypeSource);
}
}
{
if (!Environment.IsWinRTSupported)
{
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT);
}
if (ex == null)
if (!Environment.IsWinRTSupported)
{
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT);
}
Exception e = null;
{
if (length > 0x7ffffff0)
{
- throw new MarshalDirectiveException(Environment.GetResourceString("Marshaler_StringTooLong"));
+ throw new MarshalDirectiveException(SR.Marshaler_StringTooLong);
}
}
// We always need the fallback buffer in get bytes so we can flush any remaining ones if necessary
fallbackBuffer = encoder.FallbackBuffer;
if (fallbackBuffer.Remaining > 0 && encoder.m_throwOnOverflow)
- throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty",
- this.EncodingName, encoder.Fallback.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType()));
// Set our internal fallback interesting things.
fallbackBuffer.InternalInitialize(chars, charEnd, encoder, false);
// We always need the fallback buffer in get bytes so we can flush any remaining ones if necessary
fallbackBuffer = encoder.FallbackBuffer;
if (fallbackBuffer.Remaining > 0 && encoder.m_throwOnOverflow)
- throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty",
- this.EncodingName, encoder.Fallback.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType()));
// Set our internal fallback interesting things.
fallbackBuffer.InternalInitialize(charStart, charEnd, encoder, true);
{
if (charCount < 0)
throw new ArgumentOutOfRangeException(nameof(charCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Characters would be # of characters + 1 in case high surrogate is ? * max fallback
// 1 to 1 for most characters. Only surrogates with fallbacks have less.
if (byteCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow);
return (int)byteCount;
}
{
if (byteCount < 0)
throw new ArgumentOutOfRangeException(nameof(byteCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Just return length, SBCS stay the same length because they don't map to surrogate
charCount *= DecoderFallback.MaxCharCount;
if (charCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_GetCharCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow);
return (int)charCount;
}
// Can't change fallback if buffer is wrong
if (m_fallbackBuffer != null && m_fallbackBuffer.Remaining > 0)
throw new ArgumentException(
- Environment.GetResourceString("Argument_FallbackBufferNotEmpty"), nameof(value));
+ SR.Argument_FallbackBufferNotEmpty, nameof(value));
m_fallback = value;
m_fallbackBuffer = null;
// Validate input parameters
if (bytes == null)
throw new ArgumentNullException(nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
byte[] arrbyte = new byte[count];
// Validate input parameters
if (chars == null || bytes == null)
throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (byteCount < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Get the byte array to convert
// Validate parameters
if (bytes == null || chars == null)
throw new ArgumentNullException((bytes == null ? nameof(bytes) : nameof(chars)),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (byteIndex < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (charIndex < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (bytes.Length - byteIndex < byteCount)
throw new ArgumentOutOfRangeException(nameof(bytes),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
if (chars.Length - charIndex < charCount)
throw new ArgumentOutOfRangeException(nameof(chars),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
Contract.EndContractBlock();
bytesUsed = byteCount;
}
// Oops, we didn't have anything, we'll have to throw an overflow
- throw new ArgumentException(Environment.GetResourceString("Argument_ConversionOverflow"));
+ throw new ArgumentException(SR.Argument_ConversionOverflow);
}
// This is the version that uses *.
// Validate input parameters
if (chars == null || bytes == null)
throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (byteCount < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Get ready to do it
}
// Oops, we didn't have anything, we'll have to throw an overflow
- throw new ArgumentException(Environment.GetResourceString("Argument_ConversionOverflow"));
+ throw new ArgumentException(SR.Argument_ConversionOverflow);
}
}
}
// Known index
throw new DecoderFallbackException(
- Environment.GetResourceString("Argument_InvalidCodePageBytesIndex",
- strBytes, index), bytesUnknown, index);
+ SR.Format(SR.Argument_InvalidCodePageBytesIndex, strBytes, index), bytesUnknown, index);
}
}
private int index = 0;
public DecoderFallbackException()
- : base(Environment.GetResourceString("Arg_ArgumentException"))
+ : base(SR.Arg_ArgumentException)
{
SetErrorCode(__HResults.COR_E_ARGUMENT);
}
{
// High Surrogate
if (bHighSurrogate)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex);
bHighSurrogate = true;
}
else
{
// Low surrogate
if (bHighSurrogate == false)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex);
bHighSurrogate = false;
}
}
// Need to make sure that bHighSurrogate isn't true
if (bHighSurrogate)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex);
// Now we aren't going to be false, so its OK to update chars
chars = charTemp;
{
// High Surrogate
if (bHighSurrogate)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex);
bHighSurrogate = true;
}
else
{
// Low surrogate
if (bHighSurrogate == false)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex);
bHighSurrogate = false;
}
}
// Need to make sure that bHighSurrogate isn't true
if (bHighSurrogate)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex);
return count;
}
// Throw it, using our complete bytes
throw new ArgumentException(
- Environment.GetResourceString("Argument_RecursiveFallbackBytes",
- strBytes.ToString()), nameof(bytesUnknown));
+ SR.Format(SR.Argument_RecursiveFallbackBytes, strBytes.ToString()), nameof(bytesUnknown));
}
}
}
throw new NotSupportedException(
String.Format(
System.Globalization.CultureInfo.CurrentCulture,
- Environment.GetResourceString("NotSupported_TypeCannotDeserialized"), this.GetType()));
+ SR.NotSupported_TypeCannotDeserialized, this.GetType()));
}
// ISerializable implementation. called during serialization.
// Validate Parameters
if (bytes == null)
throw new ArgumentNullException(nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (index < 0 || count < 0)
throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (bytes.Length - index < count)
throw new ArgumentOutOfRangeException(nameof(bytes),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
Contract.EndContractBlock();
// Validate parameters
if (bytes == null)
throw new ArgumentNullException(nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Remember the flush
// Validate Parameters
if (bytes == null || chars == null)
throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (byteIndex < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (bytes.Length - byteIndex < byteCount)
throw new ArgumentOutOfRangeException(nameof(bytes),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
if (charIndex < 0 || charIndex > chars.Length)
throw new ArgumentOutOfRangeException(nameof(charIndex),
- Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ SR.ArgumentOutOfRange_Index);
Contract.EndContractBlock();
// Validate parameters
if (chars == null || bytes == null)
throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (byteCount < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Remember our flush
// Validate parameters
if (bytes == null || chars == null)
throw new ArgumentNullException((bytes == null ? nameof(bytes) : nameof(chars)),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (byteIndex < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (charIndex < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (bytes.Length - byteIndex < byteCount)
throw new ArgumentOutOfRangeException(nameof(bytes),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
if (chars.Length - charIndex < charCount)
throw new ArgumentOutOfRangeException(nameof(chars),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
Contract.EndContractBlock();
// Validate input parameters
if (chars == null || bytes == null)
throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (byteCount < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// We don't want to throw
break;
}
if (bFoundHigh)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex", nameof(replacement)));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidCharSequenceNoIndex, nameof(replacement)));
strDefault = replacement;
}
// Can't change fallback if buffer is wrong
if (m_fallbackBuffer != null && m_fallbackBuffer.Remaining > 0)
throw new ArgumentException(
- Environment.GetResourceString("Argument_FallbackBufferNotEmpty"), nameof(value));
+ SR.Argument_FallbackBufferNotEmpty, nameof(value));
m_fallback = value;
m_fallbackBuffer = null;
// Validate input parameters
if (chars == null)
throw new ArgumentNullException(nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
char[] arrChar = new char[count];
// Validate input parameters
if (bytes == null || chars == null)
throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (charCount < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Get the char array to convert
// Validate parameters
if (chars == null || bytes == null)
throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (charIndex < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (byteIndex < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (chars.Length - charIndex < charCount)
throw new ArgumentOutOfRangeException(nameof(chars),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
if (bytes.Length - byteIndex < byteCount)
throw new ArgumentOutOfRangeException(nameof(bytes),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
Contract.EndContractBlock();
charsUsed = charCount;
}
// Oops, we didn't have anything, we'll have to throw an overflow
- throw new ArgumentException(Environment.GetResourceString("Argument_ConversionOverflow"));
+ throw new ArgumentException(SR.Argument_ConversionOverflow);
}
// Same thing, but using pointers
// Validate input parameters
if (bytes == null || chars == null)
throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (charCount < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Get ready to do it
}
// Oops, we didn't have anything, we'll have to throw an overflow
- throw new ArgumentException(Environment.GetResourceString("Argument_ConversionOverflow"));
+ throw new ArgumentException(SR.Argument_ConversionOverflow);
}
}
}
// Double check input surrogate pair
if (!Char.IsHighSurrogate(charUnknownHigh))
throw new ArgumentOutOfRangeException(nameof(charUnknownHigh),
- Environment.GetResourceString("ArgumentOutOfRange_Range",
- 0xD800, 0xDBFF));
+ SR.Format(SR.ArgumentOutOfRange_Range, 0xD800, 0xDBFF));
if (!Char.IsLowSurrogate(charUnknownLow))
throw new ArgumentOutOfRangeException(nameof(charUnknownLow),
- Environment.GetResourceString("ArgumentOutOfRange_Range",
- 0xDC00, 0xDFFF));
+ SR.Format(SR.ArgumentOutOfRange_Range, 0xDC00, 0xDFFF));
Contract.EndContractBlock();
// If we had a buffer already we're being recursive, throw, it's probably at the suspect
{
// Fall back our char
throw new EncoderFallbackException(
- Environment.GetResourceString("Argument_InvalidCodePageConversionIndex",
- (int)charUnknown, index), charUnknown, index);
+ SR.Format(SR.Argument_InvalidCodePageConversionIndex, (int)charUnknown, index), charUnknown, index);
}
public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index)
if (!Char.IsHighSurrogate(charUnknownHigh))
{
throw new ArgumentOutOfRangeException(nameof(charUnknownHigh),
- Environment.GetResourceString("ArgumentOutOfRange_Range",
- 0xD800, 0xDBFF));
+ SR.Format(SR.ArgumentOutOfRange_Range, 0xD800, 0xDBFF));
}
if (!Char.IsLowSurrogate(charUnknownLow))
{
throw new ArgumentOutOfRangeException(nameof(charUnknownLow),
- Environment.GetResourceString("ArgumentOutOfRange_Range",
- 0xDC00, 0xDFFF));
+ SR.Format(SR.ArgumentOutOfRange_Range, 0xDC00, 0xDFFF));
}
Contract.EndContractBlock();
// Fall back our char
throw new EncoderFallbackException(
- Environment.GetResourceString("Argument_InvalidCodePageConversionIndex",
- iTemp, index), charUnknownHigh, charUnknownLow, index);
+ SR.Format(SR.Argument_InvalidCodePageConversionIndex, iTemp, index), charUnknownHigh, charUnknownLow, index);
}
public override char GetNextChar()
private int index;
public EncoderFallbackException()
- : base(Environment.GetResourceString("Arg_ArgumentException"))
+ : base(SR.Arg_ArgumentException)
{
SetErrorCode(__HResults.COR_E_ARGUMENT);
}
if (!Char.IsHighSurrogate(charUnknownHigh))
{
throw new ArgumentOutOfRangeException(nameof(charUnknownHigh),
- Environment.GetResourceString("ArgumentOutOfRange_Range",
- 0xD800, 0xDBFF));
+ SR.Format(SR.ArgumentOutOfRange_Range, 0xD800, 0xDBFF));
}
if (!Char.IsLowSurrogate(charUnknownLow))
{
throw new ArgumentOutOfRangeException(nameof(CharUnknownLow),
- Environment.GetResourceString("ArgumentOutOfRange_Range",
- 0xDC00, 0xDFFF));
+ SR.Format(SR.ArgumentOutOfRange_Range, 0xDC00, 0xDFFF));
}
Contract.EndContractBlock();
{
// Throw it, using our complete character
throw new ArgumentException(
- Environment.GetResourceString("Argument_RecursiveFallback",
- charRecursive), "chars");
+ SR.Format(SR.Argument_RecursiveFallback, charRecursive), "chars");
}
}
}
throw new NotSupportedException(
String.Format(
System.Globalization.CultureInfo.CurrentCulture,
- Environment.GetResourceString("NotSupported_TypeCannotDeserialized"), this.GetType()));
+ SR.NotSupported_TypeCannotDeserialized, this.GetType()));
}
// ISerializable implementation. called during serialization.
// Validate input parameters
if (chars == null)
throw new ArgumentNullException(nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (index < 0 || count < 0)
throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (chars.Length - index < count)
throw new ArgumentOutOfRangeException(nameof(chars),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
Contract.EndContractBlock();
// Avoid empty input problem
// Validate input parameters
if (chars == null)
throw new ArgumentNullException(nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
this.m_mustFlush = flush;
// Validate parameters
if (chars == null || bytes == null)
throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (charIndex < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (chars.Length - charIndex < charCount)
throw new ArgumentOutOfRangeException(nameof(chars),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
if (byteIndex < 0 || byteIndex > bytes.Length)
throw new ArgumentOutOfRangeException(nameof(byteIndex),
- Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ SR.ArgumentOutOfRange_Index);
Contract.EndContractBlock();
if (chars.Length == 0)
// Validate parameters
if (chars == null || bytes == null)
throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (byteCount < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
this.m_mustFlush = flush;
// Validate parameters
if (chars == null || bytes == null)
throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (charIndex < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (byteIndex < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (chars.Length - charIndex < charCount)
throw new ArgumentOutOfRangeException(nameof(chars),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
if (bytes.Length - byteIndex < byteCount)
throw new ArgumentOutOfRangeException(nameof(bytes),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ SR.ArgumentOutOfRange_IndexCountBuffer);
Contract.EndContractBlock();
// Validate input parameters
if (bytes == null || chars == null)
throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (charCount < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// We don't want to throw
break;
}
if (bFoundHigh)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex", nameof(replacement)));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidCharSequenceNoIndex, nameof(replacement)));
strDefault = replacement;
}
// Double check input surrogate pair
if (!Char.IsHighSurrogate(charUnknownHigh))
throw new ArgumentOutOfRangeException(nameof(charUnknownHigh),
- Environment.GetResourceString("ArgumentOutOfRange_Range",
- 0xD800, 0xDBFF));
+ SR.Format(SR.ArgumentOutOfRange_Range, 0xD800, 0xDBFF));
if (!Char.IsLowSurrogate(charUnknownLow))
throw new ArgumentOutOfRangeException(nameof(charUnknownLow),
- Environment.GetResourceString("ArgumentOutOfRange_Range",
- 0xDC00, 0xDFFF));
+ SR.Format(SR.ArgumentOutOfRange_Range, 0xDC00, 0xDFFF));
Contract.EndContractBlock();
// If we had a buffer already we're being recursive, throw, it's probably at the suspect
if (srcEncoding == null || dstEncoding == null)
{
throw new ArgumentNullException((srcEncoding == null ? nameof(srcEncoding) : nameof(dstEncoding)),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
}
if (bytes == null)
{
throw new ArgumentNullException(nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
}
Contract.Ensures(Contract.Result<byte[]>() != null);
if (codepage < 0 || codepage > 65535)
{
throw new ArgumentOutOfRangeException(
- nameof(codepage), Environment.GetResourceString("ArgumentOutOfRange_Range",
- 0, 65535));
+ nameof(codepage), SR.Format(SR.ArgumentOutOfRange_Range, 0, 65535));
}
Contract.EndContractBlock();
case CodePageNoMac: // 2 CP_MACCP
case CodePageNoThread: // 3 CP_THREAD_ACP
case CodePageNoSymbol: // 42 CP_SYMBOL
- throw new ArgumentException(Environment.GetResourceString(
- "Argument_CodepageNotSupported", codepage), nameof(codepage));
+ throw new ArgumentException(SR.Format(SR.Argument_CodepageNotSupported, codepage), nameof(codepage));
}
// Is it a valid code page?
if (EncodingTable.GetCodePageDataItem(codepage) == null)
{
throw new NotSupportedException(
- Environment.GetResourceString("NotSupported_NoCodepageData", codepage));
+ SR.Format(SR.NotSupported_NoCodepageData, codepage));
}
return UTF8;
if (dataItem == null)
{
throw new NotSupportedException(
- Environment.GetResourceString("NotSupported_NoCodepageData", m_codePage));
+ SR.Format(SR.NotSupported_NoCodepageData, m_codePage));
}
}
}
{
get
{
- return Environment.GetResourceString("Globalization.cp_" + m_codePage.ToString());
+ return SR.GetResourceString("Globalization.cp_" + m_codePage.ToString());
}
}
set
{
if (this.IsReadOnly)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_ReadOnly);
if (value == null)
throw new ArgumentNullException(nameof(value));
set
{
if (this.IsReadOnly)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly"));
+ throw new InvalidOperationException(SR.InvalidOperation_ReadOnly);
if (value == null)
throw new ArgumentNullException(nameof(value));
if (chars == null)
{
throw new ArgumentNullException(nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
}
Contract.EndContractBlock();
{
if (s == null)
throw new ArgumentNullException(nameof(s),
- Environment.GetResourceString("ArgumentNull_String"));
+ SR.ArgumentNull_String);
if (index < 0)
throw new ArgumentOutOfRangeException(nameof(index),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (index > s.Length - count)
throw new ArgumentOutOfRangeException(nameof(index),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCount"));
+ SR.ArgumentOutOfRange_IndexCount);
Contract.EndContractBlock();
unsafe
// Validate input parameters
if (chars == null)
throw new ArgumentNullException(nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
char[] arrChar = new char[count];
if (chars == null)
{
throw new ArgumentNullException(nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
}
Contract.EndContractBlock();
return GetBytes(chars, 0, chars.Length);
{
if (s == null)
throw new ArgumentNullException(nameof(s),
- Environment.GetResourceString("ArgumentNull_String"));
+ SR.ArgumentNull_String);
Contract.EndContractBlock();
int byteCount = GetByteCount(s);
{
if (s == null)
throw new ArgumentNullException(nameof(s),
- Environment.GetResourceString("ArgumentNull_String"));
+ SR.ArgumentNull_String);
if (index < 0)
throw new ArgumentOutOfRangeException(nameof(index),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
if (index > s.Length - count)
throw new ArgumentOutOfRangeException(nameof(index),
- Environment.GetResourceString("ArgumentOutOfRange_IndexCount"));
+ SR.ArgumentOutOfRange_IndexCount);
Contract.EndContractBlock();
unsafe
// Validate input parameters
if (bytes == null || chars == null)
throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (charCount < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Get the char array to convert
if (bytes == null)
{
throw new ArgumentNullException(nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
}
Contract.EndContractBlock();
return GetCharCount(bytes, 0, bytes.Length);
// Validate input parameters
if (bytes == null)
throw new ArgumentNullException(nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
byte[] arrbyte = new byte[count];
if (bytes == null)
{
throw new ArgumentNullException(nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
}
Contract.EndContractBlock();
return GetChars(bytes, 0, bytes.Length);
// Validate input parameters
if (chars == null || bytes == null)
throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
if (byteCount < 0 || charCount < 0)
throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Get the byte array to convert
public unsafe string GetString(byte* bytes, int byteCount)
{
if (bytes == null)
- throw new ArgumentNullException(nameof(bytes), Environment.GetResourceString("ArgumentNull_Array"));
+ throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array);
if (byteCount < 0)
- throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
return String.CreateStringFromEncoding(bytes, byteCount, this);
{
if (bytes == null)
throw new ArgumentNullException(nameof(bytes),
- Environment.GetResourceString("ArgumentNull_Array"));
+ SR.ArgumentNull_Array);
Contract.EndContractBlock();
return GetString(bytes, 0, bytes.Length);
// Special message to include fallback type in case fallback's GetMaxCharCount is broken
// This happens if user has implimented an encoder fallback with a broken GetMaxCharCount
throw new ArgumentException(
- Environment.GetResourceString("Argument_EncodingConversionOverflowBytes",
- EncodingName, EncoderFallback.GetType()), "bytes");
+ SR.Format(SR.Argument_EncodingConversionOverflowBytes, EncodingName, EncoderFallback.GetType()), "bytes");
}
internal void ThrowBytesOverflow(EncoderNLS encoder, bool nothingEncoded)
// Special message to include fallback type in case fallback's GetMaxCharCount is broken
// This happens if user has implimented a decoder fallback with a broken GetMaxCharCount
throw new ArgumentException(
- Environment.GetResourceString("Argument_EncodingConversionOverflowChars",
- EncodingName, DecoderFallback.GetType()), "chars");
+ SR.Format(SR.Argument_EncodingConversionOverflowChars, EncodingName, DecoderFallback.GetType()), "chars");
}
internal void ThrowCharsOverflow(DecoderNLS decoder, bool nothingDecoded)
// If we're not converting we must not have data in our fallback buffer
if (encoder.m_throwOnOverflow && encoder.InternalHasFallbackBuffer &&
this.fallbackBuffer.Remaining > 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty",
- encoder.Encoding.EncodingName, encoder.Fallback.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, encoder.Encoding.EncodingName, encoder.Fallback.GetType()));
}
fallbackBuffer.InternalInitialize(chars, charEnd, encoder, bytes != null);
}
Debug.Assert(encoding != null); // this parameter should only be affected internally, so just do a debug check here
if (chars == null)
{
- throw new ArgumentNullException(nameof(chars), Environment.GetResourceString("ArgumentNull_Array"));
+ throw new ArgumentNullException(nameof(chars), SR.ArgumentNull_Array);
}
if (index < 0 || count < 0)
{
- throw new ArgumentOutOfRangeException(index < 0 ? nameof(index) : nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(index < 0 ? nameof(index) : nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (chars.Length - index < count)
{
- throw new ArgumentOutOfRangeException(nameof(chars), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ throw new ArgumentOutOfRangeException(nameof(chars), SR.ArgumentOutOfRange_IndexCountBuffer);
}
Contract.EndContractBlock();
Debug.Assert(encoding != null);
if (chars == null)
{
- throw new ArgumentNullException(nameof(chars), Environment.GetResourceString("ArgumentNull_Array"));
+ throw new ArgumentNullException(nameof(chars), SR.ArgumentNull_Array);
}
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.EndContractBlock();
if (s == null || bytes == null)
{
string stringName = encoding is ASCIIEncoding ? "chars" : nameof(s); // ASCIIEncoding calls the first parameter chars
- throw new ArgumentNullException(s == null ? stringName : nameof(bytes), Environment.GetResourceString("ArgumentNull_Array"));
+ throw new ArgumentNullException(s == null ? stringName : nameof(bytes), SR.ArgumentNull_Array);
}
if (charIndex < 0 || charCount < 0)
{
- throw new ArgumentOutOfRangeException(charIndex < 0 ? nameof(charIndex) : nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(charIndex < 0 ? nameof(charIndex) : nameof(charCount), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (s.Length - charIndex < charCount)
{
string stringName = encoding is ASCIIEncoding ? "chars" : nameof(s); // ASCIIEncoding calls the first parameter chars
// Duplicate the above check since we don't want the overhead of a type check on the general path
- throw new ArgumentOutOfRangeException(stringName, Environment.GetResourceString("ArgumentOutOfRange_IndexCount"));
+ throw new ArgumentOutOfRangeException(stringName, SR.ArgumentOutOfRange_IndexCount);
}
if (byteIndex < 0 || byteIndex > bytes.Length)
{
- throw new ArgumentOutOfRangeException(nameof(byteIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.ArgumentOutOfRange_Index);
}
Contract.EndContractBlock();
Debug.Assert(encoding != null);
if (chars == null || bytes == null)
{
- throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes), Environment.GetResourceString("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), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(charIndex < 0 ? nameof(charIndex) : nameof(charCount), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (chars.Length - charIndex < charCount)
{
- throw new ArgumentOutOfRangeException(nameof(chars), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ throw new ArgumentOutOfRangeException(nameof(chars), SR.ArgumentOutOfRange_IndexCountBuffer);
}
if (byteIndex < 0 || byteIndex > bytes.Length)
{
- throw new ArgumentOutOfRangeException(nameof(byteIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.ArgumentOutOfRange_Index);
}
Contract.EndContractBlock();
Debug.Assert(encoding != null);
if (bytes == null || chars == null)
{
- throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), Environment.GetResourceString("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), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(charCount < 0 ? nameof(charCount) : nameof(byteCount), SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.EndContractBlock();
Debug.Assert(encoding != null);
if (bytes == null)
{
- throw new ArgumentNullException(nameof(bytes), Environment.GetResourceString("ArgumentNull_Array"));
+ throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array);
}
if (index < 0 || count < 0)
{
- throw new ArgumentOutOfRangeException(index < 0 ? nameof(index) : nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(index < 0 ? nameof(index) : nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (bytes.Length - index < count)
{
- throw new ArgumentOutOfRangeException(nameof(bytes), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer);
}
Contract.EndContractBlock();
Debug.Assert(encoding != null);
if (bytes == null)
{
- throw new ArgumentNullException(nameof(bytes), Environment.GetResourceString("ArgumentNull_Array"));
+ throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array);
}
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.EndContractBlock();
Debug.Assert(encoding != null);
if (bytes == null || chars == null)
{
- throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), Environment.GetResourceString("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), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (bytes.Length - byteIndex < byteCount)
{
- throw new ArgumentOutOfRangeException(nameof(bytes), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer);
}
if (charIndex < 0 || charIndex > chars.Length)
{
- throw new ArgumentOutOfRangeException(nameof(charIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(charIndex), SR.ArgumentOutOfRange_Index);
}
Contract.EndContractBlock();
Debug.Assert(encoding != null);
if (bytes == null || chars == null)
{
- throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), Environment.GetResourceString("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), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(charCount < 0 ? nameof(charCount) : nameof(byteCount), SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.EndContractBlock();
Debug.Assert(encoding != null);
if (bytes == null)
{
- throw new ArgumentNullException(nameof(bytes), Environment.GetResourceString("ArgumentNull_Array"));
+ throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array);
}
if (index < 0 || count < 0)
{
bool ascii = encoding is ASCIIEncoding;
string indexName = ascii ? "byteIndex" : nameof(index);
string countName = ascii ? "byteCount" : nameof(count);
- throw new ArgumentOutOfRangeException(index < 0 ? indexName : countName, Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(index < 0 ? indexName : countName, SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (bytes.Length - index < count)
{
- throw new ArgumentOutOfRangeException(nameof(bytes), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"));
+ throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer);
}
Contract.EndContractBlock();
{
if (charCount < 0)
throw new ArgumentOutOfRangeException(nameof(charCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Characters would be # of characters + 1 in case high surrogate is ? * max fallback
// 1 to 1 for most characters. Only surrogates with fallbacks have less.
if (byteCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow);
return (int)byteCount;
}
{
if (byteCount < 0)
throw new ArgumentOutOfRangeException(nameof(byteCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Just return length, SBCS stay the same length because they don't map to surrogate
charCount *= DecoderFallback.MaxCharCount;
if (charCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_GetCharCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow);
return (int)charCount;
}
if (ret == -1)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"), nameof(strInput));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput));
}
return ret == 1;
if (realLen == -1)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"), nameof(strInput));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput));
}
if (realLen <= buf.Length)
buf = new char[realLen];
}
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"), nameof(strInput));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput));
}
// -----------------------------
if (normalizationForm != NormalizationForm.FormC && normalizationForm != NormalizationForm.FormD &&
normalizationForm != NormalizationForm.FormKC && normalizationForm != NormalizationForm.FormKD)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidNormalizationForm"), nameof(normalizationForm));
+ throw new ArgumentException(SR.Argument_InvalidNormalizationForm, nameof(normalizationForm));
}
if (HasInvalidUnicodeSequence(strInput))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"), nameof(strInput));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput));
}
}
throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput));
case Interop.Errors.ERROR_NOT_ENOUGH_MEMORY:
- throw new OutOfMemoryException(SR.Arg_OutOfMemoryException);
+ throw new OutOfMemoryException();
default:
throw new InvalidOperationException(SR.Format(SR.UnknownError_Num, lastError));
// a trivial math function...
// Can't really be Out of Memory, but just in case:
if (lastError == Interop.Errors.ERROR_NOT_ENOUGH_MEMORY)
- throw new OutOfMemoryException(SR.Arg_OutOfMemoryException);
+ throw new OutOfMemoryException();
// Who knows what happened? Not us!
throw new InvalidOperationException(SR.Format(SR.UnknownError_Num, lastError));
throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput));
case Interop.Errors.ERROR_NOT_ENOUGH_MEMORY:
- throw new OutOfMemoryException(SR.Arg_OutOfMemoryException);
+ throw new OutOfMemoryException();
default:
// We shouldn't get here...
if (capacity < 0)
{
throw new ArgumentOutOfRangeException(nameof(capacity),
- Environment.GetResourceString("ArgumentOutOfRange_MustBePositive", nameof(capacity)));
+ SR.Format(SR.ArgumentOutOfRange_MustBePositive, nameof(capacity)));
}
if (length < 0)
{
throw new ArgumentOutOfRangeException(nameof(length),
- Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegNum", nameof(length)));
+ SR.Format(SR.ArgumentOutOfRange_MustBeNonNegNum, nameof(length)));
}
if (startIndex < 0)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
Contract.EndContractBlock();
}
if (startIndex > value.Length - length)
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_IndexLength"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_IndexLength);
}
m_MaxCapacity = Int32.MaxValue;
if (capacity == 0)
{
if (capacity > maxCapacity)
{
- throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_Capacity"));
+ throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_Capacity);
}
if (maxCapacity < 1)
{
- throw new ArgumentOutOfRangeException(nameof(maxCapacity), Environment.GetResourceString("ArgumentOutOfRange_SmallMaxCapacity"));
+ throw new ArgumentOutOfRangeException(nameof(maxCapacity), SR.ArgumentOutOfRange_SmallMaxCapacity);
}
if (capacity < 0)
{
throw new ArgumentOutOfRangeException(nameof(capacity),
- Environment.GetResourceString("ArgumentOutOfRange_MustBePositive", nameof(capacity)));
+ SR.Format(SR.ArgumentOutOfRange_MustBePositive, nameof(capacity)));
}
Contract.EndContractBlock();
}
if (persistedMaxCapacity < 1 || persistedString.Length > persistedMaxCapacity)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_StringBuilderMaxCapacity"));
+ throw new SerializationException(SR.Serialization_StringBuilderMaxCapacity);
}
if (!capacityPresent)
}
if (persistedCapacity < 0 || persistedCapacity < persistedString.Length || persistedCapacity > persistedMaxCapacity)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_StringBuilderCapacity"));
+ throw new SerializationException(SR.Serialization_StringBuilderCapacity);
}
// Assign
{
if (value < 0)
{
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_NegativeCapacity"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NegativeCapacity);
}
if (value > MaxCapacity)
{
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_Capacity"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_Capacity);
}
if (value < Length)
{
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_SmallCapacity);
}
Contract.EndContractBlock();
{
if (capacity < 0)
{
- throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_NegativeCapacity"));
+ throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_NegativeCapacity);
}
Contract.EndContractBlock();
}
else
{
- throw new ArgumentOutOfRangeException(nameof(chunkLength), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(chunkLength), SR.ArgumentOutOfRange_Index);
}
}
chunk = chunk.m_ChunkPrevious;
int currentLength = this.Length;
if (startIndex < 0)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
if (startIndex > currentLength)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndexLargerThanLength"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndexLargerThanLength);
}
if (length < 0)
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength);
}
if (startIndex > (currentLength - length))
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_IndexLength"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_IndexLength);
}
VerifyClassInvariant();
}
else
{
- throw new ArgumentOutOfRangeException(nameof(chunkCount), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(chunkCount), SR.ArgumentOutOfRange_Index);
}
}
}
//If the new length is less than 0 or greater than our Maximum capacity, bail.
if (value < 0)
{
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NegativeLength);
}
if (value > MaxCapacity)
{
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity"));
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_SmallCapacity);
}
Contract.EndContractBlock();
if (indexInBlock >= 0)
{
if (indexInBlock >= chunk.m_ChunkLength)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
chunk.m_ChunkChars[indexInBlock] = value;
return;
}
chunk = chunk.m_ChunkPrevious;
if (chunk == null)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
}
}
}
{
if (repeatCount < 0)
{
- throw new ArgumentOutOfRangeException(nameof(repeatCount), Environment.GetResourceString("ArgumentOutOfRange_NegativeCount"));
+ throw new ArgumentOutOfRangeException(nameof(repeatCount), SR.ArgumentOutOfRange_NegativeCount);
}
Contract.Ensures(Contract.Result<StringBuilder>() != null);
Contract.EndContractBlock();
int newLength = Length + repeatCount;
if (newLength > m_MaxCapacity || newLength < repeatCount)
{
- throw new ArgumentOutOfRangeException(nameof(repeatCount), Environment.GetResourceString("ArgumentOutOfRange_LengthGreaterThanCapacity"));
+ throw new ArgumentOutOfRangeException(nameof(repeatCount), SR.ArgumentOutOfRange_LengthGreaterThanCapacity);
}
int idx = m_ChunkLength;
{
if (startIndex < 0)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_GenericPositive);
}
if (charCount < 0)
{
- throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
+ throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GenericPositive);
}
Contract.Ensures(Contract.Result<StringBuilder>() != null);
Contract.EndContractBlock();
}
if (charCount > value.Length - startIndex)
{
- throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_Index);
}
if (charCount == 0)
{
if (startIndex < 0)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
}
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_GenericPositive);
}
Contract.Ensures(Contract.Result<StringBuilder>() != null);
if (startIndex > value.Length - count)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
}
unsafe
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("Arg_NegativeArgCount"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.Arg_NegativeArgCount);
}
if (destinationIndex < 0)
{
throw new ArgumentOutOfRangeException(nameof(destinationIndex),
- Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegNum", nameof(destinationIndex)));
+ SR.Format(SR.ArgumentOutOfRange_MustBeNonNegNum, nameof(destinationIndex)));
}
if (destinationIndex > destination.Length - count)
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_OffsetOut"));
+ throw new ArgumentException(SR.ArgumentOutOfRange_OffsetOut);
}
if ((uint)sourceIndex > (uint)Length)
{
- throw new ArgumentOutOfRangeException(nameof(sourceIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(sourceIndex), SR.ArgumentOutOfRange_Index);
}
if (sourceIndex > Length - count)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_LongerThanSrcString"));
+ throw new ArgumentException(SR.Arg_LongerThanSrcString);
}
Contract.EndContractBlock();
{
if (count < 0)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.Ensures(Contract.Result<StringBuilder>() != null);
Contract.EndContractBlock();
int currentLength = Length;
if ((uint)index > (uint)currentLength)
{
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
}
//If value is null, empty or count is 0, do nothing. This is ECMA standard.
{
if (length < 0)
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength);
}
if (startIndex < 0)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
if (length > Length - startIndex)
{
- throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_Index);
}
Contract.Ensures(Contract.Result<StringBuilder>() != null);
Contract.EndContractBlock();
{
if ((uint)index > (uint)Length)
{
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
}
Contract.Ensures(Contract.Result<StringBuilder>() != null);
Contract.EndContractBlock();
{
if ((uint)index > (uint)Length)
{
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
}
Contract.Ensures(Contract.Result<StringBuilder>() != null);
Contract.EndContractBlock();
int currentLength = Length;
if ((uint)index > (uint)currentLength)
{
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
}
//If they passed in a null char array, just jump out quickly.
{
return this;
}
- throw new ArgumentNullException(nameof(value), Environment.GetResourceString("ArgumentNull_String"));
+ throw new ArgumentNullException(nameof(value), SR.ArgumentNull_String);
}
//Range check the array.
if (startIndex < 0)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
if (charCount < 0)
{
- throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
+ throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GenericPositive);
}
if (startIndex > value.Length - charCount)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
}
if (charCount > 0)
private static void FormatError()
{
- throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ throw new FormatException(SR.Format_InvalidString);
}
// undocumented exclusive limits on the range for Argument Hole Index and Argument Hole Alignment.
} while (ch >= '0' && ch <= '9' && index < Index_Limit);
// If value of index is not within the range of the arguments passed in then error (Index out of range)
- if (index >= args.Length) throw new FormatException(Environment.GetResourceString("Format_IndexOutOfRange"));
+ if (index >= args.Length) throw new FormatException(SR.Format_IndexOutOfRange);
// Consume optional whitespace.
while (pos < len && (ch = format[pos]) == ' ') pos++;
int currentLength = Length;
if ((uint)startIndex > (uint)currentLength)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
}
if (count < 0 || startIndex > currentLength - count)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Index);
}
if (oldValue == null)
{
}
if (oldValue.Length == 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(oldValue));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(oldValue));
}
if (newValue == null)
int currentLength = Length;
if ((uint)startIndex > (uint)currentLength)
{
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
}
if (count < 0 || startIndex > currentLength - count)
{
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Index);
}
int endIndex = startIndex + count;
// We don't check null value as this case will throw null reference exception anyway
if (valueCount < 0)
{
- throw new ArgumentOutOfRangeException(nameof(valueCount), Environment.GetResourceString("ArgumentOutOfRange_NegativeCount"));
+ throw new ArgumentOutOfRangeException(nameof(valueCount), SR.ArgumentOutOfRange_NegativeCount);
}
// this is where we can check if the valueCount will put us over m_MaxCapacity
int newLength = Length + valueCount;
if (newLength > m_MaxCapacity || newLength < valueCount)
{
- throw new ArgumentOutOfRangeException(nameof(valueCount), Environment.GetResourceString("ArgumentOutOfRange_LengthGreaterThanCapacity"));
+ throw new ArgumentOutOfRangeException(nameof(valueCount), SR.ArgumentOutOfRange_LengthGreaterThanCapacity);
}
// This case is so common we want to optimize for it heavily.
{
if ((uint)index > (uint)Length)
{
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
}
if (valueCount > 0)
}
else
{
- throw new ArgumentOutOfRangeException(nameof(destinationIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(destinationIndex), SR.ArgumentOutOfRange_Index);
}
}
}
}
else
{
- throw new ArgumentOutOfRangeException(nameof(sourceIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
+ throw new ArgumentOutOfRangeException(nameof(sourceIndex), SR.ArgumentOutOfRange_Index);
}
}
}
VerifyClassInvariant();
if ((minBlockCharCount + Length) > m_MaxCapacity || minBlockCharCount + Length < minBlockCharCount)
- throw new ArgumentOutOfRangeException("requiredLength", Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity"));
+ throw new ArgumentOutOfRangeException("requiredLength", SR.ArgumentOutOfRange_SmallCapacity);
// Compute the length of the new block we need
// We make the new chunk at least big enough for the current need (minBlockCharCount)
Debug.Assert(count > 0, "Count must be strictly positive");
Debug.Assert(index >= 0, "Index can't be negative");
if (count + Length > m_MaxCapacity || count + Length < count)
- throw new ArgumentOutOfRangeException("requiredLength", Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity"));
+ throw new ArgumentOutOfRangeException("requiredLength", SR.ArgumentOutOfRange_SmallCapacity);
chunk = this;
while (chunk.m_ChunkOffset > index)
// We mustn't have left over fallback data when counting
if (fallbackBuffer.Remaining > 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty",
- this.EncodingName, encoder.Fallback.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType()));
}
else
{
// Check for overflows.
if (byteCount < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString(
- "ArgumentOutOfRange_GetByteCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_GetByteCountOverflow);
// Shouldn't have anything in fallback buffer for GetByteCount
// (don't have to check m_throwOnOverflow for count)
// We mustn't have left over fallback data when not converting
if (encoder.m_throwOnOverflow && fallbackBuffer.Remaining > 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty",
- this.EncodingName, encoder.Fallback.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType()));
}
else
{
// Check for overflows.
if (charCount < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_GetByteCountOverflow);
// Shouldn't have anything in fallback buffer for GetCharCount
// (don't have to check m_throwOnOverflow for chars or count)
{
if (charCount < 0)
throw new ArgumentOutOfRangeException(nameof(charCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Characters would be # of characters + 1 in case left over high surrogate is ? * max fallback
byteCount *= 4;
if (byteCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow);
return (int)byteCount;
}
{
if (byteCount < 0)
throw new ArgumentOutOfRangeException(nameof(byteCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// A supplementary character becomes 2 surrogate characters, so 4 input bytes becomes 2 chars,
}
if (charCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_GetCharCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow);
return (int)charCount;
}
{
if (charCount < 0)
throw new ArgumentOutOfRangeException(nameof(charCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Suppose that every char can not be direct-encoded, we know that
// check for overflow
if (byteCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow);
return (int)byteCount;
}
{
if (byteCount < 0)
throw new ArgumentOutOfRangeException(nameof(byteCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Worst case is 1 char per byte. Minimum 1 for left over bits in case decoder is being flushed
Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.InternalFallback] Can't have recursive fallbacks");
if (bytes.Length != 1)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"));
+ throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex);
}
// Can't fallback a byte 0, so return for that case, 1 otherwise.
{
fallbackBuffer = encoder.FallbackBuffer;
if (fallbackBuffer.Remaining > 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty",
- this.EncodingName, encoder.Fallback.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType()));
// Set our internal fallback interesting things.
fallbackBuffer.InternalInitialize(chars, pEnd, encoder, false);
if (byteCount < 0)
{
throw new ArgumentException(
- Environment.GetResourceString("Argument_ConversionOverflow"));
+ SR.Argument_ConversionOverflow);
}
#endif
// We always need the fallback buffer in get bytes so we can flush any remaining ones if necessary
fallbackBuffer = encoder.FallbackBuffer;
if (fallbackBuffer.Remaining > 0 && encoder.m_throwOnOverflow)
- throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty",
- this.EncodingName, encoder.Fallback.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType()));
// Set our internal fallback interesting things.
fallbackBuffer.InternalInitialize(chars, pEnd, encoder, true);
{
if (charCount < 0)
throw new ArgumentOutOfRangeException(nameof(charCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Characters would be # of characters + 1 in case left over high surrogate is ? * max fallback
byteCount *= 3;
if (byteCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow);
return (int)byteCount;
}
{
if (byteCount < 0)
throw new ArgumentOutOfRangeException(nameof(byteCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Figure out our length, 1 char per input byte + 1 char if 1st byte is last byte of 4 byte surrogate pair
}
if (charCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_GetCharCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow);
return (int)charCount;
}
// (If they were all invalid chars, this would actually be wrong,
// but that's a ridiculously large # so we're not concerned about that case)
if (byteCount < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_GetByteCountOverflow);
char* charStart = chars;
char* charEnd = chars + count;
{
fallbackBuffer = encoder.FallbackBuffer;
if (fallbackBuffer.Remaining > 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty",
- this.EncodingName, encoder.Fallback.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType()));
// Set our internal fallback interesting things.
fallbackBuffer.InternalInitialize(charStart, charEnd, encoder, false);
{
// Throw it, using our complete character
throw new ArgumentException(
- Environment.GetResourceString("Argument_RecursiveFallback",
- charLeftOver), nameof(chars));
+ SR.Format(SR.Argument_RecursiveFallback, charLeftOver), nameof(chars));
}
else
{
// We always need the fallback buffer in get bytes so we can flush any remaining ones if necessary
fallbackBuffer = encoder.FallbackBuffer;
if (fallbackBuffer.Remaining > 0 && encoder.m_throwOnOverflow)
- throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty",
- this.EncodingName, encoder.Fallback.GetType()));
+ throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType()));
// Set our internal fallback interesting things.
fallbackBuffer.InternalInitialize(charStart, charEnd, encoder, false);
{
// Throw it, using our complete character
throw new ArgumentException(
- Environment.GetResourceString("Argument_RecursiveFallback",
- charLeftOver), nameof(chars));
+ SR.Format(SR.Argument_RecursiveFallback, charLeftOver), nameof(chars));
}
else
{
{
if (charCount < 0)
throw new ArgumentOutOfRangeException(nameof(charCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// Characters would be # of characters + 1 in case left over high surrogate is ? * max fallback
byteCount <<= 1;
if (byteCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow);
return (int)byteCount;
}
{
if (byteCount < 0)
throw new ArgumentOutOfRangeException(nameof(byteCount),
- Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
// long because byteCount could be biggest int.
charCount *= DecoderFallback.MaxCharCount;
if (charCount > 0x7fffffff)
- throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_GetCharCountOverflow"));
+ throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow);
return (int)charCount;
}
private Mutex m_Mutex = null;
public AbandonedMutexException()
- : base(Environment.GetResourceString("Threading.AbandonedMutexException"))
+ : base(SR.Threading_AbandonedMutexException)
{
SetErrorCode(__HResults.COR_E_ABANDONEDMUTEX);
}
}
public AbandonedMutexException(int location, WaitHandle handle)
- : base(Environment.GetResourceString("Threading.AbandonedMutexException"))
+ : base(SR.Threading_AbandonedMutexException)
{
SetErrorCode(__HResults.COR_E_ABANDONEDMUTEX);
SetupException(location, handle);
// Throws an OCE; separated out to enable better inlining of ThrowIfCancellationRequested
private void ThrowOperationCanceledException()
{
- throw new OperationCanceledException(Environment.GetResourceString("OperationCanceled"), this);
+ throw new OperationCanceledException(SR.OperationCanceled, this);
}
private static void ThrowObjectDisposedException()
{
- throw new ObjectDisposedException(null, Environment.GetResourceString("CancellationToken_SourceDisposed"));
+ throw new ObjectDisposedException(null, SR.CancellationToken_SourceDisposed);
}
// -----------------------------------
// separation enables inlining of ThrowIfDisposed
private static void ThrowObjectDisposedException()
{
- throw new ObjectDisposedException(null, Environment.GetResourceString("CancellationTokenSource_Disposed"));
+ throw new ObjectDisposedException(null, SR.CancellationTokenSource_Disposed);
}
/// <summary>
switch (tokens.Length)
{
case 0:
- throw new ArgumentException(Environment.GetResourceString("CancellationToken_CreateLinkedToken_TokensIsEmpty"));
+ throw new ArgumentException(SR.CancellationToken_CreateLinkedToken_TokensIsEmpty);
case 1:
return CreateLinkedTokenSource(tokens[0]);
case 2:
if (name != null)
{
#if PLATFORM_UNIX
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_NamedSynchronizationPrimitives"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives);
#else
if (System.IO.Path.MaxPath < name.Length)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name));
+ throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name));
}
#endif
}
break;
default:
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag", name));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidFlag, name));
};
if (_handle.IsInvalid)
_handle.SetHandleAsInvalid();
if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode)
- throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name));
+ throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name));
__Error.WinIOError(errorCode, name);
}
if (name != null)
{
#if PLATFORM_UNIX
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_NamedSynchronizationPrimitives"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives);
#else
if (System.IO.Path.MaxPath < name.Length)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name));
+ throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name));
}
#endif
}
break;
default:
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag", name));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidFlag, name));
};
_handle = Win32Native.CreateEvent(secAttrs, isManualReset, initialState, name);
{
_handle.SetHandleAsInvalid();
if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode)
- throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name));
+ throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name));
__Error.WinIOError(errorCode, name);
}
throw new WaitHandleCannotBeOpenedException();
case OpenExistingResult.NameInvalid:
- throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name));
+ throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name));
case OpenExistingResult.PathNotFound:
__Error.WinIOError(Win32Native.ERROR_PATH_NOT_FOUND, "");
private static OpenExistingResult OpenExistingWorker(string name, EventWaitHandleRights rights, out EventWaitHandle result)
{
#if PLATFORM_UNIX
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_NamedSynchronizationPrimitives"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives);
#else
if (name == null)
{
- throw new ArgumentNullException(nameof(name), Environment.GetResourceString("ArgumentNull_WithParamName"));
+ throw new ArgumentNullException(nameof(name), SR.ArgumentNull_WithParamName);
}
if (name.Length == 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
}
if (null != name && System.IO.Path.MaxPath < name.Length)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name));
+ throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name));
}
Contract.EndContractBlock();
ExecutionContext executionContext = currentThread.ExecutionContext ?? Default;
if (executionContext.m_isFlowSuppressed)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotSupressFlowMultipleTimes"));
+ throw new InvalidOperationException(SR.InvalidOperation_CannotSupressFlowMultipleTimes);
}
Contract.EndContractBlock();
ExecutionContext executionContext = currentThread.ExecutionContext;
if (executionContext == null || !executionContext.m_isFlowSuppressed)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotRestoreUnsupressedFlow"));
+ throw new InvalidOperationException(SR.InvalidOperation_CannotRestoreUnsupressedFlow);
}
Contract.EndContractBlock();
public static void Run(ExecutionContext executionContext, ContextCallback callback, Object state)
{
if (executionContext == null)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NullContext"));
+ throw new InvalidOperationException(SR.InvalidOperation_NullContext);
Thread currentThread = Thread.CurrentThread;
ExecutionContextSwitcher ecsw = default(ExecutionContextSwitcher);
catch (Exception ex)
{
Environment.FailFast(
- Environment.GetResourceString("ExecutionContext_ExceptionInAsyncLocalNotification"),
+ SR.ExecutionContext_ExceptionInAsyncLocalNotification,
ex);
}
}
{
if (_thread == null)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotUseAFCMultiple"));
+ throw new InvalidOperationException(SR.InvalidOperation_CannotUseAFCMultiple);
}
if (Thread.CurrentThread != _thread)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotUseAFCOtherThread"));
+ throw new InvalidOperationException(SR.InvalidOperation_CannotUseAFCOtherThread);
}
// An async flow control cannot be undone when a different execution context is applied. The desktop framework
// flow is suppressed.
if (!ExecutionContext.IsFlowSuppressed())
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_AsyncFlowCtrlCtxMismatch"));
+ throw new InvalidOperationException(SR.InvalidOperation_AsyncFlowCtrlCtxMismatch);
}
Contract.EndContractBlock();
T value = valueFactory();
if (value == null)
{
- throw new InvalidOperationException(Environment.GetResourceString("Lazy_StaticInit_InvalidOperation"));
+ throw new InvalidOperationException(SR.Lazy_StaticInit_InvalidOperation);
}
Interlocked.CompareExchange(ref target, value, null);
Volatile.Write(ref target, valueFactory());
if (target == null)
{
- throw new InvalidOperationException(Environment.GetResourceString("Lazy_StaticInit_InvalidOperation"));
+ throw new InvalidOperationException(SR.Lazy_StaticInit_InvalidOperation);
}
}
}
}
catch (MissingMethodException)
{
- throw new MissingMemberException(Environment.GetResourceString("Lazy_CreateValue_NoParameterlessCtorForT"));
+ throw new MissingMemberException(SR.Lazy_CreateValue_NoParameterlessCtorForT);
}
}
}
// it is possible for the max number of waiters to be exceeded via user-code, hence we use a real exception here.
if (value >= NumWaitersState_MaxValue)
- throw new InvalidOperationException(String.Format(Environment.GetResourceString("ManualResetEventSlim_ctor_TooManyWaiters"), NumWaitersState_MaxValue));
+ throw new InvalidOperationException(String.Format(SR.ManualResetEventSlim_ctor_TooManyWaiters, NumWaitersState_MaxValue));
UpdateStateAtomically(value << NumWaitersState_ShiftCount, NumWaitersState_BitMask);
}
{
throw new ArgumentOutOfRangeException(
nameof(spinCount),
- String.Format(Environment.GetResourceString("ManualResetEventSlim_ctor_SpinCountOutOfRange"), SpinCountState_MaxValue));
+ String.Format(SR.ManualResetEventSlim_ctor_SpinCountOutOfRange, SpinCountState_MaxValue));
}
// We will suppress default spin because the user specified a count.
private void ThrowIfDisposed()
{
if ((m_combinedState & Dispose_BitMask) != 0)
- throw new ObjectDisposedException(Environment.GetResourceString("ManualResetEventSlim_Disposed"));
+ throw new ObjectDisposedException(SR.ManualResetEventSlim_Disposed);
}
/// <summary>
private static void ThrowLockTakenException()
{
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeFalse"), "lockTaken");
+ throw new ArgumentException(SR.Argument_MustBeFalse, "lockTaken");
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
{
long tm = (long)timeout.TotalMilliseconds;
if (tm < -1 || tm > (long)Int32.MaxValue)
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
return (int)tm;
}
#if !PLATFORM_UNIX
if (name != null && System.IO.Path.MaxPath < name.Length)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name));
+ throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name));
}
#endif
Contract.EndContractBlock();
#if PLATFORM_UNIX
case Win32Native.ERROR_FILENAME_EXCED_RANGE:
// On Unix, length validation is done by CoreCLR's PAL after converting to utf-8
- throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Interop.Sys.MaxName), "name");
+ throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Interop.Sys.MaxName), "name");
#endif
case Win32Native.ERROR_INVALID_HANDLE:
- throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", m_name));
+ throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, m_name));
}
}
__Error.WinIOError(errorCode, m_name);
throw new WaitHandleCannotBeOpenedException();
case OpenExistingResult.NameInvalid:
- throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name));
+ throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name));
case OpenExistingResult.PathNotFound:
__Error.WinIOError(Win32Native.ERROR_PATH_NOT_FOUND, name);
{
if (name == null)
{
- throw new ArgumentNullException(nameof(name), Environment.GetResourceString("ArgumentNull_WithParamName"));
+ throw new ArgumentNullException(nameof(name), SR.ArgumentNull_WithParamName);
}
if (name.Length == 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
}
#if !PLATFORM_UNIX
if (System.IO.Path.MaxPath < name.Length)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name));
+ throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name));
}
#endif
Contract.EndContractBlock();
if (name != null && errorCode == Win32Native.ERROR_FILENAME_EXCED_RANGE)
{
// On Unix, length validation is done by CoreCLR's PAL after converting to utf-8
- throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Interop.Sys.MaxName), nameof(name));
+ throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Interop.Sys.MaxName), nameof(name));
}
#endif
}
else
{
- throw new ApplicationException(Environment.GetResourceString("Arg_SynchronizationLockException"));
+ throw new ApplicationException(SR.Arg_SynchronizationLockException);
}
}
{
if (!m_pinSelf.IsNull())
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_Overlapped_Pack"));
+ throw new InvalidOperationException(SR.InvalidOperation_Overlapped_Pack);
}
if (iocb != null)
{
if (!m_pinSelf.IsNull())
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_Overlapped_Pack"));
+ throw new InvalidOperationException(SR.InvalidOperation_Overlapped_Pack);
}
m_userObject = userData;
if (m_userObject != null)
{
if (initialCount < 0)
{
- throw new ArgumentOutOfRangeException(nameof(initialCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(initialCount), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (maximumCount < 1)
{
- throw new ArgumentOutOfRangeException(nameof(maximumCount), Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
+ throw new ArgumentOutOfRangeException(nameof(maximumCount), SR.ArgumentOutOfRange_NeedPosNum);
}
if (initialCount > maximumCount)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_SemaphoreInitialMaximum"));
+ throw new ArgumentException(SR.Argument_SemaphoreInitialMaximum);
}
SafeWaitHandle myHandle = CreateSemaphone(initialCount, maximumCount, name);
if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode)
throw new WaitHandleCannotBeOpenedException(
- Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name));
+ SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name));
__Error.WinIOError();
}
{
if (initialCount < 0)
{
- throw new ArgumentOutOfRangeException(nameof(initialCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(initialCount), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (maximumCount < 1)
{
- throw new ArgumentOutOfRangeException(nameof(maximumCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(maximumCount), SR.ArgumentOutOfRange_NeedNonNegNum);
}
if (initialCount > maximumCount)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_SemaphoreInitialMaximum"));
+ throw new ArgumentException(SR.Argument_SemaphoreInitialMaximum);
}
SafeWaitHandle myHandle = CreateSemaphone(initialCount, maximumCount, name);
{
if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode)
throw new WaitHandleCannotBeOpenedException(
- Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name));
+ SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name));
__Error.WinIOError();
}
createdNew = errorCode != Win32Native.ERROR_ALREADY_EXISTS;
if (name != null)
{
#if PLATFORM_UNIX
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_NamedSynchronizationPrimitives"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives);
#else
if (name.Length > Path.MaxPath)
- throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name));
+ throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name));
#endif
}
case OpenExistingResult.NameNotFound:
throw new WaitHandleCannotBeOpenedException();
case OpenExistingResult.NameInvalid:
- throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name));
+ throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name));
case OpenExistingResult.PathNotFound:
throw new IOException(Win32Native.GetMessage(Win32Native.ERROR_PATH_NOT_FOUND));
default:
private static OpenExistingResult OpenExistingWorker(string name, out Semaphore result)
{
#if PLATFORM_UNIX
- throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_NamedSynchronizationPrimitives"));
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives);
#else
if (name == null)
- throw new ArgumentNullException(nameof(name), Environment.GetResourceString("ArgumentNull_WithParamName"));
+ throw new ArgumentNullException(nameof(name), SR.ArgumentNull_WithParamName);
if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
if (name.Length > Path.MaxPath)
- throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name));
+ throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name));
const int SYNCHRONIZE = 0x00100000;
const int SEMAPHORE_MODIFY_STATE = 0x00000002;
{
if (releaseCount < 1)
{
- throw new ArgumentOutOfRangeException(nameof(releaseCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(releaseCount), SR.ArgumentOutOfRange_NeedNonNegNum);
}
//If ReleaseSempahore returns false when the specified value would cause
[ComVisibleAttribute(false)]
public class SemaphoreFullException : SystemException
{
- public SemaphoreFullException() : base(Environment.GetResourceString("Threading_SemaphoreFullException"))
+ public SemaphoreFullException() : base(SR.Threading_SemaphoreFullException)
{
}
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/// <param name="str">The key string</param>
private static string GetResourceString(string str)
{
- return Environment.GetResourceString(str);
+ return SR.GetResourceString(str);
}
#endregion
}
/// <remarks>
/// <para>
/// <see cref="SpinWait"/> encapsulates common spinning logic. On single-processor machines, yields are
- /// always used instead of busy waits, and on computers with Intel\99 processors employing Hyper-Threading\99
+ /// always used instead of busy waits, and on computers with Intel� processors employing Hyper-Threading�
/// technology, it helps to prevent hardware thread starvation. SpinWait encapsulates a good mixture of
/// spinning and true yielding.
/// </para>
if (totalMilliseconds < -1 || totalMilliseconds > Int32.MaxValue)
{
throw new System.ArgumentOutOfRangeException(
- nameof(timeout), timeout, Environment.GetResourceString("SpinWait_SpinUntil_TimeoutWrong"));
+ nameof(timeout), timeout, SR.SpinWait_SpinUntil_TimeoutWrong);
}
// Call wait with the timeout milliseconds
if (millisecondsTimeout < Timeout.Infinite)
{
throw new ArgumentOutOfRangeException(
- nameof(millisecondsTimeout), millisecondsTimeout, Environment.GetResourceString("SpinWait_SpinUntil_TimeoutWrong"));
+ nameof(millisecondsTimeout), millisecondsTimeout, SR.SpinWait_SpinUntil_TimeoutWrong);
}
if (condition == null)
{
- throw new ArgumentNullException(nameof(condition), Environment.GetResourceString("SpinWait_SpinUntil_ArgumentNull"));
+ throw new ArgumentNullException(nameof(condition), SR.SpinWait_SpinUntil_ArgumentNull);
}
uint startTime = 0;
if (millisecondsTimeout != 0 && millisecondsTimeout != Timeout.Infinite)
public class SynchronizationLockException : SystemException
{
public SynchronizationLockException()
- : base(Environment.GetResourceString("Arg_SynchronizationLockException"))
+ : base(SR.Arg_SynchronizationLockException)
{
SetErrorCode(__HResults.COR_E_SYNCHRONIZATIONLOCK);
}
/// <summary>
/// Initializes a new instance of the <see cref="T:System.Threading.Tasks.TaskCanceledException"/> class.
/// </summary>
- public TaskCanceledException() : base(Environment.GetResourceString("TaskCanceledException_ctor_DefaultMessage"))
+ public TaskCanceledException() : base(SR.TaskCanceledException_ctor_DefaultMessage)
{
}
/// </summary>
/// <param name="task">A task that has been canceled.</param>
public TaskCanceledException(Task task) :
- base(Environment.GetResourceString("TaskCanceledException_ctor_DefaultMessage"), task != null ? task.CancellationToken : new CancellationToken())
+ base(SR.TaskCanceledException_ctor_DefaultMessage, task != null ? task.CancellationToken : new CancellationToken())
{
m_canceledTask = task;
}
// First, publish the unobserved exception and allow users to observe it
AggregateException exceptionToThrow = new AggregateException(
- Environment.GetResourceString("TaskExceptionHolder_UnhandledException"),
+ SR.TaskExceptionHolder_UnhandledException,
m_faultExceptions);
UnobservedTaskExceptionEventArgs ueea = new UnobservedTaskExceptionEventArgs(exceptionToThrow);
TaskScheduler.PublishUnobservedTaskException(m_task, ueea);
// Anything else is a programming error
else
{
- throw new ArgumentException(Environment.GetResourceString("TaskExceptionHolder_UnknownExceptionType"), nameof(exceptionObject));
+ throw new ArgumentException(SR.TaskExceptionHolder_UnknownExceptionType, nameof(exceptionObject));
}
}
}
{
// Options detected here cause exceptions in FromAsync methods that take beginMethod as a parameter
if ((creationOptions & TaskCreationOptions.LongRunning) != 0)
- throw new ArgumentOutOfRangeException(nameof(creationOptions), Environment.GetResourceString("Task_FromAsync_LongRunning"));
+ throw new ArgumentOutOfRangeException(nameof(creationOptions), SR.Task_FromAsync_LongRunning);
if ((creationOptions & TaskCreationOptions.PreferFairness) != 0)
- throw new ArgumentOutOfRangeException(nameof(creationOptions), Environment.GetResourceString("Task_FromAsync_PreferFairness"));
+ throw new ArgumentOutOfRangeException(nameof(creationOptions), SR.Task_FromAsync_PreferFairness);
}
// Check for general validity of options
for (int i = 0; i < numTasks; i++)
{
var task = tasks[i];
- if (task == null) throw new ArgumentException(Environment.GetResourceString("Task_MultiTaskContinuation_NullTask"), nameof(tasks));
+ if (task == null) throw new ArgumentException(SR.Task_MultiTaskContinuation_NullTask, nameof(tasks));
if (checkArgsOnly) continue;
if (tasks == null)
throw new ArgumentNullException(nameof(tasks));
if (tasks.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Task_MultiTaskContinuation_EmptyTaskList"), nameof(tasks));
+ throw new ArgumentException(SR.Task_MultiTaskContinuation_EmptyTaskList, nameof(tasks));
Contract.EndContractBlock();
Task[] tasksCopy = new Task[tasks.Length];
tasksCopy[i] = tasks[i];
if (tasksCopy[i] == null)
- throw new ArgumentException(Environment.GetResourceString("Task_MultiTaskContinuation_NullTask"), nameof(tasks));
+ throw new ArgumentException(SR.Task_MultiTaskContinuation_NullTask, nameof(tasks));
}
return tasksCopy;
if (tasks == null)
throw new ArgumentNullException(nameof(tasks));
if (tasks.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Task_MultiTaskContinuation_EmptyTaskList"), nameof(tasks));
+ throw new ArgumentException(SR.Task_MultiTaskContinuation_EmptyTaskList, nameof(tasks));
Contract.EndContractBlock();
Task<TResult>[] tasksCopy = new Task<TResult>[tasks.Length];
tasksCopy[i] = tasks[i];
if (tasksCopy[i] == null)
- throw new ArgumentException(Environment.GetResourceString("Task_MultiTaskContinuation_NullTask"), nameof(tasks));
+ throw new ArgumentException(SR.Task_MultiTaskContinuation_NullTask, nameof(tasks));
}
return tasksCopy;
const TaskContinuationOptions illegalMask = TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.LongRunning;
if ((continuationOptions & illegalMask) == illegalMask)
{
- throw new ArgumentOutOfRangeException(nameof(continuationOptions), Environment.GetResourceString("Task_ContinueWith_ESandLR"));
+ throw new ArgumentOutOfRangeException(nameof(continuationOptions), SR.Task_ContinueWith_ESandLR);
}
// Check that no nonsensical options are specified.
// Check that no "fire" options are specified.
if ((continuationOptions & NotOnAny) != 0)
- throw new ArgumentOutOfRangeException(nameof(continuationOptions), Environment.GetResourceString("Task_MultiTaskContinuation_FireOptions"));
+ throw new ArgumentOutOfRangeException(nameof(continuationOptions), SR.Task_MultiTaskContinuation_FireOptions);
Contract.EndContractBlock();
}
}
// Otherwise the scheduler is buggy
if (bInlined && !(task.IsDelegateInvoked || task.IsCanceled))
{
- throw new InvalidOperationException(Environment.GetResourceString("TaskScheduler_InconsistentStateAfterTryExecuteTaskInline"));
+ throw new InvalidOperationException(SR.TaskScheduler_InconsistentStateAfterTryExecuteTaskInline);
}
return bInlined;
{
if (task.ExecutingTaskScheduler != this)
{
- throw new InvalidOperationException(Environment.GetResourceString("TaskScheduler_ExecuteTask_WrongTaskScheduler"));
+ throw new InvalidOperationException(SR.TaskScheduler_ExecuteTask_WrongTaskScheduler);
}
return task.ExecuteEntry();
m_taskScheduler = scheduler;
}
- // returns the scheduler\92s Id
+ // returns the scheduler�s Id
public Int32 Id
{
get { return m_taskScheduler.Id; }
}
- // returns the scheduler\92s GetScheduledTasks
+ // returns the scheduler�s GetScheduledTasks
public IEnumerable<Task> ScheduledTasks
{
get { return m_taskScheduler.GetScheduledTasks(); }
// make sure we have a synccontext to work with
if (synContext == null)
{
- throw new InvalidOperationException(Environment.GetResourceString("TaskScheduler_FromCurrentSynchronizationContext_NoCurrent"));
+ throw new InvalidOperationException(SR.TaskScheduler_FromCurrentSynchronizationContext_NoCurrent);
}
m_synchronizationContext = synContext;
/// <summary>
/// Initializes a new instance of the <see cref="T:System.Threading.Tasks.TaskSchedulerException"/> class.
/// </summary>
- public TaskSchedulerException() : base(Environment.GetResourceString("TaskSchedulerException_ctor_DefaultMessage")) //
+ public TaskSchedulerException() : base(SR.TaskSchedulerException_ctor_DefaultMessage) //
{
}
/// </summary>
/// <param name="innerException">The exception that is the cause of the current exception.</param>
public TaskSchedulerException(Exception innerException)
- : base(Environment.GetResourceString("TaskSchedulerException_ctor_DefaultMessage"), innerException)
+ : base(SR.TaskSchedulerException_ctor_DefaultMessage, innerException)
{
}
{
get
{
- return IsRanToCompletion ? "" + m_result : Environment.GetResourceString("TaskT_DebuggerNoResult");
+ return IsRanToCompletion ? "" + m_result : SR.TaskT_DebuggerNoResult;
}
}
throw new ArgumentNullException(nameof(start));
}
if (0 > maxStackSize)
- throw new ArgumentOutOfRangeException(nameof(maxStackSize), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(maxStackSize), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
SetStartHelper((Delegate)start, maxStackSize);
}
throw new ArgumentNullException(nameof(start));
}
if (0 > maxStackSize)
- throw new ArgumentOutOfRangeException(nameof(maxStackSize), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
+ throw new ArgumentOutOfRangeException(nameof(maxStackSize), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
SetStartHelper((Delegate)start, maxStackSize);
}
// There are ways how to create an unitialized objects through remoting, etc. Avoid AVing in the EE by throwing a nice
// exception here.
if (thread.IsNull())
- throw new ArgumentException(null, Environment.GetResourceString("Argument_InvalidHandle"));
+ throw new ArgumentException(null, SR.Argument_InvalidHandle);
return new ThreadHandle(thread);
}
//We expect the thread to be setup with a ParameterizedThreadStart
// if this constructor is called.
//If we got here then that wasn't the case
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ThreadWrongThreadStart"));
+ throw new InvalidOperationException(SR.InvalidOperation_ThreadWrongThreadStart);
}
m_ThreadStartArg = parameter;
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
{
long tm = (long)timeout.TotalMilliseconds;
if (tm < -1 || tm > (long)Int32.MaxValue)
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
Sleep((int)tm);
}
lock (this)
{
if (m_Name != null)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WriteOnce"));
+ throw new InvalidOperationException(SR.InvalidOperation_WriteOnce);
m_Name = value;
InformThreadNameChange(GetNativeHandle(), value, (value != null) ? value.Length : 0);
int id = ~m_idComplement;
if (id < 0)
{
- throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed"));
+ throw new ObjectDisposedException(SR.ThreadLocal_Disposed);
}
Debugger.NotifyOfCrossThreadDependency();
if (IsValueCreated)
{
- throw new InvalidOperationException(Environment.GetResourceString("ThreadLocal_Value_RecursiveCallsToValue"));
+ throw new InvalidOperationException(SR.ThreadLocal_Value_RecursiveCallsToValue);
}
}
// If the object has been disposed, id will be -1.
if (id < 0)
{
- throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed"));
+ throw new ObjectDisposedException(SR.ThreadLocal_Disposed);
}
// If a slot array has not been created on this thread yet, create it.
if (!m_initialized)
{
- throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed"));
+ throw new ObjectDisposedException(SR.ThreadLocal_Disposed);
}
slot.Value = value;
// Dispose also executes under a lock.
if (!m_initialized)
{
- throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed"));
+ throw new ObjectDisposedException(SR.ThreadLocal_Disposed);
}
LinkedSlot firstRealNode = m_linkedSlot.Next;
{
if (!m_trackAllValues)
{
- throw new InvalidOperationException(Environment.GetResourceString("ThreadLocal_ValuesNotAvailable"));
+ throw new InvalidOperationException(SR.ThreadLocal_ValuesNotAvailable);
}
var list = GetValuesAsList(); // returns null if disposed
- if (list == null) throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed"));
+ if (list == null) throw new ObjectDisposedException(SR.ThreadLocal_Disposed);
return list;
}
}
int id = ~m_idComplement;
if (id < 0)
{
- throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed"));
+ throw new ObjectDisposedException(SR.ThreadLocal_Disposed);
}
LinkedSlotVolatile[] slotArray = ts_slotArray;
// This will result in a "leak" of sorts (since the handle will not be cleaned up)
// but the process is exiting anyway.
//
- // During AD-unload, we don\92t finalize live objects until all threads have been
- // aborted out of the AD. Since these locked regions are CERs, we won\92t abort them
+ // During AD-unload, we don�t finalize live objects until all threads have been
+ // aborted out of the AD. Since these locked regions are CERs, we won�t abort them
// while the lock is held. So there should be no leak on AD-unload.
//
if (Interlocked.CompareExchange(ref m_lock, 1, 0) == 0)
)
{
if (millisecondsTimeOutInterval < -1)
- throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
Contract.EndContractBlock();
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, true);
)
{
if (millisecondsTimeOutInterval < -1)
- throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
Contract.EndContractBlock();
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, false);
)
{
if (millisecondsTimeOutInterval < -1)
- throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
Contract.EndContractBlock();
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, true);
)
{
if (millisecondsTimeOutInterval < -1)
- throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
Contract.EndContractBlock();
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, false);
{
long tm = (long)timeout.TotalMilliseconds;
if (tm < -1)
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
if (tm > (long)Int32.MaxValue)
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_LessEqualToIntegerMaxVal"));
+ throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_LessEqualToIntegerMaxVal);
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)tm, executeOnlyOnce, ref stackMark, true);
}
{
long tm = (long)timeout.TotalMilliseconds;
if (tm < -1)
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
if (tm > (long)Int32.MaxValue)
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_LessEqualToIntegerMaxVal"));
+ throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_LessEqualToIntegerMaxVal);
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)tm, executeOnlyOnce, ref stackMark, false);
}
public sealed class ThreadStartException : SystemException
{
private ThreadStartException()
- : base(Environment.GetResourceString("Arg_ThreadStartException"))
+ : base(SR.Arg_ThreadStartException)
{
SetErrorCode(__HResults.COR_E_THREADSTART);
}
private ThreadStartException(Exception reason)
- : base(Environment.GetResourceString("Arg_ThreadStartException"), reason)
+ : base(SR.Arg_ThreadStartException, reason)
{
SetErrorCode(__HResults.COR_E_THREADSTART);
}
public class ThreadStateException : SystemException
{
public ThreadStateException()
- : base(Environment.GetResourceString("Arg_ThreadStateException"))
+ : base(SR.Arg_ThreadStateException)
{
SetErrorCode(__HResults.COR_E_THREADSTATE);
}
lock (TimerQueue.Instance)
{
if (m_canceled)
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_Generic"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_Generic);
// prevent ThreadAbort while updating state
try { }
int period)
{
if (dueTime < -1)
- throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
if (period < -1)
- throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
Contract.EndContractBlock();
TimerSetup(callback, state, (UInt32)dueTime, (UInt32)period);
{
long dueTm = (long)dueTime.TotalMilliseconds;
if (dueTm < -1)
- throw new ArgumentOutOfRangeException(nameof(dueTm), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(dueTm), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
if (dueTm > MAX_SUPPORTED_TIMEOUT)
- throw new ArgumentOutOfRangeException(nameof(dueTm), Environment.GetResourceString("ArgumentOutOfRange_TimeoutTooLarge"));
+ throw new ArgumentOutOfRangeException(nameof(dueTm), SR.ArgumentOutOfRange_TimeoutTooLarge);
long periodTm = (long)period.TotalMilliseconds;
if (periodTm < -1)
- throw new ArgumentOutOfRangeException(nameof(periodTm), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(periodTm), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
if (periodTm > MAX_SUPPORTED_TIMEOUT)
- throw new ArgumentOutOfRangeException(nameof(periodTm), Environment.GetResourceString("ArgumentOutOfRange_PeriodTooLarge"));
+ throw new ArgumentOutOfRangeException(nameof(periodTm), SR.ArgumentOutOfRange_PeriodTooLarge);
TimerSetup(callback, state, (UInt32)dueTm, (UInt32)periodTm);
}
long period)
{
if (dueTime < -1)
- throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
if (period < -1)
- throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
if (dueTime > MAX_SUPPORTED_TIMEOUT)
- throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_TimeoutTooLarge"));
+ throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_TimeoutTooLarge);
if (period > MAX_SUPPORTED_TIMEOUT)
- throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_PeriodTooLarge"));
+ throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_PeriodTooLarge);
Contract.EndContractBlock();
TimerSetup(callback, state, (UInt32)dueTime, (UInt32)period);
}
public bool Change(int dueTime, int period)
{
if (dueTime < -1)
- throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
if (period < -1)
- throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
Contract.EndContractBlock();
return m_timer.m_timer.Change((UInt32)dueTime, (UInt32)period);
public bool Change(long dueTime, long period)
{
if (dueTime < -1)
- throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
if (period < -1)
- throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
if (dueTime > MAX_SUPPORTED_TIMEOUT)
- throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_TimeoutTooLarge"));
+ throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_TimeoutTooLarge);
if (period > MAX_SUPPORTED_TIMEOUT)
- throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_PeriodTooLarge"));
+ throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_PeriodTooLarge);
Contract.EndContractBlock();
return m_timer.m_timer.Change((UInt32)dueTime, (UInt32)period);
{
if (millisecondsTimeout < -1)
{
- throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
}
Contract.EndContractBlock();
return WaitOne((long)millisecondsTimeout, exitContext);
long tm = (long)timeout.TotalMilliseconds;
if (-1 > tm || (long)Int32.MaxValue < tm)
{
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
}
return WaitOne(tm, exitContext);
}
{
if (waitableSafeHandle == null)
{
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_Generic"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_Generic);
}
Contract.EndContractBlock();
int ret = WaitOneNative(waitableSafeHandle, (uint)millisecondsTimeout, hasThreadAffinity, exitContext);
// This is required to support the Wait which FAS needs (otherwise recursive dependency comes in)
if (safeWaitHandle == null)
{
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_Generic"));
+ throw new ObjectDisposedException(null, SR.ObjectDisposed_Generic);
}
Contract.EndContractBlock();
{
if (waitHandles == null)
{
- throw new ArgumentNullException(nameof(waitHandles), Environment.GetResourceString("ArgumentNull_Waithandles"));
+ throw new ArgumentNullException(nameof(waitHandles), SR.ArgumentNull_Waithandles);
}
if (waitHandles.Length == 0)
{
// in CoreCLR, and ArgumentNullException in the desktop CLR. This is ugly, but so is breaking
// user code.
//
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyWaithandleArray"));
+ throw new ArgumentException(SR.Argument_EmptyWaithandleArray);
}
if (waitHandles.Length > MAX_WAITHANDLES)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_MaxWaitHandles"));
+ throw new NotSupportedException(SR.NotSupported_MaxWaitHandles);
}
if (-1 > millisecondsTimeout)
{
- throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
}
Contract.EndContractBlock();
WaitHandle[] internalWaitHandles = new WaitHandle[waitHandles.Length];
WaitHandle waitHandle = waitHandles[i];
if (waitHandle == null)
- throw new ArgumentNullException("waitHandles[" + i + "]", Environment.GetResourceString("ArgumentNull_ArrayElement"));
+ throw new ArgumentNullException("waitHandles[" + i + "]", SR.ArgumentNull_ArrayElement);
internalWaitHandles[i] = waitHandle;
}
long tm = (long)timeout.TotalMilliseconds;
if (-1 > tm || (long)Int32.MaxValue < tm)
{
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
}
return WaitAll(waitHandles, (int)tm, exitContext);
}
{
if (waitHandles == null)
{
- throw new ArgumentNullException(nameof(waitHandles), Environment.GetResourceString("ArgumentNull_Waithandles"));
+ throw new ArgumentNullException(nameof(waitHandles), SR.ArgumentNull_Waithandles);
}
if (waitHandles.Length == 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyWaithandleArray"));
+ throw new ArgumentException(SR.Argument_EmptyWaithandleArray);
}
if (MAX_WAITHANDLES < waitHandles.Length)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_MaxWaitHandles"));
+ throw new NotSupportedException(SR.NotSupported_MaxWaitHandles);
}
if (-1 > millisecondsTimeout)
{
- throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
}
Contract.EndContractBlock();
WaitHandle[] internalWaitHandles = new WaitHandle[waitHandles.Length];
WaitHandle waitHandle = waitHandles[i];
if (waitHandle == null)
- throw new ArgumentNullException("waitHandles[" + i + "]", Environment.GetResourceString("ArgumentNull_ArrayElement"));
+ throw new ArgumentNullException("waitHandles[" + i + "]", SR.ArgumentNull_ArrayElement);
internalWaitHandles[i] = waitHandle;
}
long tm = (long)timeout.TotalMilliseconds;
if (-1 > tm || (long)Int32.MaxValue < tm)
{
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
}
return WaitAny(waitHandles, (int)tm, exitContext);
}
long tm = (long)timeout.TotalMilliseconds;
if (-1 > tm || (long)Int32.MaxValue < tm)
{
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
}
return SignalAndWait(toSignal, toWaitOn, (int)tm, exitContext);
#endif
}
if (-1 > millisecondsTimeout)
{
- throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
+ throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
}
Contract.EndContractBlock();
if (ERROR_TOO_MANY_POSTS == ret)
{
- throw new InvalidOperationException(Environment.GetResourceString("Threading.WaitHandleTooManyPosts"));
+ throw new InvalidOperationException(SR.Threading_WaitHandleTooManyPosts);
}
//Object was signaled
public class WaitHandleCannotBeOpenedException : ApplicationException
{
- public WaitHandleCannotBeOpenedException() : base(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException"))
+ public WaitHandleCannotBeOpenedException() : base(SR.Threading_WaitHandleCannotBeOpenedException)
{
SetErrorCode(__HResults.COR_E_WAITHANDLECANNOTBEOPENED);
}
// The old way to throw an exception generates quite a lot IL code and assembly code.
// Following is an example:
// C# source
-// throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
+// throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
// IL code:
// IL_0003: ldstr "key"
// IL_0008: ldstr "ArgumentNull_Key"
internal static void ThrowInvalidTypeWithPointersNotSupported(Type targetType)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTypeWithPointersNotSupported", targetType));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidTypeWithPointersNotSupported, targetType));
}
internal static void ThrowIndexOutOfRangeException()
internal static void ThrowArgumentException_DestinationTooShort()
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DestinationTooShort"));
+ throw new ArgumentException(SR.Argument_DestinationTooShort);
}
internal static void ThrowNotSupportedException_CannotCallEqualsOnSpan()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_CannotCallEqualsOnSpan"));
+ throw new NotSupportedException(SR.NotSupported_CannotCallEqualsOnSpan);
}
internal static void ThrowNotSupportedException_CannotCallGetHashCodeOnSpan()
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_CannotCallGetHashCodeOnSpan"));
+ throw new NotSupportedException(SR.NotSupported_CannotCallGetHashCodeOnSpan);
}
internal static void ThrowArgumentOutOfRange_IndexException()
private static ArgumentException GetAddingDuplicateWithKeyArgumentException(object key)
{
- return new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicateWithKey", key));
+ return new ArgumentException(SR.Format(SR.Argument_AddingDuplicateWithKey, key));
}
internal static void ThrowAddingDuplicateWithKeyArgumentException(object key)
private static ArgumentException GetWrongKeyTypeArgumentException(object key, Type targetType)
{
- return new ArgumentException(Environment.GetResourceString("Arg_WrongType", key, targetType), nameof(key));
+ return new ArgumentException(SR.Format(SR.Arg_WrongType, key, targetType), nameof(key));
}
private static ArgumentException GetWrongValueTypeArgumentException(object value, Type targetType)
{
- return new ArgumentException(Environment.GetResourceString("Arg_WrongType", value, targetType), nameof(value));
+ return new ArgumentException(SR.Format(SR.Arg_WrongType, value, targetType), nameof(value));
}
internal static ArgumentOutOfRangeException GetArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
Debug.Assert(Enum.IsDefined(typeof(ExceptionResource), resource),
"The enum value is not defined, please check the ExceptionResource Enum.");
- return Environment.GetResourceString(resource.ToString());
+ return SR.GetResourceString(resource.ToString());
}
}
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
{
Int64 totalMilliSeconds = ((Int64)days * 3600 * 24 + (Int64)hours * 3600 + (Int64)minutes * 60 + seconds) * 1000 + milliseconds;
if (totalMilliSeconds > MaxMilliSeconds || totalMilliSeconds < MinMilliSeconds)
- throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("Overflow_TimeSpanTooLong"));
+ throw new ArgumentOutOfRangeException(null, SR.Overflow_TimeSpanTooLong);
_ticks = (long)totalMilliSeconds * TicksPerMillisecond;
}
// sign was opposite.
// >> 63 gives the sign bit (either 64 1's or 64 0's).
if ((_ticks >> 63 == ts._ticks >> 63) && (_ticks >> 63 != result >> 63))
- throw new OverflowException(Environment.GetResourceString("Overflow_TimeSpanTooLong"));
+ throw new OverflowException(SR.Overflow_TimeSpanTooLong);
return new TimeSpan(result);
}
{
if (value == null) return 1;
if (!(value is TimeSpan))
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeTimeSpan"));
+ throw new ArgumentException(SR.Arg_MustBeTimeSpan);
long t = ((TimeSpan)value)._ticks;
if (_ticks > t) return 1;
if (_ticks < t) return -1;
public TimeSpan Duration()
{
if (Ticks == TimeSpan.MinValue.Ticks)
- throw new OverflowException(Environment.GetResourceString("Overflow_Duration"));
+ throw new OverflowException(SR.Overflow_Duration);
Contract.EndContractBlock();
return new TimeSpan(_ticks >= 0 ? _ticks : -_ticks);
}
private static TimeSpan Interval(double value, int scale)
{
if (Double.IsNaN(value))
- throw new ArgumentException(Environment.GetResourceString("Arg_CannotBeNaN"));
+ throw new ArgumentException(SR.Arg_CannotBeNaN);
Contract.EndContractBlock();
double tmp = value * scale;
double millis = tmp + (value >= 0 ? 0.5 : -0.5);
if ((millis > Int64.MaxValue / TicksPerMillisecond) || (millis < Int64.MinValue / TicksPerMillisecond))
- throw new OverflowException(Environment.GetResourceString("Overflow_TimeSpanTooLong"));
+ throw new OverflowException(SR.Overflow_TimeSpanTooLong);
return new TimeSpan((long)millis * TicksPerMillisecond);
}
public TimeSpan Negate()
{
if (Ticks == TimeSpan.MinValue.Ticks)
- throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum"));
+ throw new OverflowException(SR.Overflow_NegateTwosCompNum);
Contract.EndContractBlock();
return new TimeSpan(-_ticks);
}
// sign was opposite from the first argument's sign.
// >> 63 gives the sign bit (either 64 1's or 64 0's).
if ((_ticks >> 63 != ts._ticks >> 63) && (_ticks >> 63 != result >> 63))
- throw new OverflowException(Environment.GetResourceString("Overflow_TimeSpanTooLong"));
+ throw new OverflowException(SR.Overflow_TimeSpanTooLong);
return new TimeSpan(result);
}
// which is less than 2^44, meaning we won't overflow totalSeconds.
long totalSeconds = (long)hour * 3600 + (long)minute * 60 + (long)second;
if (totalSeconds > MaxSeconds || totalSeconds < MinSeconds)
- throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("Overflow_TimeSpanTooLong"));
+ throw new ArgumentOutOfRangeException(null, SR.Overflow_TimeSpanTooLong);
return totalSeconds * TicksPerSecond;
}
public static TimeSpan operator -(TimeSpan t)
{
if (t._ticks == TimeSpan.MinValue._ticks)
- throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum"));
+ throw new OverflowException(SR.Overflow_NegateTwosCompNum);
return new TimeSpan(-t._ticks);
}
{
if (double.IsNaN(factor))
{
- throw new ArgumentException(Environment.GetResourceString("Arg_CannotBeNaN"), nameof(factor));
+ throw new ArgumentException(SR.Arg_CannotBeNaN, nameof(factor));
}
// Rounding to the nearest tick is as close to the result we would have with unlimited
double ticks = Math.Round(timeSpan.Ticks * factor);
if (ticks > long.MaxValue | ticks < long.MinValue)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_TimeSpanTooLong"));
+ throw new OverflowException(SR.Overflow_TimeSpanTooLong);
}
return FromTicks((long)ticks);
{
if (double.IsNaN(divisor))
{
- throw new ArgumentException(Environment.GetResourceString("Arg_CannotBeNaN"), nameof(divisor));
+ throw new ArgumentException(SR.Arg_CannotBeNaN, nameof(divisor));
}
double ticks = Math.Round(timeSpan.Ticks / divisor);
if (ticks > long.MaxValue | ticks < long.MinValue || double.IsNaN(ticks))
{
- throw new OverflowException(Environment.GetResourceString("Overflow_TimeSpanTooLong"));
+ throw new OverflowException(SR.Overflow_TimeSpanTooLong);
}
return FromTicks((long)ticks);
{
if (dateStart.Kind != DateTimeKind.Unspecified && dateStart.Kind != DateTimeKind.Utc)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeKindMustBeUnspecifiedOrUtc"), nameof(dateStart));
+ throw new ArgumentException(SR.Argument_DateTimeKindMustBeUnspecifiedOrUtc, nameof(dateStart));
}
if (dateEnd.Kind != DateTimeKind.Unspecified && dateEnd.Kind != DateTimeKind.Utc)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeKindMustBeUnspecifiedOrUtc"), nameof(dateEnd));
+ throw new ArgumentException(SR.Argument_DateTimeKindMustBeUnspecifiedOrUtc, nameof(dateEnd));
}
if (daylightTransitionStart.Equals(daylightTransitionEnd) && !noDaylightTransitions)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_TransitionTimesAreIdentical"), nameof(daylightTransitionEnd));
+ throw new ArgumentException(SR.Argument_TransitionTimesAreIdentical, nameof(daylightTransitionEnd));
}
if (dateStart > dateEnd)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_OutOfOrderDateTimes"), nameof(dateStart));
+ throw new ArgumentException(SR.Argument_OutOfOrderDateTimes, nameof(dateStart));
}
// This cannot use UtcOffsetOutOfRange to account for the scenario where Samoa moved across the International Date Line,
// to be -23 (what it takes to go from UTC+13 to UTC-10)
if (daylightDelta.TotalHours < -23.0 || daylightDelta.TotalHours > 14.0)
{
- throw new ArgumentOutOfRangeException(nameof(daylightDelta), daylightDelta, Environment.GetResourceString("ArgumentOutOfRange_UtcOffset"));
+ throw new ArgumentOutOfRangeException(nameof(daylightDelta), daylightDelta, SR.ArgumentOutOfRange_UtcOffset);
}
if (daylightDelta.Ticks % TimeSpan.TicksPerMinute != 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_TimeSpanHasSeconds"), nameof(daylightDelta));
+ throw new ArgumentException(SR.Argument_TimeSpanHasSeconds, nameof(daylightDelta));
}
if (dateStart != DateTime.MinValue && dateStart.Kind == DateTimeKind.Unspecified && dateStart.TimeOfDay != TimeSpan.Zero)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeHasTimeOfDay"), nameof(dateStart));
+ throw new ArgumentException(SR.Argument_DateTimeHasTimeOfDay, nameof(dateStart));
}
if (dateEnd != DateTime.MaxValue && dateEnd.Kind == DateTimeKind.Unspecified && dateEnd.TimeOfDay != TimeSpan.Zero)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeHasTimeOfDay"), nameof(dateEnd));
+ throw new ArgumentException(SR.Argument_DateTimeHasTimeOfDay, nameof(dateEnd));
}
Contract.EndContractBlock();
}
}
catch (ArgumentException e)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e);
+ throw new SerializationException(SR.Serialization_InvalidData, e);
}
}
}
catch (ArgumentException ex)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), ex);
+ throw new SerializationException(SR.Serialization_InvalidData, ex);
}
catch (InvalidTimeZoneException ex)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), ex);
+ throw new SerializationException(SR.Serialization_InvalidData, ex);
}
}
{
if (c != Esc && c != Sep && c != Lhs && c != Rhs)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidEscapeSequence", c));
+ throw new SerializationException(SR.Format(SR.Serialization_InvalidEscapeSequence, c));
}
}
{
if (_currentTokenStartIndex < 0 || _currentTokenStartIndex >= _serializedText.Length)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
State tokenState = State.NotEscaped;
case '\0':
// invalid character
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
default:
break;
}
}
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
/// <summary>
// first verify the internal state of the object
if (_state == State.EndOfLine)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
if (_currentTokenStartIndex < 0 || _currentTokenStartIndex >= _serializedText.Length)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
State tokenState = State.NotEscaped;
StringBuilder token = StringBuilderCache.Acquire(InitialCapacityForString);
case Lhs:
// '[' is an unexpected character
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
case Rhs:
// ']' is an unexpected character
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
case Sep:
_currentTokenStartIndex = i + 1;
case '\0':
// invalid character
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
default:
token.Append(_serializedText[i]);
if (tokenState == State.Escaped)
{
// we are at the end of the serialized text but we are in an escaped state
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidEscapeSequence", string.Empty));
+ throw new SerializationException(SR.Format(SR.Serialization_InvalidEscapeSequence, string.Empty));
}
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
/// <summary>
DateTime time;
if (!DateTime.TryParseExact(token, format, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out time))
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
return time;
}
}
catch (ArgumentOutOfRangeException e)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e);
+ throw new SerializationException(SR.Serialization_InvalidData, e);
}
}
int value;
if (!int.TryParse(token, NumberStyles.AllowLeadingSign /* "[sign]digits" */, CultureInfo.InvariantCulture, out value))
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
return value;
}
// the AdjustmentRule array must end with a separator
if (_state == State.EndOfLine)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
if (_currentTokenStartIndex < 0 || _currentTokenStartIndex >= _serializedText.Length)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
return count != 0 ? rules.ToArray() : null;
if (_currentTokenStartIndex < 0 || _currentTokenStartIndex >= _serializedText.Length)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
// check to see if the very first token we see is the separator
// verify the current token is a left-hand-side marker ("[")
if (_serializedText[_currentTokenStartIndex] != Lhs)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
_currentTokenStartIndex++;
if (_state == State.EndOfLine || _currentTokenStartIndex >= _serializedText.Length)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
// Check if we have baseUtcOffsetDelta in the serialized string and then deserialize it
if (_state == State.EndOfLine || _currentTokenStartIndex >= _serializedText.Length)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
if (_serializedText[_currentTokenStartIndex] != Rhs)
}
catch (ArgumentException e)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e);
+ throw new SerializationException(SR.Serialization_InvalidData, e);
}
// finally set the state to either EndOfLine or StartOfToken for the next caller
//
// we are at the end of the line or we are starting at a "]" character
//
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
if (_currentTokenStartIndex < 0 || _currentTokenStartIndex >= _serializedText.Length)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
// verify the current token is a left-hand-side marker ("[")
if (_serializedText[_currentTokenStartIndex] != Lhs)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
_currentTokenStartIndex++;
if (isFixedDate != 0 && isFixedDate != 1)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
TransitionTime transition;
}
catch (ArgumentException e)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e);
+ throw new SerializationException(SR.Serialization_InvalidData, e);
}
}
else
}
catch (ArgumentException e)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e);
+ throw new SerializationException(SR.Serialization_InvalidData, e);
}
}
if (_state == State.EndOfLine || _currentTokenStartIndex >= _serializedText.Length)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
if (_serializedText[_currentTokenStartIndex] != Rhs)
if (!sepFound)
{
// we MUST end on a separator
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"));
+ throw new SerializationException(SR.Serialization_InvalidData);
}
// finally set the state to either EndOfLine or StartOfToken for the next caller
{
if (timeOfDay.Kind != DateTimeKind.Unspecified)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeKindMustBeUnspecified"), nameof(timeOfDay));
+ throw new ArgumentException(SR.Argument_DateTimeKindMustBeUnspecified, nameof(timeOfDay));
}
// Month range 1-12
if (month < 1 || month > 12)
{
- throw new ArgumentOutOfRangeException(nameof(month), Environment.GetResourceString("ArgumentOutOfRange_MonthParam"));
+ throw new ArgumentOutOfRangeException(nameof(month), SR.ArgumentOutOfRange_MonthParam);
}
// Day range 1-31
if (day < 1 || day > 31)
{
- throw new ArgumentOutOfRangeException(nameof(day), Environment.GetResourceString("ArgumentOutOfRange_DayParam"));
+ throw new ArgumentOutOfRangeException(nameof(day), SR.ArgumentOutOfRange_DayParam);
}
// Week range 1-5
if (week < 1 || week > 5)
{
- throw new ArgumentOutOfRangeException(nameof(week), Environment.GetResourceString("ArgumentOutOfRange_Week"));
+ throw new ArgumentOutOfRangeException(nameof(week), SR.ArgumentOutOfRange_Week);
}
// DayOfWeek range 0-6
if ((int)dayOfWeek < 0 || (int)dayOfWeek > 6)
{
- throw new ArgumentOutOfRangeException(nameof(dayOfWeek), Environment.GetResourceString("ArgumentOutOfRange_DayOfWeek"));
+ throw new ArgumentOutOfRangeException(nameof(dayOfWeek), SR.ArgumentOutOfRange_DayOfWeek);
}
Contract.EndContractBlock();
if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1 || (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeHasTicks"), nameof(timeOfDay));
+ throw new ArgumentException(SR.Argument_DateTimeHasTicks, nameof(timeOfDay));
}
}
}
catch (ArgumentException e)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e);
+ throw new SerializationException(SR.Serialization_InvalidData, e);
}
}
}
catch (IOException ex)
{
- e = new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_InvalidFileData", id, timeZoneFilePath), ex);
+ e = new InvalidTimeZoneException(SR.Format(SR.InvalidTimeZone_InvalidFileData, id, timeZoneFilePath), ex);
return TimeZoneInfoResult.InvalidTimeZoneException;
}
if (value == null)
{
- e = new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_InvalidFileData", id, timeZoneFilePath));
+ e = new InvalidTimeZoneException(SR.Format(SR.InvalidTimeZone_InvalidFileData, id, timeZoneFilePath));
return TimeZoneInfoResult.InvalidTimeZoneException;
}
}
else if (id.Length == 0 || id.Contains("\0"))
{
- throw new TimeZoneNotFoundException(Environment.GetResourceString("TimeZoneNotFound_MissingData", id));
+ throw new TimeZoneNotFoundException(SR.Format(SR.TimeZoneNotFound_MissingData, id));
}
TimeZoneInfo value;
}
else if (result == TimeZoneInfoResult.SecurityException)
{
- throw new SecurityException(Environment.GetResourceString("Security_CannotReadFileData", id), e);
+ throw new SecurityException(SR.Format(SR.Security_CannotReadFileData, id), e);
}
else
{
- throw new TimeZoneNotFoundException(Environment.GetResourceString("TimeZoneNotFound_MissingData", id), e);
+ throw new TimeZoneNotFoundException(SR.Format(SR.TimeZoneNotFound_MissingData, id), e);
}
}
return transitionTypes[0];
}
- throw new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_NoTTInfoStructures"));
+ throw new InvalidTimeZoneException(SR.InvalidTimeZone_NoTTInfoStructures);
}
/// <summary>
DayOfWeek day;
if (!TZif_ParseMDateRule(date, out month, out week, out day))
{
- throw new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_UnparseablePosixMDateString", date));
+ throw new InvalidTimeZoneException(SR.Format(SR.InvalidTimeZone_UnparseablePosixMDateString, date));
}
DateTime timeOfDay;
// One of them *could* be supported if we relaxed the TransitionTime validation rules, and allowed
// "IsFixedDateRule = true, Month = 0, Day = n" to mean the nth day of the year, picking one of the rules above
- throw new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_JulianDayNotSupported"));
+ throw new InvalidTimeZoneException(SR.InvalidTimeZone_JulianDayNotSupported);
}
}
{
if (data == null || data.Length < index + Length)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_TimeZoneInfoInvalidTZif"), nameof(data));
+ throw new ArgumentException(SR.Argument_TimeZoneInfoInvalidTZif, nameof(data));
}
Contract.EndContractBlock();
UtcOffset = new TimeSpan(0, 0, TZif_ToInt32(data, index + 00));
if (Magic != 0x545A6966)
{
// 0x545A6966 = {0x54, 0x5A, 0x69, 0x66} = "TZif"
- throw new ArgumentException(Environment.GetResourceString("Argument_TimeZoneInfoBadTZif"), nameof(data));
+ throw new ArgumentException(SR.Argument_TimeZoneInfoBadTZif, nameof(data));
}
byte version = data[index + 04];
}
else if (id.Length == 0 || id.Length > MaxKeyLength || id.Contains("\0"))
{
- throw new TimeZoneNotFoundException(Environment.GetResourceString("TimeZoneNotFound_MissingData", id));
+ throw new TimeZoneNotFoundException(SR.Format(SR.TimeZoneNotFound_MissingData, id));
}
TimeZoneInfo value;
}
else if (result == TimeZoneInfoResult.InvalidTimeZoneException)
{
- throw new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_InvalidRegistryData", id), e);
+ throw new InvalidTimeZoneException(SR.Format(SR.InvalidTimeZone_InvalidRegistryData, id), e);
}
else if (result == TimeZoneInfoResult.SecurityException)
{
- throw new SecurityException(Environment.GetResourceString("Security_CannotReadRegistryData", id), e);
+ throw new SecurityException(SR.Format(SR.Security_CannotReadRegistryData, id), e);
}
else
{
- throw new TimeZoneNotFoundException(Environment.GetResourceString("TimeZoneNotFound_MissingData", id), e);
+ throw new TimeZoneNotFoundException(SR.Format(SR.TimeZoneNotFound_MissingData, id), e);
}
}
{
if (!SupportsDaylightSavingTime)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeOffsetIsNotAmbiguous"), nameof(dateTimeOffset));
+ throw new ArgumentException(SR.Argument_DateTimeOffsetIsNotAmbiguous, nameof(dateTimeOffset));
}
Contract.EndContractBlock();
if (!isAmbiguous)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeOffsetIsNotAmbiguous"), nameof(dateTimeOffset));
+ throw new ArgumentException(SR.Argument_DateTimeOffsetIsNotAmbiguous, nameof(dateTimeOffset));
}
// the passed in dateTime is ambiguous in this TimeZoneInfo instance
{
if (!SupportsDaylightSavingTime)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeIsNotAmbiguous"), nameof(dateTime));
+ throw new ArgumentException(SR.Argument_DateTimeIsNotAmbiguous, nameof(dateTime));
}
Contract.EndContractBlock();
if (!isAmbiguous)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeIsNotAmbiguous"), nameof(dateTime));
+ throw new ArgumentException(SR.Argument_DateTimeIsNotAmbiguous, nameof(dateTime));
}
// the passed in dateTime is ambiguous in this TimeZoneInfo instance
DateTimeKind sourceKind = cachedData.GetCorrespondingKind(sourceTimeZone);
if (((flags & TimeZoneInfoOptions.NoThrowOnInvalidTime) == 0) && (dateTime.Kind != DateTimeKind.Unspecified) && (dateTime.Kind != sourceKind))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_ConvertMismatch"), nameof(sourceTimeZone));
+ throw new ArgumentException(SR.Argument_ConvertMismatch, nameof(sourceTimeZone));
}
//
// period that supports DST
if (((flags & TimeZoneInfoOptions.NoThrowOnInvalidTime) == 0) && GetIsInvalidTime(dateTime, sourceRule, sourceDaylightTime))
{
- throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeIsInvalid"), nameof(dateTime));
+ throw new ArgumentException(SR.Argument_DateTimeIsInvalid, nameof(dateTime));
}
sourceIsDaylightSavings = GetIsDaylightSavings(dateTime, sourceRule, sourceDaylightTime, flags);
}
if (source.Length == 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidSerializedString", source), nameof(source));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidSerializedString, source), nameof(source));
}
Contract.EndContractBlock();
if (adjustmentRulesSupportDst != _supportsDaylightSavingTime)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_CorruptField", "SupportsDaylightSavingTime"));
+ throw new SerializationException(SR.Format(SR.Serialization_CorruptField, "SupportsDaylightSavingTime"));
}
}
catch (ArgumentException e)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e);
+ throw new SerializationException(SR.Serialization_InvalidData, e);
}
catch (InvalidTimeZoneException e)
{
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e);
+ throw new SerializationException(SR.Serialization_InvalidData, e);
}
}
if (id.Length == 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidId", id), nameof(id));
+ throw new ArgumentException(SR.Format(SR.Argument_InvalidId, id), nameof(id));
}
if (UtcOffsetOutOfRange(baseUtcOffset))
{
- throw new ArgumentOutOfRangeException(nameof(baseUtcOffset), Environment.GetResourceString("ArgumentOutOfRange_UtcOffset"));
+ throw new ArgumentOutOfRangeException(nameof(baseUtcOffset), SR.ArgumentOutOfRange_UtcOffset);
}
if (baseUtcOffset.Ticks % TimeSpan.TicksPerMinute != 0)
{
- throw new ArgumentException(Environment.GetResourceString("Argument_TimeSpanHasSeconds"), nameof(baseUtcOffset));
+ throw new ArgumentException(SR.Argument_TimeSpanHasSeconds, nameof(baseUtcOffset));
}
Contract.EndContractBlock();
if (current == null)
{
- throw new InvalidTimeZoneException(Environment.GetResourceString("Argument_AdjustmentRulesNoNulls"));
+ throw new InvalidTimeZoneException(SR.Argument_AdjustmentRulesNoNulls);
}
// FUTURE: check to see if this rule supports Daylight Saving Time
if (UtcOffsetOutOfRange(baseUtcOffset + current.DaylightDelta))
{
- throw new InvalidTimeZoneException(Environment.GetResourceString("ArgumentOutOfRange_UtcOffsetAndDaylightDelta"));
+ throw new InvalidTimeZoneException(SR.ArgumentOutOfRange_UtcOffsetAndDaylightDelta);
}
if (prev != null && current.DateStart <= prev.DateEnd)
{
// verify the rules are in chronological order and the DateStart/DateEnd do not overlap
- throw new InvalidTimeZoneException(Environment.GetResourceString("Argument_AdjustmentRulesOutOfOrder"));
+ throw new InvalidTimeZoneException(SR.Argument_AdjustmentRulesOutOfOrder);
}
}
}
if (objTuple == null)
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other");
}
return comparer.Compare(m_Item1, objTuple.m_Item1);
if (objTuple == null)
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other");
}
int c = 0;
if (objTuple == null)
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other");
}
int c = 0;
if (objTuple == null)
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other");
}
int c = 0;
if (objTuple == null)
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other");
}
int c = 0;
if (objTuple == null)
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other");
}
int c = 0;
if (objTuple == null)
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other");
}
int c = 0;
{
if (!(rest is ITupleInternal))
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleLastArgumentNotATuple"));
+ throw new ArgumentException(SR.ArgumentException_TupleLastArgumentNotATuple);
}
m_Item1 = item1;
if (objTuple == null)
{
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other");
}
int c = 0;
public class TypeLoadException : SystemException, ISerializable
{
public TypeLoadException()
- : base(Environment.GetResourceString("Arg_TypeLoadException"))
+ : base(SR.Arg_TypeLoadException)
{
SetErrorCode(__HResults.COR_E_TYPELOAD);
}
{
if ((ClassName == null) &&
(ResourceId == 0))
- _message = Environment.GetResourceString("Arg_TypeLoadException");
+ _message = SR.Arg_TypeLoadException;
else
{
if (AssemblyName == null)
- AssemblyName = Environment.GetResourceString("IO_UnknownFileName");
+ AssemblyName = SR.IO_UnknownFileName;
if (ClassName == null)
- ClassName = Environment.GetResourceString("IO_UnknownFileName");
+ ClassName = SR.IO_UnknownFileName;
String format = null;
GetTypeLoadExceptionMessage(ResourceId, JitHelpers.GetStringHandleOnStack(ref format));
if (typeName == null)
throw new ArgumentNullException(nameof(typeName));
if (typeName.Length > 0 && typeName[0] == '\0')
- throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength"));
+ throw new ArgumentException(SR.Format_StringZeroLength);
Contract.EndContractBlock();
Type ret = null;
{
// This can only happen if the type name is an empty string or if the first char is '\0'
if (throwOnError)
- throw new TypeLoadException(Environment.GetResourceString("Arg_TypeLoadNullStr"));
+ throw new TypeLoadException(SR.Arg_TypeLoadNullStr);
return null;
}
assembly = assemblyResolver(new AssemblyName(asmName));
if (assembly == null && throwOnError)
{
- throw new FileNotFoundException(Environment.GetResourceString("FileNotFound_ResolveAssembly", asmName));
+ throw new FileNotFoundException(SR.Format(SR.FileNotFound_ResolveAssembly, asmName));
}
}
if (type == null && throwOnError)
{
string errorString = assembly == null ?
- Environment.GetResourceString("TypeLoad_ResolveType", OuterMostTypeName) :
- Environment.GetResourceString("TypeLoad_ResolveTypeFromAssembly", OuterMostTypeName, assembly.FullName);
+ SR.Format(SR.TypeLoad_ResolveType, OuterMostTypeName):
+ SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, OuterMostTypeName, assembly.FullName);
throw new TypeLoadException(errorString);
}
if (type == null)
{
if (throwOnError)
- throw new TypeLoadException(Environment.GetResourceString("TypeLoad_ResolveNestedType", names[i], names[i - 1]));
+ throw new TypeLoadException(SR.Format(SR.TypeLoad_ResolveNestedType, names[i], names[i - 1]));
else
break;
}
public class TypeUnloadedException : SystemException
{
public TypeUnloadedException()
- : base(Environment.GetResourceString("Arg_TypeUnloadedException"))
+ : base(SR.Arg_TypeUnloadedException)
{
SetErrorCode(__HResults.COR_E_TYPEUNLOADED);
}
throw new ArgumentNullException(nameof(flds));
Contract.EndContractBlock();
if (flds.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_ArrayZeroError"));
+ throw new ArgumentException(SR.Arg_ArrayZeroError);
IntPtr[] fields = new IntPtr[flds.Length];
// For proper handling of Nullable<T> don't change GetType() to something like 'IsAssignableFrom'
{
RuntimeFieldInfo field = flds[i] as RuntimeFieldInfo;
if (field == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo"));
+ throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo);
if (field.IsInitOnly || field.IsStatic)
- throw new ArgumentException(Environment.GetResourceString("Argument_TypedReferenceInvalidField"));
+ throw new ArgumentException(SR.Argument_TypedReferenceInvalidField);
if (targetType != field.GetDeclaringTypeInternal() && !targetType.IsSubclassOf(field.GetDeclaringTypeInternal()))
- throw new MissingMemberException(Environment.GetResourceString("MissingMemberTypeRef"));
+ throw new MissingMemberException(SR.MissingMemberTypeRef);
RuntimeType fieldType = (RuntimeType)field.FieldType;
if (fieldType.IsPrimitive)
- throw new ArgumentException(Environment.GetResourceString("Arg_TypeRefPrimitve"));
+ throw new ArgumentException(SR.Arg_TypeRefPrimitve);
if (i < (flds.Length - 1) && !fieldType.IsValueType)
- throw new MissingMemberException(Environment.GetResourceString("MissingMemberNestErr"));
+ throw new MissingMemberException(SR.MissingMemberNestErr);
fields[i] = field.FieldHandle.Value;
targetType = fieldType;
public override bool Equals(Object o)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_NYI"));
+ throw new NotSupportedException(SR.NotSupported_NYI);
}
public unsafe static Object ToObject(TypedReference value)
{
return ((int)m_value - (int)(((UInt16)value).m_value));
}
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeUInt16"));
+ throw new ArgumentException(SR.Arg_MustBeUInt16);
}
public int CompareTo(UInt16 value)
}
catch (OverflowException e)
{
- throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"), e);
+ throw new OverflowException(SR.Overflow_UInt16, e);
}
- if (i > MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
+ if (i > MaxValue) throw new OverflowException(SR.Overflow_UInt16);
return (ushort)i;
}
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "UInt16", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt16", "DateTime"));
}
/// <internalonly/>
if (m_value > i) return 1;
return 0;
}
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeUInt32"));
+ throw new ArgumentException(SR.Arg_MustBeUInt32);
}
public int CompareTo(UInt32 value)
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "UInt32", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt32", "DateTime"));
}
/// <internalonly/>
if (m_value > i) return 1;
return 0;
}
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeUInt64"));
+ throw new ArgumentException(SR.Arg_MustBeUInt64);
}
public int CompareTo(UInt64 value)
/// <internalonly/>
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "UInt64", "DateTime"));
+ throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt64", "DateTime"));
}
/// <internalonly/>
if (Size == 4 && l > UInt32.MaxValue)
{
- throw new ArgumentException(Environment.GetResourceString("Serialization_InvalidPtrValue"));
+ throw new ArgumentException(SR.Serialization_InvalidPtrValue);
}
m_value = (void*)l;
private void ThrowInsufficientInformation(string field)
{
throw new SerializationException(
- Environment.GetResourceString("Serialization_InsufficientDeserializationState", field));
+ SR.Format(SR.Serialization_InsufficientDeserializationState, field));
}
#endregion
#region ISerializable
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnitySerHolder"));
+ throw new NotSupportedException(SR.NotSupported_UnitySerHolder);
}
#endregion
if (namedModule == null)
throw new SerializationException(
- Environment.GetResourceString("Serialization_UnableToFindModule", m_data, m_assemblyName));
+ SR.Format(SR.Serialization_UnableToFindModule, m_data, m_assemblyName));
return namedModule;
}
}
default:
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidUnity"));
+ throw new ArgumentException(SR.Argument_InvalidUnity);
}
}
#endregion
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
{
if (!(rest is IValueTupleInternal))
{
- throw new ArgumentException(SR.ArgumentException_ValueTupleLastArgumentNotATuple);
+ throw new ArgumentException(SR.ArgumentException_ValueTupleLastArgumentNotAValueTuple);
}
Item1 = item1;
break;
default:
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnknownTypeCode", ic.GetTypeCode()));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_UnknownTypeCode, ic.GetTypeCode()));
}
}
}
}
else
{
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_CannotCoerceByRefVariant"));
+ throw new InvalidCastException(SR.InvalidCast_CannotCoerceByRefVariant);
}
break;
default:
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_CannotCoerceByRefVariant"));
+ throw new InvalidCastException(SR.InvalidCast_CannotCoerceByRefVariant);
}
}
else
break;
default:
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_CannotCoerceByRefVariant"));
+ throw new InvalidCastException(SR.InvalidCast_CannotCoerceByRefVariant);
}
}
}
public Version(int major, int minor, int build, int revision)
{
if (major < 0)
- throw new ArgumentOutOfRangeException(nameof(major), Environment.GetResourceString("ArgumentOutOfRange_Version"));
+ throw new ArgumentOutOfRangeException(nameof(major), SR.ArgumentOutOfRange_Version);
if (minor < 0)
- throw new ArgumentOutOfRangeException(nameof(minor), Environment.GetResourceString("ArgumentOutOfRange_Version"));
+ throw new ArgumentOutOfRangeException(nameof(minor), SR.ArgumentOutOfRange_Version);
if (build < 0)
- throw new ArgumentOutOfRangeException(nameof(build), Environment.GetResourceString("ArgumentOutOfRange_Version"));
+ throw new ArgumentOutOfRangeException(nameof(build), SR.ArgumentOutOfRange_Version);
if (revision < 0)
- throw new ArgumentOutOfRangeException(nameof(revision), Environment.GetResourceString("ArgumentOutOfRange_Version"));
+ throw new ArgumentOutOfRangeException(nameof(revision), SR.ArgumentOutOfRange_Version);
Contract.EndContractBlock();
_Major = major;
public Version(int major, int minor, int build)
{
if (major < 0)
- throw new ArgumentOutOfRangeException(nameof(major), Environment.GetResourceString("ArgumentOutOfRange_Version"));
+ throw new ArgumentOutOfRangeException(nameof(major), SR.ArgumentOutOfRange_Version);
if (minor < 0)
- throw new ArgumentOutOfRangeException(nameof(minor), Environment.GetResourceString("ArgumentOutOfRange_Version"));
+ throw new ArgumentOutOfRangeException(nameof(minor), SR.ArgumentOutOfRange_Version);
if (build < 0)
- throw new ArgumentOutOfRangeException(nameof(build), Environment.GetResourceString("ArgumentOutOfRange_Version"));
+ throw new ArgumentOutOfRangeException(nameof(build), SR.ArgumentOutOfRange_Version);
Contract.EndContractBlock();
public Version(int major, int minor)
{
if (major < 0)
- throw new ArgumentOutOfRangeException(nameof(major), Environment.GetResourceString("ArgumentOutOfRange_Version"));
+ throw new ArgumentOutOfRangeException(nameof(major), SR.ArgumentOutOfRange_Version);
if (minor < 0)
- throw new ArgumentOutOfRangeException(nameof(minor), Environment.GetResourceString("ArgumentOutOfRange_Version"));
+ throw new ArgumentOutOfRangeException(nameof(minor), SR.ArgumentOutOfRange_Version);
Contract.EndContractBlock();
_Major = major;
Version v = version as Version;
if (v == null)
{
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeVersion"));
+ throw new ArgumentException(SR.Arg_MustBeVersion);
}
return CompareTo(v);
return StringBuilderCache.GetStringAndRelease(sb);
default:
if (_Build == -1)
- throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper", "0", "2"), nameof(fieldCount));
+ throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_Bounds_Lower_Upper, "0", "2"), nameof(fieldCount));
if (fieldCount == 3)
{
}
if (_Revision == -1)
- throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper", "0", "3"), nameof(fieldCount));
+ throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_Bounds_Lower_Upper, "0", "3"), nameof(fieldCount));
if (fieldCount == 4)
{
return StringBuilderCache.GetStringAndRelease(sb);
}
- throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper", "0", "4"), nameof(fieldCount));
+ throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_Bounds_Lower_Upper, "0", "4"), nameof(fieldCount));
}
}
case ParseFailureKind.ArgumentNullException:
return new ArgumentNullException(m_argumentName);
case ParseFailureKind.ArgumentException:
- return new ArgumentException(Environment.GetResourceString("Arg_VersionString"));
+ return new ArgumentException(SR.Arg_VersionString);
case ParseFailureKind.ArgumentOutOfRangeException:
- return new ArgumentOutOfRangeException(m_exceptionArgument, Environment.GetResourceString("ArgumentOutOfRange_Version"));
+ return new ArgumentOutOfRangeException(m_exceptionArgument, SR.ArgumentOutOfRange_Version);
case ParseFailureKind.FormatException:
// Regenerate the FormatException as would be thrown by Int32.Parse()
try
return e;
}
Debug.Assert(false, "Int32.Parse() did not throw exception but TryParse failed: " + m_exceptionArgument);
- return new FormatException(Environment.GetResourceString("Format_InvalidString"));
+ return new FormatException(SR.Format_InvalidString);
default:
Debug.Assert(false, "Unmatched case in Version.GetVersionParseException() for value: " + m_failure);
- return new ArgumentException(Environment.GetResourceString("Arg_VersionString"));
+ return new ArgumentException(SR.Arg_VersionString);
}
}
}