SRBase Class
An abstract base class for accessing the string resources of an assembly, along with customization capabilities.
public abstract class SRBase
- Inheritance:
- object object
Constructors
SRBase()
Initializes an instance of the class.
protected SRBase()
Properties
ResourceManager
Gets the ResourceManager that provides the default resources.
public abstract ResourceManager ResourceManager { get; }
Property Value
- ResourceManager:
The ResourceManager that provides the default resources.
Methods
ClearCustomStringsCore()
Removes all custom strings.
protected void ClearCustomStringsCore()
ContainsCustomStringCore(string)
Returns whether a custom string is defined for the specified string resource.
protected bool ContainsCustomStringCore(string name)
Parameter | Type | Description |
---|---|---|
name | string | The name of the resource for which to search. |
Returns
- bool:
true
if a custom string is defined for the specified string resource; otherwise,false
.
GetCustomStringCore(string)
Returns custom string that is stored for the specified string resource, if any.
protected string? GetCustomStringCore(string name)
Parameter | Type | Description |
---|---|---|
name | string | The name of the resource to get. |
Returns
- string:
The custom string that is stored for the specified string resource, if any.
GetStringCore(string, params object?[])
Returns the resolved value of the specified string resource, by calling Format(IFormatProvider, string, params object[]) using supplied arguments.
protected string? GetStringCore(string name, params object?[] args)
Parameter | Type | Description |
---|---|---|
name | string | The name of the resource to get. |
args | object[] | The arguments to pass to Format(IFormatProvider, string, params object[]). |
Returns
- string:
The value of the resource localized for the caller's current culture settings. If a best match is not possible,
null
is returned.
RemoveCustomStringCore(string)
Removes any custom string that is defined for the specified string resource.
protected void RemoveCustomStringCore(string name)
Parameter | Type | Description |
---|---|---|
name | string | The name of the resource to remove. |
SetCustomStringCore(string, string)
Sets a custom string value for the specified string resource.
protected void SetCustomStringCore(string name, string value)
Parameter | Type | Description |
---|---|---|
name | string | The name of the resource to set. |
value | string | The value of the resource to set. |
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()