Skip to content

IOFileConversion.TryConvert Method ​

Definition ​

Attempts to convert a file to the specified target format, returning false if the conversion fails.

c#
public static bool TryConvert(IOFile source, IOFileFormat targetFormat, out IOFile? result, out string? error);

View source

Parameters ​

NameTypeDescription
sourceIOFileThe source file to convert.
targetFormatIOFileFormatThe target format to convert to.
resultIOFileThe converted file, or null if conversion failed.
errorStringThe error message if conversion failed, or null if successful.

Returns ​

Boolean

true if the conversion succeeded; false otherwise.