Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Resources.​ResourceManager
Assembly: System.Runtime
Inheritance: object → ResourceManager
Represents a resource manager that provides convenient access to culture-specific resources at run time.
Fields and Constants
public static readonly
int
HeaderVersionNumber
Specifies the version of resource file headers that the current implementation of <see cref="T:System.Resources.ResourceManager" /> can interpret and produce.
public static readonly
int
MagicNumber
Holds the number used to identify resource files.
protected
Reflection.​Assembly
MainAssembly
Specifies the main assembly that contains the resources.
Properties
public
string
BaseName
Gets the root name of the resource files that the <see cref="T:System.Resources.ResourceManager" /> searches for resources.
protected
UltimateResourceFallbackLocation
FallbackLocation
Gets or sets the location from which to retrieve default fallback resources.
public
bool
IgnoreCase
Gets or sets a value that indicates whether the resource manager allows case-insensitive resource lookups in the <see cref="M:System.Resources.ResourceManager.GetString(System.String)" /> and <see cref="M:System.Resources.ResourceManager.GetObject(System.String)" /> methods.
public
Type
ResourceSetType
Gets the type of the resource set object that the resource manager uses to construct a <see cref="T:System.Resources.ResourceSet" /> object.
Methods
public
object
GetObject​(string name)
name
The name of the resource to get.
Returns The value of the resource localized for the caller's current culture settings. If an appropriate resource set exists but <paramref name="name" /> cannot be found, the method returns <see langword="null" /> .
Returns the value of the specified non-string resource.
public
object
GetObject​(string name,
Globalization.CultureInfo culture)
name
The name of the resource to get.
culture
The culture for which the resource is localized. If the resource is not localized for this culture, the resource manager uses fallback rules to locate an appropriate resource.
If this value is <see langword="null" /> , the <see cref="T:System.Globalization.CultureInfo" /> object is obtained by using the <see cref="P:System.Globalization.CultureInfo.CurrentUICulture" /> property.
Returns The value of the resource, localized for the specified culture. If an appropriate resource set exists but <paramref name="name" /> cannot be found, the method returns <see langword="null" /> .
Gets the value of the specified non-string resource localized for the specified culture.
protected
string
GetResourceFileName​(Globalization.CultureInfo culture)
culture
The culture object for which a resource file name is constructed.
Returns The name that can be used for a resource file for the given <see cref="T:System.Globalization.CultureInfo" /> object.
Generates the name of the resource file for the given <see cref="T:System.Globalization.CultureInfo" /> object.
public
ResourceSet
GetResourceSet​(Globalization.CultureInfo culture,
bool createIfNotExists,
bool tryParents)
culture
The culture whose resources are to be retrieved.
createIfNotExists
<see langword="true" /> to load the resource set, if it has not been loaded yet; otherwise, <see langword="false" /> .
tryParents
<see langword="true" /> to use resource fallback to load an appropriate resource if the resource set cannot be found; <see langword="false" /> to bypass the resource fallback process.
Returns The resource set for the specified culture.
Retrieves the resource set for a particular culture.
GetStream​(string name)
name
The name of a resource.
Returns An unmanaged memory stream object that represents a resource.
Returns an unmanaged memory stream object from the specified resource.
GetStream​(string name,
Globalization.CultureInfo culture)
name
The name of a resource.
culture
The culture to use for the resource lookup. If <paramref name="culture" /> is <see langword="null" /> , the culture for the current thread is used.
Returns An unmanaged memory stream object that represents a resource.
Returns an unmanaged memory stream object from the specified resource, using the specified culture.
public
string
GetString​(string name)
name
The name of the resource to retrieve.
Returns The value of the resource localized for the caller's current UI culture, or <see langword="null" /> if <paramref name="name" /> cannot be found in a resource set.
Returns the value of the specified string resource.
public
string
GetString​(string name,
Globalization.CultureInfo culture)
name
The name of the resource to retrieve.
culture
An object that represents the culture for which the resource is localized.
Returns The value of the resource localized for the specified culture, or <see langword="null" /> if <paramref name="name" /> cannot be found in a resource set.
Returns the value of the string resource localized for the specified culture.
protected
ResourceSet
InternalGetResourceSet​(Globalization.CultureInfo culture,
bool createIfNotExists,
bool tryParents)
culture
The culture object to look for.
createIfNotExists
<see langword="true" /> to load the resource set, if it has not been loaded yet; otherwise, <see langword="false" /> .
tryParents
<see langword="true" /> to check parent <see cref="T:System.Globalization.CultureInfo" /> objects if the resource set cannot be loaded; otherwise, <see langword="false" /> .
Returns The specified resource set.
Provides the implementation for finding a resource set.
public
void
ReleaseAllResources​()
Tells the resource manager to call the <see cref="M:System.Resources.ResourceSet.Close" /> method on all <see cref="T:System.Resources.ResourceSet" /> objects and release all resources.
public
bool
Equals​(object obj)
Inherited from object
obj
The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to the current object.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
int
GetHashCode​()
Inherited from object
Returns A hash code for the current object.
Serves as the default hash function.
public
Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .
public
string
ToString​()
Inherited from object
Returns A string that represents the current object.
Returns a string that represents the current object.