C# |
---|
public static void SetBrowserFactoryImpl ( BrowserFactoryImpl fac ) |
This method is used only in very rare circumstances. By default, the BrowserFactory tries to determine the implementation itself when you try to create an instance of the Browser interface for the first time. By using this method, you can override the default BrowserFactory implementation.
The BrowserFactory tries to determine the default implementation by looking for a key "vrml.eai.factory.class" in the configuration file of your application. E.g. when the name of your application is "MyApp.exe", you can put a configuration file with the name "MyApp.exe.config" next to the executable with the following contents:
C# |
---|
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="vrml.eai.factory.class" value="MyBrowserFactoryImpl,MyLib" /> </appSettings> </configuration> |
When the BrowserFactory does not find a BrowserFactory implementation in the configuration file, it loads a browser-specific implementation (in the case of Instant Player, it's the class "Avalon.Vrml.EAI.BrowserFactoryImpl" in "AvalonEAI.NET.dll").
You have to set the actual implementation before you call any other method of this class. Once the implementation is set, you cannot change it anymore.