IRedactionCallback Interface
Defines methods that are required for receiving information on each redaction change and optionally prevent it.

Namespace: GroupDocs.Redaction.Redactions
Assembly: GroupDocs.Redaction (in GroupDocs.Redaction.dll) Version: 20.7
Syntax
public interface IRedactionCallback

The IRedactionCallback type exposes the following members.

Methods
  NameDescription
Public methodAcceptRedaction
This call is triggered right before applying any redaction to the document and allows to log or forbid it.
Remarks
Learn more
Examples
The following example demonstrates how to implement detailed logging for redaction process.
C#
public class RedactionDump : IRedactionCallback
{
    public RedactionDump()
    {
    }

    public bool AcceptRedaction(RedactionDescription description)
    {
        Console.Write("{0} redaction, {1} action, item {2}. ", description.RedactionType, description.ActionType, description.OriginalText);
        if (description.Replacement != null)
        {
            Console.Write("Text {0} is replaced with {1}. ", description.Replacement.OriginalText, description.Replacement.Replacement);
        }
        Console.WriteLine();
        // you can return "false" here to prevent particular change during redaction process
        return true;
    }
}

...

// Assign an instance before using Redactor
Redactor.RedactionCallback = new RedactionDump();
See Also