IptcRecordSet

IptcRecordSet class

Represents a collection of IPTC records.

public sealed class IptcRecordSet : CustomPackage

Constructors

Name Description
IptcRecordSet() Initializes a new instance of the IptcRecordSet class.
IptcRecordSet(IptcDataSet[]) Initializes a new instance of the IptcRecordSet class.

Properties

Name Description
ApplicationRecord { get; set; } Gets or sets the Application Record.
Count { get; } Gets the number of metadata properties.
EnvelopeRecord { get; set; } Gets or sets the Envelope Record.
Item { get; } Gets the IptcRecord with the specified number. (3 indexers)
Keys { get; } Gets a collection of the metadata property names.
MetadataType { get; } Gets the metadata type.
PropertyDescriptors { get; } Gets a collection of descriptors that contain information about properties accessible through the GroupDocs.Metadata search engine.

Methods

Name Description
Add(IptcDataSet) Adds the specified dataSet to the appropriate record. The dataSet is considered as repeatable if a dataSet with the specified number already exists.
virtual AddProperties(Func<MetadataProperty, bool>, PropertyValue) Adds known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well.
Clear() Removes all records from the collection.
Contains(string) Determines whether the package contains a metadata property with the specified name.
virtual FindProperties(Func<MetadataProperty, bool>) Finds the metadata properties satisfying the specified predicate. The search is recursive so it affects all nested packages as well.
GetEnumerator() Returns an enumerator that iterates through the collection.
Remove(byte) Removes the record with the specified record number.
Remove(byte, byte) Removes the dataSet with the specified record and dataSet number.
virtual RemoveProperties(Func<MetadataProperty, bool>) Removes metadata properties satisfying the specified predicate.
virtual Sanitize() Removes writable metadata properties from the package. The operation is recursive so it affects all nested packages as well.
Set(IptcDataSet) Adds or updates the specified dataSet in the appropriate record.
virtual SetProperties(Func<MetadataProperty, bool>, PropertyValue) Sets known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well. This method is a combination of AddProperties and UpdateProperties. If an existing property satisfies the predicate its value is updated. If there is a known property missing in the package that satisfies the predicate it is added to the package.
ToDataSetList() Creates a list of dataSets from the package.
ToList() Creates a list from the package.
virtual UpdateProperties(Func<MetadataProperty, bool>, PropertyValue) Updates known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well.

Remarks

Learn more

Examples

This code sample shows hot to update basic IPTC metadata properties.

using (Metadata metadata = new Metadata(Constants.InputJpeg))
{
    IIptc root = metadata.GetRootPackage() as IIptc;
    if (root != null)
    {
        // Set the IPTC package if it's missing
        if (root.IptcPackage == null)
        {
            root.IptcPackage = new IptcRecordSet();
        }

        if (root.IptcPackage.EnvelopeRecord == null)
        {
            root.IptcPackage.EnvelopeRecord = new IptcEnvelopeRecord();
        }

        root.IptcPackage.EnvelopeRecord.DateSent = DateTime.Now;
        root.IptcPackage.EnvelopeRecord.ProductID = Guid.NewGuid().ToString();

        // ...

        if (root.IptcPackage.ApplicationRecord == null)
        {
            root.IptcPackage.ApplicationRecord = new IptcApplicationRecord();
        }

        root.IptcPackage.ApplicationRecord.ByLine = "GroupDocs";
        root.IptcPackage.ApplicationRecord.Headline = "test";
        root.IptcPackage.ApplicationRecord.ByLineTitle = "code sample";
        root.IptcPackage.ApplicationRecord.ReleaseDate = DateTime.Today;

        // ...

        metadata.Save(Constants.OutputJpeg);
    }
}

See Also