Table of Contents

Method ReplaceFrom

Namespace
PaintDotNet.FileTypes
Assembly
PaintDotNet.FileTypes.dll

ReplaceFrom(IReadOnlyFileTypeMetadata)

Replaces the contents of every metadata section in this metadata container with the values from the corresponding section of another metadata container.

void ReplaceFrom(IReadOnlyFileTypeMetadata source)

Parameters

source IReadOnlyFileTypeMetadata

The metadata container to copy from.

Remarks

Each of this container's sections (per SectionKinds) is replaced from the source's section of the same kind, so the source must have at least the sections that this container has; sections that exist only in source are ignored. For example, calling layerMetadata.ReplaceFrom(documentMetadata) is legal because IFileTypeLayerMetadata only has the Custom section, which IFileTypeDocumentMetadata also has. The reverse, documentMetadata.ReplaceFrom(layerMetadata), throws ArgumentException because the layer metadata does not have the Exif, Hdr, Iptc, or Xmp sections that the document metadata needs.

Exceptions

ArgumentException

Thrown if source does not have all of the metadata sections that this metadata container has.