Exemple #1
0
 void LoadPlugin()
 {
     this.Plugin = new VIPBrowserPlugin.IPlugin[Plugins.Length];
     for (int i = 0; i < Plugins.Length; i++)
     {
         VIPBrowserPlugin.IPlugin pp = Plugins[i].CreateInstance(this);
         Plugin[i] = pp;
         pp.Run();
     }
 }
 private void listView1_DoubleClick(object sender, EventArgs e)
 {
     if (this.listView1.SelectedItems.Count < 0)
     {
         return;
     }
     VIPBrowserPlugin.IPlugin ip = this.listView1.SelectedItems[0].Tag as VIPBrowserPlugin.IPlugin;
     if (!ip.HasSetupDialog)
     {
         return;
     }
     ip.ShowSetupDialog();
 }
Exemple #3
0
 /// <summary>
 /// プラグインクラスのインスタンスを作成する
 /// </summary>
 /// <returns>プラグインクラスのインスタンス</returns>
 public VIPBrowserPlugin.IPlugin CreateInstance(VIPBrowserPlugin.IPluginHost host)
 {
     try
     {
         //アセンブリを読み込む
         System.Reflection.Assembly asm = System.Reflection
                                          .Assembly.LoadFrom(this.Location);
         //クラス名からインスタンスを作成する
         VIPBrowserPlugin.IPlugin plugin = (VIPBrowserPlugin.IPlugin)
                                           asm.CreateInstance(this.ClassName);
         //初期化
         plugin.Initialize(host);
         return(plugin);
     }
     catch
     {
         return(null);
     }
 }