Creating your own Content-Engine

 

Developers who would like to create their customized Content-Engine, will have to contact sales@blackice.com and obtain the Source Code of the ContentEngine.dll, which contains the existing engines.

 

The built-in IceViewer Engines are written in C# Programming Language, and use .NET Framework 4.6. Developers will have to use the same programming language and framework for their implementation.

 

The Content-Engine Source Code contains an IContentEngine interface, which has to be implemented in the Engines Class, the same way as the FileEngine and DatabaseEngine. For the complete list of the IContentEngine methods, please refer to the IContentEngine Interface section.

 

Besides implementing the Interface, the Source Code requires two more modifications to hook up the new engine into IceViewer:

 

 

Add the new engine to the ContentEngineType enum in the Engines Class:

 

public enum ContentEngineType

{

  Default,

  FileEngine,

  DatabaseEngine,

  MyCustomEngine // Your custom engine

}

 

Add the new engine to the CreateContentEnginemethod in the Engines Class:

 

public static Engine CreateContentEngine(ContentEngineType type = ContentEngineType.Default)

{

try

{

switch (type)

{

case ContentEngineType.MyCustomEngine: // Your custom engine

return new MyCustomEngine();// Your custom engine

case ContentEngineType.DatabaseEngine:

return new DatabaseEngine();

case ContentEngineType.FileEngine:

default:

return new FileEngine();

}

}

catch (Exception)

{

throw;

}

}

 

These modifications will ensure that IceViewer know about this new engine, and will let users use it.

 

Once all implementation and modification is done, you can compile the project, and replace the ContentEngine.dll in the <IceViewer Website>/bin directory, which is located below by default:

 

C:\inetpub\wwwroot\iceviewer\bin

 

To open document using the new Engine, please refer to the Open Documents using URL parameters section.