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+

IFormatDetectorService Interface

Allows detecting the format of the document contained in the stream.

Namespace: DevExpress.XtraRichEdit.Services

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

Declaration

public interface IFormatDetectorService
Public Interface IFormatDetectorService
public interface IFormatDetectorService
Public Interface IFormatDetectorService

Remarks

Built-in implementation of the IFormatDetectorService service detects supported document formats by file signature, by the structure of the inner zip archive and by the presence of certain elements. You can implement your own format detector and register it as a service for use in your application.

Examples

This code snippet uses the IFormatDetectorService.DetectFormat method to determine the format of the document contained in the stream for subsequent loading with the RichEditControl.LoadDocument method.

using (Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LoadDocumentExample.TextWithImagesODT"))
    {
    DocumentFormat format = richEditControl1.GetService<IFormatDetectorService>().DetectFormat(stream);
    richEditControl1.LoadDocument(stream, format);
}
See Also