Class AttachmentContainer
A container for attachment files, which may or may not have been downloaded into local memory or storage.
Inheritance
System.Object
AttachmentContainer
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CrashCABN.Metadata
Assembly: CrashCABN.Metadata.Attachments.dll
Syntax
public sealed class AttachmentContainer : IAttachmentContainer, IEnumerable<AttachmentInfo>, IEnumerable
Constructors
View SourceAttachmentContainer(IAttachmentProcessor, AttachmentInfo[])
Initializes a new instance of the AttachmentContainer class.
Declaration
public AttachmentContainer(IAttachmentProcessor processor, params AttachmentInfo[] attachments)
Parameters
Type | Name | Description |
---|---|---|
IAttachmentProcessor | processor | The attachment processor. |
AttachmentInfo[] | attachments | The attachments. |
Methods
View SourceGetEnumerator()
Gets the attachments.
Declaration
public IEnumerator<AttachmentInfo> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<AttachmentInfo> |
Load(String)
Declaration
public async ValueTask<object> Load(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Object> |
Load<T>(String)
Declaration
public async ValueTask<T> Load<T>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<T> |
Type Parameters
Name | Description |
---|---|
T |
TryLoad(String)
Loads an attachment from the IAttachmentContainer.
Declaration
public async ValueTask<object> TryLoad(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the attachment to load. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Object> | A task representing the attachment contents, or null if the attachment was missing. |
Explicit Interface Implementations
View SourceIEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable