DocumentFormatInstanceInitialize Method
Performs initialization of the instance of document format handler.

Namespace: GroupDocs.Redaction.Integration
Assembly: GroupDocs.Redaction (in GroupDocs.Redaction.dll) Version: 21.3
Syntax
public virtual void Initialize(
	DocumentFormatConfiguration config,
	RedactorSettings settings
)

Parameters

config
Type: GroupDocs.Redaction.ConfigurationDocumentFormatConfiguration
Format configuration
settings
Type: GroupDocs.Redaction.OptionsRedactorSettings
Default settings for redaction process.
Examples

The following example demonstrates how to use the initialization data.

C#
public class MyCustomHandler : DocumentFormatInstance
{
    private string MyProperty { get; set; }

    // Other custom code 
    ...

    public override void Initialize(DocumentFormatConfiguration config)
    {
        base.Initialize(config);
        if (config.InitializationData.ContainsKey("MyProperty"))
        {
            MyProperty = config.InitializationData["MyProperty"];
        }
    }
}

// Plugging custom format into GroupDocs.Redaction
var mySettings = new DocumentFormatConfiguration();
mySettings.ExtensionFilter = ".foo";
mySettings.DocumentType = typeof(MyCustomHandler);
mySettings.InitializationData.Add("MyProperty", "bar");
var configuration = RedactorConfiguration.GetInstance();
configuration.AvailableFormats.Add(mySettings);
See Also