Esempio n. 1
0
 public void UnloadDomain()
 {
     foreach (TPlugin p in plugins.Keys.ToArray())
     {
         p.Dispose();
     }
     AppDomain.Unload(appDomain);
     remotePlugin = null;
     appDomain    = null;
 }
Esempio n. 2
0
 private void CreateDomain()
 {
     appDomain    = AppDomain.CreateDomain(typeof(TPlugin).FullName);
     remotePlugin = (PluginDomain <TPlugin>)appDomain.CreateInstanceAndUnwrap(this.GetType().Assembly.FullName,
                                                                              typeof(PluginDomain <TPlugin>).FullName,
                                                                              false,
                                                                              System.Reflection.BindingFlags.Default,
                                                                              null,
                                                                              new object[] { AssemblyFilePath },
                                                                              System.Globalization.CultureInfo.CurrentCulture,
                                                                              null);
 }