MetadataSearchRedaction Class
Represents a metadata redaction that searches and redacts metadata using regular expressions, matching keys and/or values.
Inheritance Hierarchy

Namespace: GroupDocs.Redaction.Redactions
Assembly: GroupDocs.Redaction (in GroupDocs.Redaction.dll) Version: 20.11
Syntax
public class MetadataSearchRedaction : MetadataRedaction

The MetadataSearchRedaction type exposes the following members.

Constructors
  NameDescription
Public methodMetadataSearchRedaction(String, String)
Initializes a new instance of MetadataSearchRedaction class, using value to match redacted items.
Public methodMetadataSearchRedaction(Regex, String)
Initializes a new instance of MetadataSearchRedaction class, using value to match redacted items.
Public methodMetadataSearchRedaction(String, String, String)
Initializes a new instance of MetadataSearchRedaction class, using item name and value to match redacted items.
Public methodMetadataSearchRedaction(Regex, String, Regex)
Initializes a new instance of MetadataSearchRedaction class, using item name and value to match redacted items.
Properties
  NameDescription
Public propertyDescription
Returns a string, describing the redaction and its parameters.
(Overrides RedactionDescription.)
Public propertyFilter
Gets or sets the filter, which is used to select all or specific metadata, e.g. Author or Company.
(Inherited from MetadataRedaction.)
Public propertyKeyExpression
Gets the regular expression to match name (key) of metadata item.
Public propertyReplacement
Gets the textual replacement value.
Public propertyValueExpression
Gets the regular expression to match value text of a metadata item.
Methods
  NameDescription
Protected methodApplyFilter
Applies the current Filter value to a given metadata dictionary.
(Inherited from MetadataRedaction.)
Public methodApplyTo(DocumentFormatInstance)
Applies the redaction to a given format instance.
(Inherited from MetadataRedaction.)
Protected methodApplyTo(MetadataItem, IMetadataAccess)
Applies the redaction to a given metadata item.
(Overrides MetadataRedactionApplyTo(MetadataItem, IMetadataAccess).)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodIsApplicableTo
Checks if this redaction could be applied to a given metadata item.
(Overrides MetadataRedactionIsApplicableTo(MetadataItem).)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks
Learn more
Examples
The following example demonstrates how to search and redact certain text in specific metadata.
C#
using (Redactor redactor = new Redactor(@"C:\sample.docx"))
{
   MetadataSearchRedaction redaction = new MetadataSearchRedaction("Company Ltd.", "--company--");
   // If not set, applies to all metadata items
   redaction.Filter = MetadataFilters.Company;
   redactor.Apply(redaction);
   redactor.Save();
}
See Also