using XZL.Plugin;
public partial class Form1 : Form
{
Dictionary<string, string> _plugins;
public Form1()
{
InitializeComponent();
this.Load += new EventHandler(Form1_Load);
this.button1.Click += new EventHandler(button1_Click);
}
void button1_Click(object sender, EventArgs e)
{
var p = PlugInManage.Resolve(_plugins[listBox1.SelectedItem.ToString()]);
p.LoadPlugin();
//GC.Collect();
}
void Form1_Load(object sender, EventArgs e)
{
_plugins = PlugInManage.Load(System.IO.Path.GetDirectoryName(Application.ExecutablePath)
+ "" + "plugins");
foreach (var item in _plugins)
{
listBox1.Items.Add(item.Key);
}
}
}
using XZL.Plugin;
public partial class Form1 : Form,IPlugin
{
public Form1()
{
InitializeComponent();
}
public void LoadPlugIn()
{
this.Show();
}
string IPlugin.PluginName
{
get { return this.Text; }
}
}