IExpandoResourceManagerSafeMode Property

Gets or sets whether the IExpandoResourceManager works in safe mode. In safe mode the retrieved objects returned from .resx sources are not deserialized automatically.
Default value: .

Definition

Namespace: KGySoft.Resources
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
bool SafeMode { get; set; }

Property Value

Boolean

Remarks

When SafeMode is , then GetObject and GetMetaObject methods return ResXDataNode instances instead of deserialized objects, if they are returned from .resx resource. You can retrieve the deserialized objects by calling the ResXDataNode.GetValue or ResXDataNode.GetValueSafe methods.

When SafeMode is , then GetString and GetMetaString methods will return a String also for non-string objects. For non-string values the raw XML string value will be returned for resources from a .resx source and the result of the ToString method for resources from a compiled source.

When SafeMode is , then GetStream and GetMetaStream methods will return a MemoryStream for any object. For values, which are neither MemoryStream, nor byte[] instances these methods return a stream wrapper for the same string value that is returned by the GetString/GetMetaString methods.

See Also