I'm wondering if that is somehow possible.
I've written a program which uses plugins,
now I want the PluginAPI to offer some custom Events.
Custom as in not some controls Events, rather a declared event which is then raised somewhere in my code.
Now I know only 2 solutions which I'd rather not use:
Move all the declarations of the Events to the class which is passed to the Addoninterface, which is usable by the addonwriter,
or pass the whole class where the Event declarations reside, also making any other public declared object accessible.
Here is an example:
iAddon is the Interface which the addonwriter has to implement.
The API is provided though the iHost Interface,
which is where I want to make the Events, located in MainProgram, available.
I've written a program which uses plugins,
now I want the PluginAPI to offer some custom Events.
Custom as in not some controls Events, rather a declared event which is then raised somewhere in my code.
Now I know only 2 solutions which I'd rather not use:
Move all the declarations of the Events to the class which is passed to the Addoninterface, which is usable by the addonwriter,
or pass the whole class where the Event declarations reside, also making any other public declared object accessible.
Here is an example:
Visual Basic:
Class MainProgram
Public Event Bla()
End Class
Public Class cAddons
Interface iHost
End Interface
Interface iAddon
Sub Initialize(ByVal Host As iHost)
End Interface
End Class
The API is provided though the iHost Interface,
which is where I want to make the Events, located in MainProgram, available.