Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SR.cs
Go to the documentation of this file.
3
4namespace System;
5
6internal static class SR
7{
8 private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;
9
11
13
14 internal static string ArgumentIsNullOrWhitespace => GetResourceString("ArgumentIsNullOrWhitespace", "The argument '{0}' cannot be null, empty or contain only whitespace.");
15
16 internal static string AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties => GetResourceString("AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties", "The associated metadata type for type '{0}' contains the following unknown properties or fields: {1}. Please make sure that the names of these members match the names of the properties on the main type.");
17
18 internal static string AttributeStore_Unknown_Property => GetResourceString("AttributeStore_Unknown_Property", "The type '{0}' does not contain a public property named '{1}'.");
19
20 internal static string Common_PropertyNotFound => GetResourceString("Common_PropertyNotFound", "The property {0}.{1} could not be found.");
21
22 internal static string CompareAttribute_MustMatch => GetResourceString("CompareAttribute_MustMatch", "'{0}' and '{1}' do not match.");
23
24 internal static string CompareAttribute_UnknownProperty => GetResourceString("CompareAttribute_UnknownProperty", "Could not find a property named {0}.");
25
26 internal static string CreditCardAttribute_Invalid => GetResourceString("CreditCardAttribute_Invalid", "The {0} field is not a valid credit card number.");
27
28 internal static string CustomValidationAttribute_Method_Must_Return_ValidationResult => GetResourceString("CustomValidationAttribute_Method_Must_Return_ValidationResult", "The CustomValidationAttribute method '{0}' in type '{1}' must return System.ComponentModel.DataAnnotations.ValidationResult. Use System.ComponentModel.DataAnnotations.ValidationResult.Success to represent success.");
29
30 internal static string CustomValidationAttribute_Method_Not_Found => GetResourceString("CustomValidationAttribute_Method_Not_Found", "The CustomValidationAttribute method '{0}' does not exist in type '{1}' or is not public and static.");
31
32 internal static string CustomValidationAttribute_Method_Required => GetResourceString("CustomValidationAttribute_Method_Required", "The CustomValidationAttribute.Method was not specified.");
33
34 internal static string CustomValidationAttribute_Method_Signature => GetResourceString("CustomValidationAttribute_Method_Signature", "The CustomValidationAttribute method '{0}' in type '{1}' must match the expected signature: public static ValidationResult {0}(object value, ValidationContext context). The value can be strongly typed. The ValidationContext parameter is optional.");
35
36 internal static string CustomValidationAttribute_Type_Conversion_Failed => GetResourceString("CustomValidationAttribute_Type_Conversion_Failed", "Could not convert the value of type '{0}' to '{1}' as expected by method {2}.{3}.");
37
38 internal static string CustomValidationAttribute_Type_Must_Be_Public => GetResourceString("CustomValidationAttribute_Type_Must_Be_Public", "The custom validation type '{0}' must be public.");
39
40 internal static string CustomValidationAttribute_ValidationError => GetResourceString("CustomValidationAttribute_ValidationError", "{0} is not valid.");
41
42 internal static string CustomValidationAttribute_ValidatorType_Required => GetResourceString("CustomValidationAttribute_ValidatorType_Required", "The CustomValidationAttribute.ValidatorType was not specified.");
43
44 internal static string DataTypeAttribute_EmptyDataTypeString => GetResourceString("DataTypeAttribute_EmptyDataTypeString", "The custom DataType string cannot be null or empty.");
45
46 internal static string DisplayAttribute_PropertyNotSet => GetResourceString("DisplayAttribute_PropertyNotSet", "The {0} property has not been set. Use the {1} method to get the value.");
47
48 internal static string EmailAddressAttribute_Invalid => GetResourceString("EmailAddressAttribute_Invalid", "The {0} field is not a valid e-mail address.");
49
50 internal static string EnumDataTypeAttribute_TypeCannotBeNull => GetResourceString("EnumDataTypeAttribute_TypeCannotBeNull", "The type provided for EnumDataTypeAttribute cannot be null.");
51
52 internal static string EnumDataTypeAttribute_TypeNeedsToBeAnEnum => GetResourceString("EnumDataTypeAttribute_TypeNeedsToBeAnEnum", "The type '{0}' needs to represent an enumeration type.");
53
54 internal static string FileExtensionsAttribute_Invalid => GetResourceString("FileExtensionsAttribute_Invalid", "The {0} field only accepts files with the following extensions: {1}");
55
56 internal static string LocalizableString_LocalizationFailed => GetResourceString("LocalizableString_LocalizationFailed", "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'.");
57
58 internal static string MaxLengthAttribute_InvalidMaxLength => GetResourceString("MaxLengthAttribute_InvalidMaxLength", "MaxLengthAttribute must have a Length value that is greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length.");
59
60 internal static string MaxLengthAttribute_ValidationError => GetResourceString("MaxLengthAttribute_ValidationError", "The field {0} must be a string or array type with a maximum length of '{1}'.");
61
62 internal static string MetadataTypeAttribute_TypeCannotBeNull => GetResourceString("MetadataTypeAttribute_TypeCannotBeNull", "MetadataClassType cannot be null.");
63
64 internal static string MinLengthAttribute_InvalidMinLength => GetResourceString("MinLengthAttribute_InvalidMinLength", "MinLengthAttribute must have a Length value that is zero or greater.");
65
66 internal static string MinLengthAttribute_ValidationError => GetResourceString("MinLengthAttribute_ValidationError", "The field {0} must be a string or array type with a minimum length of '{1}'.");
67
68 internal static string LengthAttribute_InvalidValueType => GetResourceString("LengthAttribute_InvalidValueType", "The field of type {0} must be a string, array or ICollection type.");
69
70 internal static string PhoneAttribute_Invalid => GetResourceString("PhoneAttribute_Invalid", "The {0} field is not a valid phone number.");
71
72 internal static string RangeAttribute_ArbitraryTypeNotIComparable => GetResourceString("RangeAttribute_ArbitraryTypeNotIComparable", "The type {0} must implement {1}.");
73
74 internal static string RangeAttribute_MinGreaterThanMax => GetResourceString("RangeAttribute_MinGreaterThanMax", "The maximum value '{0}' must be greater than or equal to the minimum value '{1}'.");
75
76 internal static string RangeAttribute_Must_Set_Min_And_Max => GetResourceString("RangeAttribute_Must_Set_Min_And_Max", "The minimum and maximum values must be set.");
77
78 internal static string RangeAttribute_Must_Set_Operand_Type => GetResourceString("RangeAttribute_Must_Set_Operand_Type", "The OperandType must be set when strings are used for minimum and maximum values.");
79
80 internal static string RangeAttribute_ValidationError => GetResourceString("RangeAttribute_ValidationError", "The field {0} must be between {1} and {2}.");
81
82 internal static string RegexAttribute_ValidationError => GetResourceString("RegexAttribute_ValidationError", "The field {0} must match the regular expression '{1}'.");
83
84 internal static string RegularExpressionAttribute_Empty_Pattern => GetResourceString("RegularExpressionAttribute_Empty_Pattern", "The pattern must be set to a valid regular expression.");
85
86 internal static string RequiredAttribute_ValidationError => GetResourceString("RequiredAttribute_ValidationError", "The {0} field is required.");
87
88 internal static string StringLengthAttribute_InvalidMaxLength => GetResourceString("StringLengthAttribute_InvalidMaxLength", "The maximum length must be a nonnegative integer.");
89
90 internal static string StringLengthAttribute_ValidationError => GetResourceString("StringLengthAttribute_ValidationError", "The field {0} must be a string with a maximum length of {1}.");
91
92 internal static string StringLengthAttribute_ValidationErrorIncludingMinimum => GetResourceString("StringLengthAttribute_ValidationErrorIncludingMinimum", "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.");
93
94 internal static string UIHintImplementation_ControlParameterKeyIsNotAString => GetResourceString("UIHintImplementation_ControlParameterKeyIsNotAString", "The key parameter at position {0} with value '{1}' is not a string. Every key control parameter must be a string.");
95
96 internal static string UIHintImplementation_ControlParameterKeyIsNull => GetResourceString("UIHintImplementation_ControlParameterKeyIsNull", "The key parameter at position {0} is null. Every key control parameter must be a string.");
97
98 internal static string UIHintImplementation_ControlParameterKeyOccursMoreThanOnce => GetResourceString("UIHintImplementation_ControlParameterKeyOccursMoreThanOnce", "The key parameter at position {0} with value '{1}' occurs more than once.");
99
100 internal static string UIHintImplementation_NeedEvenNumberOfControlParameters => GetResourceString("UIHintImplementation_NeedEvenNumberOfControlParameters", "The number of control parameters must be even.");
101
102 internal static string UrlAttribute_Invalid => GetResourceString("UrlAttribute_Invalid", "The {0} field is not a valid fully-qualified http, https, or ftp URL.");
103
104 internal static string ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource => GetResourceString("ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource", "Either ErrorMessageString or ErrorMessageResourceName must be set, but not both.");
105
106 internal static string ValidationAttribute_IsValid_NotImplemented => GetResourceString("ValidationAttribute_IsValid_NotImplemented", "IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context).");
107
108 internal static string ValidationAttribute_NeedBothResourceTypeAndResourceName => GetResourceString("ValidationAttribute_NeedBothResourceTypeAndResourceName", "Both ErrorMessageResourceType and ErrorMessageResourceName need to be set on this attribute.");
109
110 internal static string ValidationAttribute_ResourcePropertyNotStringType => GetResourceString("ValidationAttribute_ResourcePropertyNotStringType", "The property '{0}' on resource type '{1}' is not a string type.");
111
112 internal static string ValidationAttribute_ResourceTypeDoesNotHaveProperty => GetResourceString("ValidationAttribute_ResourceTypeDoesNotHaveProperty", "The resource type '{0}' does not have an accessible static property named '{1}'.");
113
114 internal static string ValidationAttribute_ValidationError => GetResourceString("ValidationAttribute_ValidationError", "The field {0} is invalid.");
115
116 internal static string Validator_InstanceMustMatchValidationContextInstance => GetResourceString("Validator_InstanceMustMatchValidationContextInstance", "The instance provided must match the ObjectInstance on the ValidationContext supplied.");
117
118 internal static string Validator_Property_Value_Wrong_Type => GetResourceString("Validator_Property_Value_Wrong_Type", "The value for property '{0}' must be of type '{1}'.");
119
120 private static bool UsingResourceKeys()
121 {
122 return s_usingResourceKeys;
123 }
124
125 internal static string GetResourceString(string resourceKey)
126 {
127 if (UsingResourceKeys())
128 {
129 return resourceKey;
130 }
131 string result = null;
132 try
133 {
134 result = ResourceManager.GetString(resourceKey);
135 }
137 {
138 }
139 return result;
140 }
141
142 internal static string GetResourceString(string resourceKey, string defaultString)
143 {
144 string resourceString = GetResourceString(resourceKey);
145 if (!(resourceKey == resourceString) && resourceString != null)
146 {
147 return resourceString;
148 }
149 return defaultString;
150 }
151
152 internal static string Format(string resourceFormat, object p1)
153 {
154 if (UsingResourceKeys())
155 {
156 return string.Join(", ", resourceFormat, p1);
157 }
158 return string.Format(resourceFormat, p1);
159 }
160
161 internal static string Format(string resourceFormat, object p1, object p2)
162 {
163 if (UsingResourceKeys())
164 {
165 return string.Join(", ", resourceFormat, p1, p2);
166 }
167 return string.Format(resourceFormat, p1, p2);
168 }
169
170 internal static string Format(string resourceFormat, object p1, object p2, object p3)
171 {
172 if (UsingResourceKeys())
173 {
174 return string.Join(", ", resourceFormat, p1, p2, p3);
175 }
176 return string.Format(resourceFormat, p1, p2, p3);
177 }
178
179 internal static string Format(string resourceFormat, params object[] args)
180 {
181 if (args != null)
182 {
183 if (UsingResourceKeys())
184 {
185 return resourceFormat + ", " + string.Join(", ", args);
186 }
187 return string.Format(resourceFormat, args);
188 }
189 return resourceFormat;
190 }
191}
static bool TryGetSwitch(string switchName, out bool isEnabled)
Definition AppContext.cs:74
virtual ? string GetString(string name)
static string FileExtensionsAttribute_Invalid
Definition SR.cs:54
static string ValidationAttribute_ValidationError
Definition SR.cs:114
static string CustomValidationAttribute_Method_Required
Definition SR.cs:32
static string MaxLengthAttribute_InvalidMaxLength
Definition SR.cs:58
static string StringLengthAttribute_InvalidMaxLength
Definition SR.cs:88
static string GetResourceString(string resourceKey, string defaultString)
Definition SR.cs:142
static string StringLengthAttribute_ValidationErrorIncludingMinimum
Definition SR.cs:92
static string UIHintImplementation_NeedEvenNumberOfControlParameters
Definition SR.cs:100
static string RangeAttribute_MinGreaterThanMax
Definition SR.cs:74
static string Common_PropertyNotFound
Definition SR.cs:20
static string UIHintImplementation_ControlParameterKeyOccursMoreThanOnce
Definition SR.cs:98
static string Validator_InstanceMustMatchValidationContextInstance
Definition SR.cs:116
static string ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource
Definition SR.cs:104
static string UrlAttribute_Invalid
Definition SR.cs:102
static string DataTypeAttribute_EmptyDataTypeString
Definition SR.cs:44
static string MaxLengthAttribute_ValidationError
Definition SR.cs:60
static ResourceManager s_resourceManager
Definition SR.cs:10
static string RegularExpressionAttribute_Empty_Pattern
Definition SR.cs:84
static string AttributeStore_Unknown_Property
Definition SR.cs:18
static string MetadataTypeAttribute_TypeCannotBeNull
Definition SR.cs:62
static string CreditCardAttribute_Invalid
Definition SR.cs:26
static string Format(string resourceFormat, object p1)
Definition SR.cs:152
static string EnumDataTypeAttribute_TypeNeedsToBeAnEnum
Definition SR.cs:52
static string Format(string resourceFormat, object p1, object p2)
Definition SR.cs:161
static string ValidationAttribute_ResourceTypeDoesNotHaveProperty
Definition SR.cs:112
static string Validator_Property_Value_Wrong_Type
Definition SR.cs:118
static string CustomValidationAttribute_Method_Must_Return_ValidationResult
Definition SR.cs:28
static string MinLengthAttribute_ValidationError
Definition SR.cs:66
static string PhoneAttribute_Invalid
Definition SR.cs:70
static string CustomValidationAttribute_Type_Conversion_Failed
Definition SR.cs:36
static string CustomValidationAttribute_Method_Not_Found
Definition SR.cs:30
static string ArgumentIsNullOrWhitespace
Definition SR.cs:14
static string LengthAttribute_InvalidValueType
Definition SR.cs:68
static string CustomValidationAttribute_ValidatorType_Required
Definition SR.cs:42
static ResourceManager ResourceManager
Definition SR.cs:12
static string RequiredAttribute_ValidationError
Definition SR.cs:86
static string EnumDataTypeAttribute_TypeCannotBeNull
Definition SR.cs:50
static string UIHintImplementation_ControlParameterKeyIsNull
Definition SR.cs:96
static string RangeAttribute_Must_Set_Min_And_Max
Definition SR.cs:76
static string CompareAttribute_UnknownProperty
Definition SR.cs:24
static string CustomValidationAttribute_Method_Signature
Definition SR.cs:34
static string RangeAttribute_ArbitraryTypeNotIComparable
Definition SR.cs:72
static string MinLengthAttribute_InvalidMinLength
Definition SR.cs:64
static string LocalizableString_LocalizationFailed
Definition SR.cs:56
static string CustomValidationAttribute_Type_Must_Be_Public
Definition SR.cs:38
static string RangeAttribute_Must_Set_Operand_Type
Definition SR.cs:78
static string DisplayAttribute_PropertyNotSet
Definition SR.cs:46
static string EmailAddressAttribute_Invalid
Definition SR.cs:48
static string GetResourceString(string resourceKey)
Definition SR.cs:101
static bool UsingResourceKeys()
Definition SR.cs:120
static string AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties
Definition SR.cs:16
static string ValidationAttribute_NeedBothResourceTypeAndResourceName
Definition SR.cs:108
static string StringLengthAttribute_ValidationError
Definition SR.cs:90
static string RangeAttribute_ValidationError
Definition SR.cs:80
static string CustomValidationAttribute_ValidationError
Definition SR.cs:40
static string UIHintImplementation_ControlParameterKeyIsNotAString
Definition SR.cs:94
static string Format(string resourceFormat, object p1, object p2, object p3)
Definition SR.cs:170
static readonly bool s_usingResourceKeys
Definition SR.cs:8
static string ValidationAttribute_IsValid_NotImplemented
Definition SR.cs:106
static string ValidationAttribute_ResourcePropertyNotStringType
Definition SR.cs:110
static string RegexAttribute_ValidationError
Definition SR.cs:82
static string CompareAttribute_MustMatch
Definition SR.cs:22
static string Format(string resourceFormat, params object[] args)
Definition SR.cs:179