Table of Contents

Class TemporaryFileHelpers

Namespace
Dhgms.DocFx.MermaidJs.Plugin
Assembly
Dhgms.DocFx.MermaidJs.Plugin.dll

Helpers for working with temporary files.

public static class TemporaryFileHelpers
Inheritance
TemporaryFileHelpers
Inherited Members

Methods

WithTempFile(byte[], string, Action<string>, bool)

Carries out an action using a temporary file.

public static void WithTempFile(byte[] fileAsBytes, string fileExtension, Action<string> fileAction, bool skipDeleteException)

Parameters

fileAsBytes byte[]

The file as a byte array.

fileExtension string

The file extension.

fileAction Action<string>

The action to carry out referencing the file.

skipDeleteException bool

Whether to skip the exception from attempting to delete the temporary file.

WithTempFile<TResult>(byte[], string, Func<string, TResult>, bool)

Carries out an action using a temporary file.

public static TResult? WithTempFile<TResult>(byte[] fileAsBytes, string fileExtension, Func<string, TResult> fileAction, bool skipDeleteException)

Parameters

fileAsBytes byte[]

The file as a byte array.

fileExtension string

The file extension.

fileAction Func<string, TResult>

The action to carry out referencing the file.

skipDeleteException bool

Whether to skip the exception from attempting to delete the temporary file.

Returns

TResult

Result from the file action.

Type Parameters

TResult

The type for the result of the action.