The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

RichEditDocumentServer.BeforeImport Event

Occurs before a document is loaded (imported from an external source).

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.RichEdit.v19.2.Core.dll

Declaration

public event BeforeImportEventHandler BeforeImport
Public Event BeforeImport As BeforeImportEventHandler
public event BeforeImportEventHandler BeforeImport
Public Event BeforeImport As BeforeImportEventHandler
public event BeforeImportEventHandler BeforeImport
Public Event BeforeImport As BeforeImportEventHandler

Event Data

The BeforeImport event handler receives an argument of the BeforeImportEventArgs type. The following properties provide information specific to this event.

Property Description
DocumentFormat Gets the format of the document being loaded.
Options Provides access to the importer options.

Remarks

The BeforeImport event enables you to adjust the importer options as required.

Examples

server.BeforeImport += BeforeImportHelper.BeforeImport;
server.LoadDocument("Documents\\TerribleRevengeKOI8R.txt");             

class BeforeImportHelper
{
   public static void BeforeImport(object sender, BeforeImportEventArgs e)
    {
      if (e.DocumentFormat == DocumentFormat.PlainText)
        {
           ((PlainTextDocumentImporterOptions)e.Options).Encoding = Encoding.GetEncoding(20866);
        }
   }
}
See Also