KGy SOFT

HybridResourceManagerSetObject Method

KGy SOFT Core Libraries Help
Adds or replaces a resource object in the current HybridResourceManager with the specified name for the specified culture.

Namespace:  KGySoft.Resources
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.4.0
Syntax

public virtual void SetObject(
	string name,
	Object value,
	CultureInfo culture = null
)

Parameters

name
Type: SystemString
The name of the resource to set.
value
Type: SystemObject
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 (Optional)
Type: System.GlobalizationCultureInfo
The culture of the resource to set. If this value is , the CultureInfo object is obtained by using the CultureInfo.CurrentUICulture property.

Implements

IExpandoResourceManagerSetObject(String, Object, CultureInfo)
Exceptions

ExceptionCondition
ArgumentNullExceptionname is .
ObjectDisposedExceptionThe HybridResourceManager is already disposed.
InvalidOperationExceptionSource is CompiledOnly.
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 and GetResourceSet methods will return the resources with  value.

If 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.

See Also

Reference