DynamicResourceManagerGetExpandoResourceSet Method

Retrieves the resource set for a particular culture, which can be dynamically modified.

Definition

Namespace: KGySoft.Resources
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public override IExpandoResourceSet? GetExpandoResourceSet(
	CultureInfo culture,
	ResourceSetRetrieval behavior = ResourceSetRetrieval.LoadIfExists,
	bool tryParents = false
)

Parameters

culture  CultureInfo
The culture whose resources are to be retrieved.
behavior  ResourceSetRetrieval  (Optional)
Determines the retrieval behavior of the result IExpandoResourceSet. This parameter is optional.
Default value: LoadIfExists.
tryParents  Boolean  (Optional)
to use resource fallback to load an appropriate resource if the resource set cannot be found; to bypass the resource fallback process. This parameter is optional.
Default value: .

Return Value

IExpandoResourceSet
The resource set for the specified culture, or if the specified culture cannot be retrieved by the defined behavior, or when Source is CompiledOnly so it cannot return an IExpandoResourceSet instance.

Implements

IExpandoResourceManagerGetExpandoResourceSet(CultureInfo, ResourceSetRetrieval, Boolean)

Remarks

If AppendOnLoad option is enabled in AutoAppend property, then dynamic expansion of the resource sets may occur when calling this method.

  Note

For more details see the Auto Appending section at the description of the DynamicResourceManager class.

Appending is applied only if behavior is not GetIfAlreadyLoaded and tryParents is .

If due to the current parameters no auto appending is performed during the call, then it will not happen also for successive calls for the same resource set until the ReleaseAllResources method is called.

Exceptions

ArgumentNullExceptionculture is .
ObjectDisposedExceptionThe DynamicResourceManager is already disposed.
ArgumentOutOfRangeExceptionbehavior does not fall in the expected range.
MissingManifestResourceExceptionResource file of the neutral culture was not found, while tryParents is and behavior is not CreateIfNotExists.

See Also