Click or drag to resize

EngineFactoryCreate Method (EngineOptions)

Creates and returns an IEngine instance.

Namespace:  DotNetBrowser.Engine
Assembly:  DotNetBrowser.Core (in DotNetBrowser.Core.dll) Version: 2.27.5
Syntax
C#
public static IEngine Create(
	EngineOptions options
)

Parameters

options
Type: DotNetBrowser.EngineEngineOptions
The EngineOptions instance that will be used for initializing the engine

Return Value

Type: IEngine
A completely initialized Chromium engine.
Exceptions
ExceptionCondition
EngineInitializationExceptionThe IEngine initialization has failed for some reason.
Examples
Create IEngine
string dataDir = TestUtil.GenerateCustomFolderPath();
Debug.WriteLine($"Data directory: {dataDir}");
Directory.CreateDirectory(dataDir);

EngineOptions engineOptions = new EngineOptions.Builder
    {
        UserDataDirectory = dataDir
    }
   .Build();
IEngine engine = EngineFactory.Create(engineOptions);
See Also