A function to test each metadata property for a condition.
value
PropertyValue
A value for the picked properties.
Return Value
The number of affected properties.
Remarks
Learn more
More examples demonstrating usages of this method: Adding metadata
Examples
This example demonstrates how to add some missing metadata properties to a file regardless of its format.
using(Metadatametadata=newMetadata(Constants.InputDocx)){// Add a property containing the file last printing date if it's missing// Note that the property will be added to metadata packages that satisfy the following criteria:// 1) Only existing metadata packages will be affected. No new packages are added during this operation// 2) There should be a known metadata property in the package structure that fits the search condition but is actually missing in the package.// All properties supported by a certain package are usually defined in the specification of a particular metadata standardvaraffected=metadata.AddProperties(p=>p.Tags.Contains(Tags.Time.Printed),newPropertyValue(DateTime.Now));Console.WriteLine("Affected properties: {0}",affected);metadata.Save(Constants.OutputDocx);}