Show / Hide Table of Contents

Class AttachmentContainer

A container for attachment files, which may or may not have been downloaded into local memory or storage.

Inheritance
object
AttachmentContainer
Implements
IAttachmentContainer
IEnumerable<AttachmentInfo>
IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: CrashCABN.Metadata
Assembly: CrashCABN.Metadata.Attachments.dll
Syntax
public sealed class AttachmentContainer : IAttachmentContainer, IEnumerable<AttachmentInfo>, IEnumerable
Remarks

Initializes a new instance of the AttachmentContainer class.

Constructors

View Source

AttachmentContainer(params AttachmentInfo[])

Initializes a new instance of the AttachmentContainer class.

Declaration
public AttachmentContainer(params AttachmentInfo[] attachments)
Parameters
Type Name Description
AttachmentInfo[] attachments

The attachments.

View Source

AttachmentContainer(IAttachmentProcessor, params AttachmentInfo[])

A container for attachment files, which may or may not have been downloaded into local memory or storage.

Declaration
public AttachmentContainer(IAttachmentProcessor processor, params AttachmentInfo[] attachments)
Parameters
Type Name Description
IAttachmentProcessor processor

The attachment processor.

AttachmentInfo[] attachments

The attachments.

Remarks

Initializes a new instance of the AttachmentContainer class.

Methods

View Source

GetEnumerator()

Gets the attachments.

Declaration
public IEnumerator<AttachmentInfo> GetEnumerator()
Returns
Type Description
IEnumerator<AttachmentInfo>
View Source

Load(string)

Loads an attachment from the IAttachmentContainer.

Declaration
public ValueTask<object> Load(string name)
Parameters
Type Name Description
string name

The name of the attachment to load.

Returns
Type Description
ValueTask<object>

A task representing the attachment contents.

Exceptions
Type Condition
KeyNotFoundException

Thrown if the attachment is missing.

View Source

Load<T>(string)

Loads a typed attachment from the IAttachmentContainer.

Declaration
public ValueTask<T> Load<T>(string name)
Parameters
Type Name Description
string name

The name of the attachment to load.

Returns
Type Description
ValueTask<T>

A task representing the attachment contents.

Type Parameters
Name Description
T

The type of the attachment to load.

Exceptions
Type Condition
KeyNotFoundException

Thrown if the attachment is missing.

InvalidCastException

Thrown if the attachment is not of the given type.

View Source

TryGetInfo(string)

Gets the attachment info.

Declaration
public AttachmentInfo? TryGetInfo(string name)
Parameters
Type Name Description
string name

The name of the attachment.

Returns
Type Description
AttachmentInfo

The info, if it exists.

View Source

TryLoad(string)

Loads an attachment from the IAttachmentContainer.

Declaration
public ValueTask<object?> TryLoad(string name)
Parameters
Type Name Description
string name

The name of the attachment to load.

Returns
Type Description
ValueTask<object>

A task representing the attachment contents, or null if the attachment was missing.

Implements

IAttachmentContainer
IEnumerable<T>
IEnumerable

Extension Methods

IAttachmentContainerExtensions.LoadStream(IAttachmentContainer, AttachmentInfo)
  • View Source
In this article
Back to top Generated by DocFX