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
metadataIFileTypeMetadataThe metadata instance.
sectionKindFileTypeMetadataSectionKindThe kind of metadata section to get.
Returns
- IFileTypeMetadataSection
The metadata section.
Exceptions
- KeyNotFoundException
Thrown if
metadatadoes 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
metadataIFileTypeMetadataThe metadata instance.
sectionKindFileTypeMetadataSectionKindThe kind of metadata section to get.
Returns
- TSection
The metadata section.
Type Parameters
TSectionThe metadata section interface type.
Exceptions
- KeyNotFoundException
Thrown if
metadatadoes not contain a metadata section of the given kind.- InterfaceNotSupportedException
Thrown if there's a mismatch between
sectionKindandTSection. For example, ifsectionKindis Exif andTSectionistypeof(IFileTypeXmpMetadata).