ResXDataNodeGetValue Method

Retrieves the object that is stored by this node.

Definition

Namespace: KGySoft.Resources
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public Object? GetValue(
	ITypeResolutionService? typeResolver = null,
	string? basePath = null,
	bool cleanupRawData = false
)

Parameters

typeResolver  ITypeResolutionService  (Optional)
A custom type resolution service to use for resolving type names. This parameter is optional.
Default value: .
basePath  String  (Optional)
Defines a base path for file reference values. Used when FileRef is not . If this parameter is , tries to use the original base path, if any. This parameter is optional.
Default value: .
cleanupRawData  Boolean  (Optional)
to free the underlying XML data once the value is deserialized; otherwise, . This parameter is optional.
Default value: .

Return Value

Object
The object that corresponds to the stored value.

Remarks

  Security Note

When using this method make sure that the .resx data to be deserialized is from a trusted source. This method might load assemblies during type resolve and allows resolving file references. To disallow loading assemblies or resolving file references use the GetValueSafe methods instead.

If the stored value currently exists in memory, it is returned directly.

If the resource is a file reference, GetValue tries to open the file and deserialize its content.

If the resource is not a file reference, GetValue tries to deserialize the value from the raw .resx string content.

Exceptions

TypeLoadExceptionThe corresponding type or its container assembly could not be loaded.
SerializationExceptionAn error occurred during the binary deserialization of the resource.
FileNotFoundExceptionThe resource is a file reference and the referenced file cannot be found.
NotSupportedExceptionUnsupported MIME type or an appropriate type converter is not available.

See Also