(轻便)调试JavaScript的旺旺插件(基于jzshmyt的javascript-logger).doc_第1页
(轻便)调试JavaScript的旺旺插件(基于jzshmyt的javascript-logger).doc_第2页
(轻便)调试JavaScript的旺旺插件(基于jzshmyt的javascript-logger).doc_第3页
(轻便)调试JavaScript的旺旺插件(基于jzshmyt的javascript-logger).doc_第4页
(轻便)调试JavaScript的旺旺插件(基于jzshmyt的javascript-logger).doc_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Demo如下,大家拍砖吧! 请看下面介绍: 程序代码: 下面代码负责实现和旺旺IM通讯的接口,这里只响应了onClick事件。 C#代码 1. usingSystem.Linq; 2. usingSystem; 3. usingSystem.Collections.Generic; 4. usingSystem.Threading; 5. usingSystem.Windows.Forms; 6. usingSystem.Runtime.InteropServices; 7. usingSystem.Text; 8. usingwwsdkcomLib; 9. usingSystem.Xml; 10. 11. namespaceJSHelper 12. 13. publicclassGlobal 14. 15. publicstaticintlPluginCookie; 16. publicstaticintlCookie; 17. publicstaticobjectpSlot; 18. publicstaticstringappid=18265; 19. 20. ComVisible(true), 21. Guid(B221A17A-D3E7-44df-AD67-D45CFA4B5229), 22. ClassInterface(ClassInterfaceType.None) 23. publicclassClass1:ISDKPlugin2 24. 25. publicvoidOnConnect(objectpApplication,intlPluginCookie) 26. 27. /OnConnect不建议使用末态对话框 28. /ISDKPluginQueryResultpqr=(pApplicationasISDKApplication3).GetSubScriptionInfo(lPluginCookie)asISDKPluginQueryResult; 29. /Global.appid=pqr.appID; 30. 31. 32. publicvoidOnDisconnect(objectpApplication,intlPluginCookie) 33. 34. /OnDisConnect不建议使用末态对话框 35. /MessageBox.Show(我被卸载了,csharphelloworld); 36. 37. 38. 39. 40. publicvoidOnNotify(SDKMessageIDMsgID,objectpParam) 41. 42. 43. if(MsgID=SDKMessageID.NOTIFY_OFFLINE) 44. 45. 46. 47. elseif(MsgID=SDKMessageID.NOTIFY_USERLOGIN) 48. 49. 50. 51. 52. publicvoidOnUninstall() 53. 54. 55. 56. publicvoidRequire() 57. 58. 59. 60. ComVisible(true), 61. Guid(950BFC6C-502A-4239-A36E-90893BA3B03E), 62. ClassInterface(ClassInterfaceType.None) 63. 64. publicclassClass2:ISDKPluginItem 65. 66. Form1f1; 67. 68. publicvoidOnMenuClick(intlCmdID) 69. 70. 71. 72. /插件作为按钮出现时候得到点击后被调用 73. /本例中此方法将在点击发生后得到调用 74. 75. publicvoidOnClick() 76. 77. try78. 79. this.f1.Show(); 80. 81. catch(Exceptionex) 82. 83. this.f1=newForm1(); 84. this.f1.Show(); 85. 86. 87. 88. /插件接入到插槽后得到通知 89. 90. publicvoidOnCreate(objectpSlot,inthParentWnd,intlCookie) 91. 92. 93. 94. 95. /插件在附属插槽被销毁时候得到通知 96. 97. publicvoidOnDestroy() 98. 99. /使用模态对话框可能导致异常 100. /MessageBox.Show(聊天对话框输入工具条插件被销毁,csharpallinoneplugin); 101. 102. 103. /和插件项本身相关的消息通知 104. 105. publicvoidOnNotify(SDKItemNotifyIDMsgIDD,objectpParam) 106. 107. 108. 109. 110. /当插件以窗口形式出现情况下,在父窗口发生变化情况下得到通知 111. 112. publicvoidOnSize(intcx,intcy) 113. 114. 115. 116. 117. 118. 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) 下面代码是JSHelper窗体主程序,没什么意思。 C#代码 1. usingSystem; 2. usingSystem.Collections.Generic; 3. usingSystem.ComponentModel; 4. usingSystem.Data; 5. usingSystem.Drawing; 6. usingSystem.Text; 7. usingSystem.Windows.Forms; 8. 9. namespaceJSHelper 10. 11. publicpartialclassForm1:Form 12. 13. Stringpath; 14. Form2f2; 15. Form2f3; 16. Form2f4; 17. Form2f5; 18. Form2f6; 19. 20. publicForm1() 21. 22. InitializeComponent(); 23. this.path=Application.StartupPath; 24. this.webBrowser1.Url=newSystem.Uri(this.path+plugins+Global.appid+srcdebugger.html,false); 25. 26. 27. privatevoidExamplesToolStripMenuItem_Click(objectsender,EventArgse) 28. 29. try30. 31. System.Diagnostics.Process.Start(explorer,this.path+plugins+Global.appid+srcexample);/+this.path 32. 33. catch(Exceptionex) 34. 35. MessageBox.Show(请打开插件中的example目录.nn该目录的路径可能如下:n+this.path+plugins+Global.appid+srcexample); 36. 37. 38. 39. privatevoidHideToolStripMenuItem_Click(objectsender,EventArgse) 40. 41. this.Hide(); 42. 43. 44. privatevoidManualToolStripMenuItem_Click(objectsender,EventArgse) 45. 46. try47. 48. this.f2.Show(); 49. 50. catch51. 52. this.f2=newForm2(使用说明,newSystem.Uri(this.path+plugins+Global.appid+srcreadmeKingfishersManual.html); 53. this.f2.Show(); 54. 55. 56. 57. privatevoidAboutJSHelperToolStripMenuItem_Click(objectsender,EventArgse) 58. 59. Stringinfo=newString7; 60. info0=Version:0.9.0; 61. info1=ReleaseDate:2008-11-17; 62. info2=JSHelper是一款轻巧的Javascript调试工具,; 63. info3=以旺旺插件形式发布在阿里软件平台,; 64. info4=依赖于jzshmyt所写Kingfishers工具包。; 65. info5=方便使用是我的唯一目的。; 66. info6=Author:CharlesCui; 67. 68. try69. 70. this.f3.Show(); 71. 72. catch73. 74. this.f3=newForm2(关于-JSHelper,String.Join(,info,0,info.Length); 75. this.f3.Show(); 76. 77. 78. 79. privatevoidJavascriptlogToolStripMenuItem_Click(objectsender,EventArgse) 80. 81. Stringinfo=newString5; 82. info0=Kingfishers是一个用javascript语言编写的,能够代替alert,在浏览器中连续输出客户端javascript脚本运行日志的工具。; 83. info1=主要用于客户端脚本的分析和查错。; 84. info2=GoogleCode:/p/dewind/; 85. info3=Download:/files/Kingfishers-1.0.rar; 86. info4=Author:jzshmyt; 87. 88. try89. 90. this.f4.Show(); 91. 92. catch93. 94. this.f4=newForm2(关于-Kingfishers,String.Join(,info,0,info.Length); 95. this.f4.Show(); 96. 97. 98. 99. privatevoidAboutAuthorToolStripMenuItem_Click(objectsender,EventArgse) 100. 101. Stringinfo=newString4; 102. info0=作者博客:; 103. info1=作者邮箱:; 104. info2=作者寄语:欢迎广大爱好插件开发(阿里旺旺Android)、系统性能调优的朋友们骚扰我!; 105. info3=作者MSN:; 106. 107. try108. 109. this.f5.Show(); 110. 111. catch112. 113. this.f5=newForm2(关于-作者,String.Join(,info,0,info.Length); 114. this.f5.Show(); 115. 116. 117. 118. privatevoidParamsToolStripMenuItem_Click(objectsender,EventArgse) 119. 120. try121. 122. this.f6.Show(); 123. 124. catch125. 126. this.f6=newForm2(参数说明,newSystem.Uri(this.path+plugins+Global.appid+srcreadmeKingfishersManual.txt); 127. this.f6.Show(); 128. 129. 130. 131. 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 + srcdebugger.html, false); private void ExamplesToolStripMenuItem_Click(object sender, EventArgs e) try System.Diagnostics.Process.Start(explorer, this.path + plugins + Global.appid + srcexample);/+this.path catch(Exception ex) MessageBox.Show(请打开插件中的example目录.nn该目录的路径可能如下:n + this.path + plugins + Global.appid + srcexample); private void HideToolStripMenuItem_Click(object sender, EventArgs e) this.Hide(); private void ManualToolStripMenuItem_Click(object sender, EventArgs e) try this.f2.Show(); catch this.f2 = new Form2(使用说明, new System.Uri(this.path + plugins + Global.appid + srcreadmeKingfishersManual.html); this.f2.Show(); private void AboutJSHelperToolStripMenuItem_Click(object sender, EventArgs e) String info=new String7; info0 = Version:0.9.0; info1 = Release Date:2008-11-17; info2 = JSHelper是一款轻巧的Javascript调试工具,; info3 = 以旺旺插件形式发布在阿里软件平台,; info4 = 依赖于jzshmyt所写Kingfishers工具包。; info5 = 方便使用是我的唯一目的。; info6 = Author : CharlesCui; try this.f3.Show(); catch this.f3 = new Form2(关于-JSHelper, String.Join(, info, 0, info.Length); this.f3.Show(); private void JavascriptlogToolStripMenuItem_Click(object sender, EventArgs e) String info = new String5; info0 = Kingfishers是一个用javascript语言编写的,能够代替alert,在浏览器中连续输出客户端javascript脚本运行日志的工具。; info1 = 主要用于客户端脚本的分析和查错。; info2 = GoogleCode:/p/dewind/; info3 = Download:/files/Kingfishers-1.0.rar; info4 = Author : jzshmyt; try this.f4.Show(); catc

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论