Exemplo n.º 1
0
 static void Load()
 {
     if (pluginDomain != null)
     {
         Unload();
     }
     pluginDomain = AppDomain.CreateDomain("PluginDomain" + Guid.NewGuid());
     var t = typeof (PluginLoader);
     loader = (PluginLoader) pluginDomain.CreateInstanceAndUnwrap(t.Assembly.FullName, t.FullName);
     loader.Load("Plugin1.dll");
 }
Exemplo n.º 2
0
 static void Unload()
 {
     loader.Disconnect();
     loader = null;
     if (pluginDomain != null)
     {
         AppDomain.Unload(pluginDomain);
     }
     pluginDomain = null;
 }