ResXDataNodeGetValueSafe(Boolean) Method

Retrieves the object that is stored by this node, not allowing loading assemblies during the possible deserialization. If the resource is not a natively supported type, then you should use the other overloads.

Definition

Namespace: KGySoft.Resources
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public Object? GetValueSafe(
	bool cleanupRawData = false
)

Parameters

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 it is guaranteed that no new assembly is loaded during the deserialization. To allow loading assemblies or to use a custom ITypeResolutionService use the GetValue method instead.

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

If the resource is a file reference and is has not been deserialized yet, then this method throws a NotSupportedException. You can only use the GetValue method to deserialize a file reference.

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.
-or-
The value has not been deserialized yet and FileRef is not .

See Also