MetadataSetProperties Method |
Namespace: GroupDocs.MetadataAssembly: GroupDocs.Metadata (in GroupDocs.Metadata.dll) Version: 21.8
Syntaxpublic int SetProperties(
Func<MetadataProperty, bool> predicate,
PropertyValue value
)
Public Function SetProperties (
predicate As Func(Of MetadataProperty, Boolean),
value As PropertyValue
) As Integer
public:
int SetProperties(
Func<MetadataProperty^, bool>^ predicate,
PropertyValue^ value
)
member SetProperties :
predicate : Func<MetadataProperty, bool> *
value : PropertyValue -> int
Parameters
- predicate
- Type: GroupDocs.Metadata.CommonFuncMetadataProperty, Boolean
A function to test each metadata property for a condition. - value
- Type: GroupDocs.Metadata.CommonPropertyValue
A new value for the filtered properties.
Return Value
Type:
Int32The number of affected properties.
Remarks
Please note that GroupDocs.Metadata implicitly checks the type of each filtered property.
It's impossible to set a property with a value having inappropriate type.
Learn more
Examples
This example demonstrates how to set specific metadata properties using different criteria.
using (Metadata metadata = new Metadata(Constants.InputVsdx))
{
var affected = metadata.SetProperties(
p => p.Tags.Contains(Tags.Time.Created) || p.Tags.Contains(Tags.Time.Modified),
new PropertyValue(DateTime.Now));
Console.WriteLine("Properties set: {0}", affected);
metadata.Save(Constants.OutputVsdx);
}
See Also