Table of Contents

Class CachedResourceManager

Namespace
Ranorex.Core
Assembly
Ranorex.Core.dll

A wrapper around a default ResourceManager instance that caches retrieved objects.

public class CachedResourceManager : ResourceManager
Inheritance
CachedResourceManager
Inherited Members

Constructors

CachedResourceManager(ResourceManager)

Initializes a new instance of the CachedResourceManager class that caches retrieved objects.

public CachedResourceManager(ResourceManager wrapped)

Parameters

wrapped ResourceManager

The wrapped resource manager to get the actual objects from.

Properties

BaseName

Gets the root name of the resource files that the ResourceManager searches for resources.

public override string BaseName { get; }

Property Value

string

The root name of the resource files that the ResourceManager searches for resources.

IgnoreCase

Gets or sets a value indicating whether the current instance allows case-insensitive resource lookups in the GetString(string) and GetObject(string) methods.

public override bool IgnoreCase { get; set; }

Property Value

bool

A value indicating whether the case of the resource names should be ignored.

ResourceSetType

Gets the Type of the ResourceSet the ResourceManager uses to construct a ResourceSet object.

public override Type ResourceSetType { get; }

Property Value

Type

The Type of the ResourceSet the ResourceManager uses to construct a ResourceSet object.

Methods

EnsureActive(Type)

Ensures that the specified original resource manager used by targetType is replaced by a CachedResourceManager instance wrapping the original instance.

public static void EnsureActive(Type targetType)

Parameters

targetType Type

A auto-generated resource type that should use a CachedResourceManager instance wrapping the original resource manager.

Equals(object)

Determines whether the specified object is equal to this instance.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with this instance.

Returns

bool

true if the specified object is equal to this instance; otherwise, false.

Exceptions

NullReferenceException

The obj parameter is null.

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

GetObject(string)

Returns the value of the specified object resource.

public override object GetObject(string name)

Parameters

name string

The name of the resource to get.

Returns

object

The value of the resource localized for the caller's current culture settings. If a match is not possible, null is returned. The resource value can be null.

Exceptions

ArgumentNullException

The name parameter is null.

MissingManifestResourceException

No usable set of resources has been found, and there are no neutral culture resources.

GetObject(string, CultureInfo)

Gets the value of the object resource localized for the specified culture.

public override object GetObject(string name, CultureInfo culture)

Parameters

name string

The name of the resource to get.

culture CultureInfo

The CultureInfo object that represents the culture for which the resource is localized. Note that if the resource is not localized for this culture, the lookup will fall back using the culture's Parent property, stopping after checking in the neutral culture. If this value is null, the CultureInfo is obtained using the culture's CurrentUICulture property.

Returns

object

The value of the resource, localized for the specified culture. If a "best match" is not possible, null is returned.

Exceptions

ArgumentNullException

The name parameter is null.

MissingManifestResourceException

No usable set of resources have been found, and there are no neutral culture resources.

GetResourceSet(CultureInfo, bool, bool)

Gets the ResourceSet for a particular culture.

public override ResourceSet GetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents)

Parameters

culture CultureInfo

The CultureInfo to look for.

createIfNotExists bool

If true and if the ResourceSet has not been loaded yet, load it.

tryParents bool

If the ResourceSet cannot be loaded, try parent CultureInfo objects to see if they exist.

Returns

ResourceSet

The specified ResourceSet.

Exceptions

ArgumentNullException

The culture parameter is null.

GetString(string)

Returns the value of the specified string resource.

public override string GetString(string name)

Parameters

name string

The name of the resource to get.

Returns

string

The value of the resource localized for the caller's current culture settings. If a match is not possible, null is returned.

Exceptions

ArgumentNullException

The name parameter is null.

InvalidOperationException

The value of the specified resource is not a string.

MissingManifestResourceException

No usable set of resources has been found, and there are no neutral culture resources.

GetString(string, CultureInfo)

Gets the value of the string resource localized for the specified culture.

public override string GetString(string name, CultureInfo culture)

Parameters

name string

The name of the resource to get.

culture CultureInfo

The CultureInfo object that represents the culture for which the resource is localized. Note that if the resource is not localized for this culture, the lookup will fall back using the culture's Parent property, stopping after looking in the neutral culture. If this value is null, the CultureInfo is obtained using the culture's CurrentUICulture property.

Returns

string

The value of the resource localized for the specified culture. If a best match is not possible, null is returned.

Exceptions

ArgumentNullException

The name parameter is null.

InvalidOperationException

The value of the specified resource is not a string.

MissingManifestResourceException

No usable set of resources has been found, and there are no neutral culture resources.

ReleaseAllResources()

Tells the ResourceManager to call Close() on all ResourceSet objects and release all resources.

public override void ReleaseAllResources()

ToString()

Returns a string that represents this instance.

public override string ToString()

Returns

string

A string that represents this instance.