Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
Generaliterate through enum Pin
Christian Graus15-Mar-04 13:14
protectorChristian Graus15-Mar-04 13:14 
GeneralRe: iterate through enum Pin
Christian Graus15-Mar-04 14:34
protectorChristian Graus15-Mar-04 14:34 
GeneralForms & variables & suchlike Pin
surgeproof15-Mar-04 10:54
surgeproof15-Mar-04 10:54 
GeneralRe: Forms & variables & suchlike Pin
Judah Gabriel Himango15-Mar-04 11:07
sponsorJudah Gabriel Himango15-Mar-04 11:07 
GeneralRe: Forms & variables & suchlike Pin
surgeproof16-Mar-04 8:16
surgeproof16-Mar-04 8:16 
GeneralRe: Forms & variables & suchlike Pin
surgeproof17-Mar-04 6:38
surgeproof17-Mar-04 6:38 
GeneralProcessDialogKey and AppDomain Pin
zilch15-Mar-04 9:37
zilch15-Mar-04 9:37 
GeneralRe: ProcessDialogKey and AppDomain Pin
Heath Stewart15-Mar-04 9:55
protectorHeath Stewart15-Mar-04 9:55 
AppDomains separate the code completely. The only way to talk to each other is through Remoting (or some custom socket communication or something). Loading plugins into a separate AppDomain is not a good idea for this reason - they can't communicate with the application except through Remoting, which decreases performance since calls have to be marshaled across application boundaries.

There are many articles here on CodeProject about designing effective plugin type applications. You don't have to unload the assembly to unload your plugin. You simply need a way to dispose of the plugin, such as setting all instances to null or disposing it through the IDisposable implementation (you don't have to implement it, but it's a good idea) and clean-up the resource. In your app, just check if the plugin is disposed before using it. If you want to nullify its instances, just check for that.

If you must load these into separate AppDomains, then consider that each AppDomain cannot talk to each other except through Remoting (which means that keys processed in a plugin cannot be handled by the main application since they're in different threads). You'll have to devise some way to tell the host application that keys were pressed, perhaps by using a binary formatter through a TcpChannel and firing some event that the host application can handle (again, through Remoting). This is a kludge, though.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: ProcessDialogKey and AppDomain Pin
Nemanja Trifunovic15-Mar-04 10:23
Nemanja Trifunovic15-Mar-04 10:23 
GeneralRe: ProcessDialogKey and AppDomain Pin
Heath Stewart15-Mar-04 10:50
protectorHeath Stewart15-Mar-04 10:50 
GeneralRe: ProcessDialogKey and AppDomain Pin
zilch15-Mar-04 10:34
zilch15-Mar-04 10:34 
GeneralRe: ProcessDialogKey and AppDomain Pin
Heath Stewart15-Mar-04 10:48
protectorHeath Stewart15-Mar-04 10:48 
GeneralRe: ProcessDialogKey and AppDomain Pin
zilch15-Mar-04 11:12
zilch15-Mar-04 11:12 
GeneralRe: ProcessDialogKey and AppDomain Pin
Heath Stewart15-Mar-04 11:27
protectorHeath Stewart15-Mar-04 11:27 
GeneralRe: ProcessDialogKey and AppDomain Pin
zilch15-Mar-04 12:43
zilch15-Mar-04 12:43 
GeneralRe: ProcessDialogKey and AppDomain Pin
zilch15-Mar-04 13:09
zilch15-Mar-04 13:09 
QuestionRe: ProcessDialogKey and AppDomain Pin
gratajik31-Jan-11 13:38
gratajik31-Jan-11 13:38 
GeneralTask Bar Pin
SherKar15-Mar-04 7:40
SherKar15-Mar-04 7:40 
GeneralRe: Task Bar Pin
Judah Gabriel Himango15-Mar-04 9:12
sponsorJudah Gabriel Himango15-Mar-04 9:12 
GeneralRe: Task Bar Pin
Stefan Troschuetz15-Mar-04 9:51
Stefan Troschuetz15-Mar-04 9:51 
GeneralRe: Task Bar Pin
Heath Stewart15-Mar-04 10:01
protectorHeath Stewart15-Mar-04 10:01 
Generalregd dataset Pin
karteek15-Mar-04 6:46
karteek15-Mar-04 6:46 
GeneralRe: regd dataset Pin
Heath Stewart15-Mar-04 6:56
protectorHeath Stewart15-Mar-04 6:56 
Generalcached dll's Pin
cmarmr15-Mar-04 6:04
cmarmr15-Mar-04 6:04 
GeneralRe: cached dll's Pin
Heath Stewart15-Mar-04 6:20
protectorHeath Stewart15-Mar-04 6:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.