Skip to main content
.NET Framework 4.5.2+

RichEditDocumentServer.BeforeImport Event

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

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.RichEdit.v22.1.Core.dll

Declaration

public event BeforeImportEventHandler BeforeImport

Event Data

The BeforeImport event's data class is BeforeImportEventArgs. 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.

Example

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);
        }
   }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the BeforeImport event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Implements

See Also