usmanazizgroupdocs
5/9/2016 - 4:35 PM

AuthorReplaceHandler.cs

// For complete examples and data files, please go to https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET
/// <summary>
/// This class updates author to 'Jack London'
/// </summary>
public class AuthorReplaceHandler : IReplaceHandler<MetadataProperty>
{
    public AuthorReplaceHandler(string outputPath)
    {
        this.OutputPath = outputPath;
    }

    public string OutputPath { get; private set; }

    public bool Handle(MetadataProperty property)
    {
        // if property name is 'author'
        if (property.Name.ToLower() == "author")
        {
            // update property value
            property.Value = new PropertyValue("Jack London");

            // and mark property as updated
            return true;
        }

        // ignore all other properties
        return false;
    }
}