RunicPromisedFile class

Namespace Runic.Application.Views in Runic.Application.Views 0.23.0

public abstract class RunicPromisedFile : IAsyncDisposable

Inherits or implements IAsyncDisposable.

A dropped file that had no local path, such as a mail attachment, for RunicFileDrop.PromisedFiles.

Remarks

The host stages the file privately; read it once and dispose it, which deletes the staged copy.

Constructors

RunicPromisedFile

protected RunicPromisedFile()

No documentation.

Properties

Name

public abstract string Name { get; }

Gets the file name, without a directory, as the drag source named it and sanitized for display.

Methods

DisposeAsync

public abstract ValueTask DisposeAsync()

Closes the content and deletes the staged copy.

Returns

A task that completes when the copy is deleted.

OpenReadAsync

public abstract ValueTask<Stream> OpenReadAsync(CancellationToken cancellationToken = default)

Opens the file's content; a promised file can be opened once.

Parameters

cancellationToken

Cancels opening.

Returns

The content, owned by this file: disposing the file closes it.

Exceptions

InvalidOperationException

The file was already opened.

ObjectDisposedException

The file was disposed.