mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
Use SR in System.Composition.Convention (dotnet/corefx#21499)
Commit migrated from https://github.com/dotnet/corefx/commit/f94866d4e6d783bcb6ee4c32114c2161d5287abb
This commit is contained in:
1 parent
99a5878e1d
commit
7fc86ffb7e
5 files changed
+14
-229
No files matched your search
+9
-9
@@ -17,7 +17,7 @@ namespace Microsoft.Composition.Diagnostics
|
||||
if (CompositionTraceSource.CanWriteInformation)
|
||||
{
|
||||
CompositionTraceSource.WriteInformation(CompositionTraceId.Registration_ConstructorConventionOverridden,
|
||||
Strings.Registration_ConstructorConventionOverridden,
|
||||
SR.Registration_ConstructorConventionOverridden,
|
||||
type.FullName);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ namespace Microsoft.Composition.Diagnostics
|
||||
if (CompositionTraceSource.CanWriteWarning)
|
||||
{
|
||||
CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_TypeExportConventionOverridden,
|
||||
Strings.Registration_TypeExportConventionOverridden,
|
||||
SR.Registration_TypeExportConventionOverridden,
|
||||
type.FullName);
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace Microsoft.Composition.Diagnostics
|
||||
if (CompositionTraceSource.CanWriteWarning)
|
||||
{
|
||||
CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_MemberExportConventionOverridden,
|
||||
Strings.Registration_MemberExportConventionOverridden,
|
||||
SR.Registration_MemberExportConventionOverridden,
|
||||
member.Name, type.FullName);
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ namespace Microsoft.Composition.Diagnostics
|
||||
if (CompositionTraceSource.CanWriteWarning)
|
||||
{
|
||||
CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_MemberImportConventionOverridden,
|
||||
Strings.Registration_MemberImportConventionOverridden,
|
||||
SR.Registration_MemberImportConventionOverridden,
|
||||
member.Name, type.FullName);
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ namespace Microsoft.Composition.Diagnostics
|
||||
if (CompositionTraceSource.CanWriteWarning)
|
||||
{
|
||||
CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_OnSatisfiedImportNotificationOverridden,
|
||||
Strings.Registration_OnSatisfiedImportNotificationOverridden,
|
||||
SR.Registration_OnSatisfiedImportNotificationOverridden,
|
||||
member.Name, type.FullName);
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace Microsoft.Composition.Diagnostics
|
||||
if (CompositionTraceSource.CanWriteWarning)
|
||||
{
|
||||
CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_PartCreationConventionOverridden,
|
||||
Strings.Registration_PartCreationConventionOverridden,
|
||||
SR.Registration_PartCreationConventionOverridden,
|
||||
type.FullName);
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ namespace Microsoft.Composition.Diagnostics
|
||||
if (CompositionTraceSource.CanWriteWarning)
|
||||
{
|
||||
CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_MemberImportConventionMatchedTwice,
|
||||
Strings.Registration_MemberImportConventionMatchedTwice,
|
||||
SR.Registration_MemberImportConventionMatchedTwice,
|
||||
member.Name, type.FullName);
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ namespace Microsoft.Composition.Diagnostics
|
||||
if (CompositionTraceSource.CanWriteWarning)
|
||||
{
|
||||
CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_PartMetadataConventionOverridden,
|
||||
Strings.Registration_PartMetadataConventionOverridden,
|
||||
SR.Registration_PartMetadataConventionOverridden,
|
||||
type.FullName);
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace Microsoft.Composition.Diagnostics
|
||||
if (CompositionTraceSource.CanWriteWarning)
|
||||
{
|
||||
CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_ParameterImportConventionOverridden,
|
||||
Strings.Registration_ParameterImportConventionOverridden,
|
||||
SR.Registration_ParameterImportConventionOverridden,
|
||||
parameter.Name, constructor.Name);
|
||||
}
|
||||
}
|
||||
|
||||
File renamed without changes.
@@ -1,203 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.16815
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Internal {
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Strings {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Strings() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Composition.Convention.Strings", typeof(Strings).GetTypeInfo().Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The value of argument '{0}' is not supported. The expression must use operator new..
|
||||
/// </summary>
|
||||
internal static string Argument_ExpressionMustBeNew {
|
||||
get {
|
||||
return ResourceManager.GetString("Argument_ExpressionMustBeNew", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The value of argument '{0}' is not supported. The expression must be a property member expression..
|
||||
/// </summary>
|
||||
internal static string Argument_ExpressionMustBePropertyMember {
|
||||
get {
|
||||
return ResourceManager.GetString("Argument_ExpressionMustBePropertyMember", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The value of argument '{0}' is not supported. The expression must be a void Method() member expression.
|
||||
/// </summary>
|
||||
internal static string Argument_ExpressionMustBeVoidMethodWithNoArguments
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceManager.GetString("Argument_ExpressionMustBeVoidMethodWithNoArguments", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to '{0}' cannot be an empty string ("")..
|
||||
/// </summary>
|
||||
internal static string ArgumentException_EmptyString {
|
||||
get {
|
||||
return ResourceManager.GetString("ArgumentException_EmptyString", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The value of argument '{0}' ({1}) is not supported. Allowed values are : '{2}'..
|
||||
/// </summary>
|
||||
internal static string ArgumentOutOfRange_InvalidEnumInSet {
|
||||
get {
|
||||
return ResourceManager.GetString("ArgumentOutOfRange_InvalidEnumInSet", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Internal error occurred. Additional information: '{0}'..
|
||||
/// </summary>
|
||||
internal static string InternalExceptionMessage {
|
||||
get {
|
||||
return ResourceManager.GetString("InternalExceptionMessage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A constructor selection convention that would apply to Type '{0}' has been overridden by attributes applied in the source file or by a prior convention..
|
||||
/// </summary>
|
||||
internal static string Registration_ConstructorConventionOverridden {
|
||||
get {
|
||||
return ResourceManager.GetString("Registration_ConstructorConventionOverridden", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to An Export specification convention that would apply to Member '{0}' of type '{1}' has been overridden by attributes applied in the source file or by a prior convention..
|
||||
/// </summary>
|
||||
internal static string Registration_MemberExportConventionOverridden {
|
||||
get {
|
||||
return ResourceManager.GetString("Registration_MemberExportConventionOverridden", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Only one import specification convention can apply to a single Member. More than one convention specification applies to this Member '{1}' of Type '{0}'..
|
||||
/// </summary>
|
||||
internal static string Registration_MemberImportConventionMatchedTwice {
|
||||
get {
|
||||
return ResourceManager.GetString("Registration_MemberImportConventionMatchedTwice", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to An Import specification convention that would apply to Member '{0}' of type '{1}' has been overridden by attributes applied in the source file or by a prior convention..
|
||||
/// </summary>
|
||||
internal static string Registration_MemberImportConventionOverridden {
|
||||
get {
|
||||
return ResourceManager.GetString("Registration_MemberImportConventionOverridden", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A OnSatisfiedImport specification convention that would apply to Type '{0}' has been overridden by attributes applied in the source file or by a prior convention..
|
||||
/// </summary>
|
||||
internal static string Registration_OnSatisfiedImportNotificationOverridden {
|
||||
get
|
||||
{
|
||||
return ResourceManager.GetString("Registration_OnSatisfiedImportNotificationOverridden", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A ParameterImport specification convention that would apply to Parameter '{0}' of Constructor '{1}' has been overridden by attributes applied in the source file or by a prior convention..
|
||||
/// </summary>
|
||||
internal static string Registration_ParameterImportConventionOverridden {
|
||||
get {
|
||||
return ResourceManager.GetString("Registration_ParameterImportConventionOverridden", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A PartCreationPolicy specification convention that would apply to Type '{0}' has been overridden by attributes applied in the source file or by a prior convention..
|
||||
/// </summary>
|
||||
internal static string Registration_PartCreationConventionOverridden {
|
||||
get {
|
||||
return ResourceManager.GetString("Registration_PartCreationConventionOverridden", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A PartMetadata specification convention that would apply to Type '{0}' has been overridden by attributes applied in the source file or by a prior convention..
|
||||
/// </summary>
|
||||
internal static string Registration_PartMetadataConventionOverridden {
|
||||
get {
|
||||
return ResourceManager.GetString("Registration_PartMetadataConventionOverridden", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to An Export specification convention that would apply to type '{0}' has been overridden by attributes applied in the source file or by a prior convention..
|
||||
/// </summary>
|
||||
internal static string Registration_TypeExportConventionOverridden {
|
||||
get {
|
||||
return ResourceManager.GetString("Registration_TypeExportConventionOverridden", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -5,7 +5,7 @@
|
||||
<ProjectGuid>{E6592FAD-10B5-4B56-9287-D72DD136992F}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<AssemblyName>System.Composition.Convention</AssemblyName>
|
||||
<DefineConstants Condition="'$(TargetGroup)' == 'netstandard1.0'">$(DefineConstants);netstandard10</DefineConstants>
|
||||
<DefineConstants Condition="'$(TargetGroup)' == 'netstandard1.0'">$(DefineConstants);netstandard10</DefineConstants>
|
||||
<PackageTargetFramework Condition="'$(TargetGroup)' == 'netstandard1.0'">netstandard1.0;portable-net45+win8+wp8+wpa81</PackageTargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
@@ -39,7 +39,6 @@
|
||||
<Compile Include="Microsoft\Composition\Diagnostics\TraceWriter.cs" />
|
||||
<Compile Include="Microsoft\Internal\AttributeServices.cs" />
|
||||
<Compile Include="Microsoft\Internal\ReflectionServices.cs" />
|
||||
<Compile Include="Strings.Designer.cs" />
|
||||
<Compile Include="System\Composition\Convention\ConventionBuilder.cs" />
|
||||
<Compile Include="System\Composition\Convention\ExportConventionBuilder.cs" />
|
||||
<Compile Include="System\Composition\Convention\ImportConventionBuilder.cs" />
|
||||
@@ -55,7 +54,6 @@
|
||||
<LastGenOutput>CommonStrings.Designer.cs</LastGenOutput>
|
||||
<CustomToolNamespace>Microsoft.Internal</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Strings.resx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\System.Composition.AttributedModel\src\System.Composition.AttributedModel.csproj">
|
||||
|
||||
+4
-14
@@ -2,10 +2,6 @@
|
||||
// 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;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
|
||||
using Microsoft.Internal;
|
||||
|
||||
namespace System.Composition
|
||||
@@ -14,30 +10,24 @@ namespace System.Composition
|
||||
{
|
||||
public static ArgumentException Argument_ExpressionMustBeNew(string parameterName)
|
||||
{
|
||||
return CreateArgumentException(Strings.Argument_ExpressionMustBeNew, parameterName);
|
||||
return CreateArgumentException(SR.Argument_ExpressionMustBeNew, parameterName);
|
||||
}
|
||||
|
||||
public static ArgumentException Argument_ExpressionMustBePropertyMember(string parameterName)
|
||||
{
|
||||
return CreateArgumentException(Strings.Argument_ExpressionMustBePropertyMember, parameterName);
|
||||
return CreateArgumentException(SR.Argument_ExpressionMustBePropertyMember, parameterName);
|
||||
}
|
||||
|
||||
|
||||
public static ArgumentException Argument_ExpressionMustBeVoidMethodWithNoArguments(string methodName)
|
||||
{
|
||||
return CreateArgumentException(Strings.Argument_ExpressionMustBeVoidMethodWithNoArguments, methodName);
|
||||
return CreateArgumentException(SR.Argument_ExpressionMustBeVoidMethodWithNoArguments, methodName);
|
||||
}
|
||||
|
||||
private static ArgumentException CreateArgumentException(string message, string parameterName)
|
||||
{
|
||||
Assumes.NotNull(parameterName);
|
||||
|
||||
return new ArgumentException(Format(message, parameterName), parameterName);
|
||||
}
|
||||
|
||||
private static string Format(string format, params string[] arguments)
|
||||
{
|
||||
return String.Format(CultureInfo.CurrentCulture, format, arguments);
|
||||
return new ArgumentException(SR.Format(message, parameterName), parameterName);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user