Table of Contents

Method GetSection

Namespace
PaintDotNet.FileTypes
Assembly
PaintDotNet.FileTypes.dll

GetSection(IFileTypeMetadata, FileTypeMetadataSectionKind)

Gets a mutable metadata section by its FileTypeMetadataSectionKind.

public static IFileTypeMetadataSection GetSection(this IFileTypeMetadata metadata, FileTypeMetadataSectionKind sectionKind)

Parameters

metadata IFileTypeMetadata

The metadata instance.

sectionKind FileTypeMetadataSectionKind

The kind of metadata section to get.

Returns

IFileTypeMetadataSection

The metadata section.

Exceptions

KeyNotFoundException

Thrown if metadata does not contain a metadata section of the given kind.

GetSection<TSection>(IFileTypeMetadata, FileTypeMetadataSectionKind)

Gets a mutable metadata section by its FileTypeMetadataSectionKind.

public static TSection GetSection<TSection>(this IFileTypeMetadata metadata, FileTypeMetadataSectionKind sectionKind) where TSection : class, IFileTypeMetadataSection

Parameters

metadata IFileTypeMetadata

The metadata instance.

sectionKind FileTypeMetadataSectionKind

The kind of metadata section to get.

Returns

TSection

The metadata section.

Type Parameters

TSection

The metadata section interface type.

Exceptions

KeyNotFoundException

Thrown if metadata does not contain a metadata section of the given kind.

InterfaceNotSupportedException

Thrown if there's a mismatch between sectionKind and TSection. For example, if sectionKind is Exif and TSection is typeof(IFileTypeXmpMetadata).