Table of Contents

Class DocumentBase

Namespace
The.Documents
Assembly
Instagile.dll
public abstract class DocumentBase : IComparable<DocumentBase>
Inheritance
DocumentBase
Implements
Derived
Inherited Members

Constructors

DocumentBase(DocumentService, Guid, DocumentAccessAssertion)

protected DocumentBase(DocumentService service, Guid id, DocumentAccessAssertion access)

Parameters

service DocumentService
id Guid
access DocumentAccessAssertion

Fields

Service

public readonly DocumentService Service

Field Value

DocumentService

Properties

Access

public DocumentAccessAssertion Access { get; }

Property Value

DocumentAccessAssertion

ID

public Guid ID { get; }

Property Value

Guid

Methods

CompareTo(DocumentBase?)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(DocumentBase? other)

Parameters

other DocumentBase

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

DownloadAsync(CancellationToken)

public Task<Stream> DownloadAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task<Stream>

DownloadAsync(IPrincipal?, CancellationToken?)

Downloads the data

public Task<Stream> DownloadAsync(IPrincipal? principal = null, CancellationToken? cancellationToken = null)

Parameters

principal IPrincipal
cancellationToken CancellationToken?

Returns

Task<Stream>

Remarks

Streams the data to the caller, unbuffered.

DownloadBufferAsync(CancellationToken)

public Task<byte[]> DownloadBufferAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task<byte[]>

DownloadBufferAsync(IPrincipal?, CancellationToken?)

Downloads the data

public Task<byte[]> DownloadBufferAsync(IPrincipal? principal = null, CancellationToken? cancellationToken = null)

Parameters

principal IPrincipal
cancellationToken CancellationToken?

Returns

Task<byte[]>

Remarks

Returns a buffer which is the caller's responsibility; each call to this method will redownload the data

DownloadFileAsync(string, CancellationToken)

Downloads and saves the data to a file

public Task DownloadFileAsync(string localFilename, CancellationToken cancellationToken)

Parameters

localFilename string
cancellationToken CancellationToken

Returns

Task

Remarks

This operation may take a long time!

DownloadFileAsync(string, IPrincipal?, CancellationToken?)

Downloads and saves the data to a file.

public Task DownloadFileAsync(string localFilename, IPrincipal? principal = null, CancellationToken? cancellationToken = null)

Parameters

localFilename string
principal IPrincipal
cancellationToken CancellationToken?

Returns

Task

Remarks

Streams the data to the file, unbuffered.