IRedactionCallback

IRedactionCallback interface

Definierar metoder som krävs för att ta emot information om varje redigeringsändring och eventuellt förhindra den.

public interface IRedactionCallback

Metoder

namn Beskrivning
AcceptRedaction(RedactionDescription) Det här anropet utlöses precis innan någon redigering tillämpas på dokumentet och gör det möjligt att logga eller förbjuda det.

Anmärkningar

Läs mer

Exempel

Följande exempel visar hur man implementerar detaljerad loggning för redigeringsprocess.

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();
        // du kan returnera "false" här för att förhindra särskilda förändringar under redigeringsprocessen
        return true;
    }
}

...

// Tilldela en instans innan du använder Redactor
Redactor.RedactionCallback = new RedactionDump();

Se även