public PluginConnectionResult Connect(IPluginHost app) { DemoPluginApp demo = app as DemoPluginApp; demo.OnPrinting += (string str, ref bool result) => { Console.WriteLine("{0}开始打印:{1}", this.GetType().Name, str); }; return(PluginConnectionResult.Success); }
static void Main() { string phyPath = AppDomain.CurrentDomain.BaseDirectory; //File.Copy(phyPath + "../../../test1/binDebug/test1.dll", phyPath + "plugins/test1.exe", true); DemoPluginApp app = new DemoPluginApp(); //连接 app.Connect(); PluginPackAttribute attr; IPlugin p= PluginUtil.GetPlugin("com.test",out attr); //运行所有 //app.Run(); app.Print("这是一条消息!"); Console.ReadKey(); }
static void Main() { string phyPath = AppDomain.CurrentDomain.BaseDirectory; //File.Copy(phyPath + "../../../test1/binDebug/test1.dll", phyPath + "plugins/test1.exe", true); DemoPluginApp app = new DemoPluginApp(); //连接 app.Connect(); PluginPackAttribute attr; IPlugin p = PluginUtil.GetPlugin("com.test", out attr); //运行所有 //app.Run(); app.Print("这是一条消息!"); Console.ReadKey(); }