IExpandoResourceManagerSetObject Method

Adds or replaces a resource object in the current IExpandoResourceManager with the specified name for the specified culture.

Definition

Namespace: KGySoft.Resources
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
void SetObject(
	string name,
	Object? value,
	CultureInfo? culture = null
)

Parameters

name  String
The name of the resource to set.
value  Object
The value of the resource to set. If , then a null reference will be explicitly stored for the specified culture. This parameter is optional.
Default value: .
culture  CultureInfo  (Optional)
The culture of the resource to set. If this value is , the CultureInfo object is obtained by using the CultureInfo.CurrentUICulture property.

Remarks

If value is , a null reference will be explicitly stored. As a result, the subsequent GetObject calls with the same culture will fall back to the parent culture, or will return if name is not found in any parent cultures. However, enumerating the result set returned by GetExpandoResourceSet method will return the resources with value.

If the current IExpandoResourceManager is a HybridResourceManager, and you want to remove the user-defined ResX content and reset the original resource defined in the binary resource set (if any), use the RemoveObject method.

Exceptions

See Also