日期:2014-05-16 浏览次数:20547 次



using System.Linq;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Text;
using wwsdkcomLib;
using System.Xml;
namespace JSHelper
{
public class Global
{
public static int lPluginCookie;
public static int lCookie;
public static object pSlot;
public static string appid = "18265";
}
[ComVisible(true),
Guid("B221A17A-D3E7-44df-AD67-D45CFA4B5229"),
ClassInterface(ClassInterfaceType.None)]
public class Class1 : ISDKPlugin2
{
public void OnConnect(object pApplication, int lPluginCookie)
{
// OnConnect 不建议使用末态对话框
//ISDKPluginQueryResult pqr = (pApplication as ISDKApplication3).GetSubScriptionInfo(lPluginCookie) as ISDKPluginQueryResult;
//Global.appid = pqr.appID;
}
public void OnDisconnect(object pApplication, int lPluginCookie)
{
// OnDisConnect 不建议使用末态对话框
// MessageBox.Show("我被卸载了", "csharp helloworld");
}
public void OnNotify(SDKMessageID MsgID, object pParam)
{
if (MsgID == SDKMessageID.NOTIFY_OFFLINE)
{
}
else if (MsgID == SDKMessageID.NOTIFY_USERLOGIN)
{
}
}
public void OnUninstall()
{
}
public void Require()
{
}
}
[ComVisible(true),
Guid("950BFC6C-502A-4239-A36E-90893BA3B03E"),
ClassInterface(ClassInterfaceType.None)]
public class Class2 : ISDKPluginItem {
Form1 f1;
public void OnMenuClick(int lCmdID)
{
}
// 插件作为按钮出现时候得到点击后被调用
// 本例中此方法将在点击发生后得到调用
public void OnClick()
{
try
{
this.f1.Show();
}
catch(Exception ex)
{
this.f1 = new Form1();
this.f1.Show();
}
}
// 插件接入到插槽后得到通知
public void OnCreate(object pSlot, int hParentWnd, int lCookie)
{
}
// 插件在附属插槽被销毁时候得到通知
public void OnDestroy()
{
// 使用模态对话框可能导致异常
// MessageBox.Show("聊天对话框输入工具条插件被销毁", "csharp allinone plugin");
}
// 和插件项本身相关的消息通知
public void OnNotify(SDKItemNotifyID MsgIDD, object pParam)
{
}
// 当插件以窗口形式出现情况下,在父窗口发生变化情况下得到通知
public void OnSize(int cx, int cy)
{
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace JSHelper
{
public partial class Form1 : Form
{
String path;
Form2 f2;
Form2 f3;
Form2 f4;
Form2 f5;
Form2 f6;
public Form1()
{
InitializeComponent();
this.path = Application.StartupPath;
this.webBrowser1.Url = new System.Uri(this.path + "\\plugins\\" + Global.appid + "\\src\\debugger.html", false);
}
private void ExamplesToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
System.Diagnostics.Process.Start("explorer", this.path + "\\plugins\\" + Global.appid + "\\src\\example\\");//+this.path
}
catch(Exception ex)
{