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");
 }
 static void Unload()
 {
     loader.Disconnect();
     loader = null;
     if (pluginDomain != null)
     {
         AppDomain.Unload(pluginDomain);
     }
     pluginDomain = null;
 }