PluginLoader is a facility for loading the Plugin DLLs that constitute the Omea application, both stock and third-party.
Objectives:

  • (EXP) Enable running experimental Omea versions on different core binaries, plugins, and database without touching the primary installation.
  • (LDC) Use Load context for the core plugins instead of LoadFrom, which enables the use of GAC or NGen.
  • (PUP) Per-user plugins should still be supported.

Basics. PluginLoader should look for assembly files under the Plugin Locations and, in case the file matches the Plugin Files Mask, load the assembly and look for classes implementing the IPlugin interface, wwhich are the plugins.

Plugin Locations. There are several folders to be checked for the plugins (marked with "(lightbulb)"). The "[/*]" suffix on some of the location paths means that plugin files may be placed into a subfolder, up to one level deep under the main folder, if the plugin consists of multiple files and they're worth separating from the other plugins.

Plugin locations should be checked in the following order (primary plugins are preferred, then user's overrides go, then machine plugins):

  1. (P.JB)
  2. (P.DB)
  3. (P.LU)
  4. (P.RU)
  5. (P.AU)
  6. (P.OB)

(P.JB) implements (LDC).
As the plugins are not stored in the Registry, but read from the Binaries folder automatically, be it a compiled debug or installed release version, (P.JB) and (P.OB) implement (EXP). (P.DB) allows to switch plugin sets with the command-line.
(P.DB), (P.LU), and (P.RU) implement (PUP).

Plugin Files Mask. Not all the files in the Plugin Locations are subject to loading by Omea. To avoid loading excessive numbers of managed DLLs or native DLLs, the following regex filter should be applied to the files:

^.*\bOmeaPlugin\b.*(\.dll|\.exe)$