IRedactionCallback

IRedactionCallback interface

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

public interface IRedactionCallback

Methods

Name Description
AcceptRedaction(RedactionDescription) 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.

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