Show / Hide Table of Contents

Class AttachmentInfo

References a piece of data or file attached to a crash.

Inheritance
object
AttachmentInfo
Implements
IEquatable<AttachmentInfo>
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.Abstractions.dll
Syntax
public sealed record AttachmentInfo : IEquatable<AttachmentInfo>

Constructors

View Source

AttachmentInfo(string, object, AttachmentType, bool)

References a piece of data or file attached to a crash.

Declaration
public AttachmentInfo(string Name, object Source, AttachmentType Type = AttachmentType.Constant, bool Custom = false)
Parameters
Type Name Description
string Name

The attachment name.

object Source

The attachment value or location.

AttachmentType Type

The attachment type, a constant value by default.

bool Custom

Whether or not the attachment is a custom (or title-specific) one.

Properties

View Source

Custom

Whether or not the attachment is a custom (or title-specific) one.

Declaration
public bool Custom { get; init; }
Property Value
Type Description
bool
View Source

Name

The attachment name.

Declaration
public string Name { get; init; }
Property Value
Type Description
string
View Source

Size

Declaration
[JsonIgnore]
public int? Size { get; }
Property Value
Type Description
int?
View Source

Source

The attachment value or location.

Declaration
public object Source { get; init; }
Property Value
Type Description
object
View Source

Type

The attachment type, a constant value by default.

Declaration
public AttachmentType Type { get; init; }
Property Value
Type Description
AttachmentType

Methods

View Source

GetStringValue()

Gets the attachment value as a string.

Declaration
public string GetStringValue()
Returns
Type Description
string

The typed attachment value.

Exceptions
Type Condition
NotSupportedException

If the type was incorrect.

View Source

GetUriValue()

Gets the attachment value as a URL.

Declaration
public Uri GetUriValue()
Returns
Type Description
Uri

The typed attachment value.

Exceptions
Type Condition
NotSupportedException

If the type was incorrect.

View Source

GetValue<T>()

Gets the attachment value or location as the given type.

Declaration
public T GetValue<T>() where T : class
Returns
Type Description
T

The typed attachment value or location.

Type Parameters
Name Description
T

The type to cast to.

Exceptions
Type Condition
InvalidOperationException

If the type was incorrect.

View Source

TryGetUriValue()

Attempt to get the attachment value as a URL.

Declaration
public Uri? TryGetUriValue()
Returns
Type Description
Uri

The typed attachment value, or null if it could not be converted.

Implements

IEquatable<T>
  • View Source
In this article
Back to top Generated by DocFX