C
cab0san
Plugin Architecture Question - Best Practice For Forms Update
I have an application that follows a simple plugin architecture. Yes,
it is my first plugin app, so please bear with me. There is an
interface defined, and followed by the host exe and plugin (or client)
dll. The plugins reach out into the world and get bits of information
(stock prices, new mail, disk space, rss feeds... whatever) these bits
of information end up as treenodes in a treeview in the host app.
My question is:
When a plugin is ready to deliver updated content, say perhaps by use
of a timer, what is the preferred way of notifying the host app?
(assuming that my plugin will be in a seperate thread)
Should I pass a reference to the form?
Do I raise an event?
I know that you should operate on winforms in the originating thread
only , so they don't play well with refreshes sent from timer threads
(or any other thread). I am able to use invoke to get around a few
things, but I was hoping to find a simpler solution, and wanted to hear
some opinions.
I have an application that follows a simple plugin architecture. Yes,
it is my first plugin app, so please bear with me. There is an
interface defined, and followed by the host exe and plugin (or client)
dll. The plugins reach out into the world and get bits of information
(stock prices, new mail, disk space, rss feeds... whatever) these bits
of information end up as treenodes in a treeview in the host app.
My question is:
When a plugin is ready to deliver updated content, say perhaps by use
of a timer, what is the preferred way of notifying the host app?
(assuming that my plugin will be in a seperate thread)
Should I pass a reference to the form?
Do I raise an event?
I know that you should operate on winforms in the originating thread
only , so they don't play well with refreshes sent from timer threads
(or any other thread). I am able to use invoke to get around a few
things, but I was hoping to find a simpler solution, and wanted to hear
some opinions.