FormSendMsg.cs
上传用户:lqb116
上传日期:2014-04-04
资源大小:2712k
文件大小:73k
源码类别:

P2P编程

开发平台:

C#

  1. #region using
  2. using System;
  3. using System.Drawing;
  4. using System.Collections;
  5. using System.ComponentModel;
  6. using System.Windows.Forms;
  7. #endregion
  8. namespace LanMsg
  9. {
  10. /// <summary>
  11. /// FormSendMsg 的摘要说明。
  12. /// </summary>
  13. public class FormSendMsg : DevComponents.DotNetBar.Office2007RibbonForm //System.Windows.Forms.Form  // 
  14. {
  15. #region 对像变量区
  16. private DevComponents.DotNetBar.RibbonControl ribbonControl1;
  17. private DevComponents.DotNetBar.RibbonTabItemGroup ribbonTabItemGroup1;
  18. private DevComponents.DotNetBar.ItemContainer itemContainer9;
  19. private DevComponents.DotNetBar.ButtonItem buttonItem14;
  20. private DevComponents.DotNetBar.QatCustomizeItem qatCustomizeItem1;
  21. private DevComponents.DotNetBar.LabelItem labelStatus;
  22. internal DevComponents.DotNetBar.LabelItem labelPosition;
  23. private DevComponents.DotNetBar.Bar bar1;
  24. private System.Windows.Forms.Panel panel2;
  25. private System.Windows.Forms.Panel panel5;
  26. private System.Windows.Forms.Panel panel6;
  27. private DevComponents.DotNetBar.PanelEx panelEx2;
  28. private System.Windows.Forms.Splitter splitter1;
  29. private System.Windows.Forms.Panel panel9;
  30. private System.Windows.Forms.Panel panel8;
  31. private DevComponents.DotNetBar.ButtonX butClose;
  32. private DevComponents.DotNetBar.ButtonX butSend;
  33. private DevComponents.DotNetBar.ButtonX butRecordshow;
  34. private DevComponents.DotNetBar.Bar bar2;
  35. private System.Windows.Forms.Panel panel10;
  36. private DevComponents.DotNetBar.Bar bar3;
  37. private DevComponents.DotNetBar.ButtonItem buttonItem2;
  38. private System.Windows.Forms.Panel panelSendFile;
  39. private DevComponents.DotNetBar.ButtonItem trtFontSet;
  40. private DevComponents.DotNetBar.ButtonItem trtFaceSet;
  41. private DevComponents.DotNetBar.ButtonItem butFontColor;
  42. private DevComponents.DotNetBar.ButtonItem buttonItem4;
  43. private System.ComponentModel.IContainer components;
  44. private DevComponents.DotNetBar.ButtonItem butSendPicture;
  45. private DevComponents.DotNetBar.ButtonItem butEnterSend;
  46. private DevComponents.DotNetBar.ButtonItem butEnterCtrlSend;
  47. private System.Windows.Forms.Timer timerCheckSendIsSuccess;
  48. private ClassFormMain FormMain =new ClassFormMain();
  49. private ClassUserInfo currUserInfo=null;
  50. private DevComponents.DotNetBar.BalloonTip balloonTip1;
  51. private DevComponents.DotNetBar.ButtonItem butOpenShared;
  52. private System.Windows.Forms.Panel panel11;
  53. private System.Windows.Forms.Panel panel12;
  54. private System.Windows.Forms.Panel panel13;
  55. public LanMsg.MyExtRichTextBox RTBRecord;
  56. private DevComponents.DotNetBar.ButtonItem butSendFile;
  57. private int OutTime=0;
  58. private System.Windows.Forms.Panel panelSend;
  59. private DevComponents.DotNetBar.PanelEx panelButSend;
  60. private DevComponents.DotNetBar.ButtonItem buttonItemFormIco;
  61. private DevComponents.DotNetBar.DotNetBarManager dotNetBarManager1;
  62. private DevComponents.DotNetBar.DockSite barLeftDockSite;
  63. private DevComponents.DotNetBar.DockSite barRightDockSite;
  64. private DevComponents.DotNetBar.DockSite barTopDockSite;
  65. private DevComponents.DotNetBar.DockSite barBottomDockSite;
  66. public LanMsg.MyExtRichTextBox RTBSend;
  67. private DevComponents.DotNetBar.ButtonItem butCapture;
  68. private System.Windows.Forms.Panel panelRightNotice;
  69. private System.Windows.Forms.Panel panelRiht;//发送消息秒记数器
  70. private ClassGifs SendGifs=new ClassGifs();
  71. private ClassGifs ArrivalGifs=new ClassGifs();
  72. private System.Windows.Forms.Panel panelAV;
  73. private System.Windows.Forms.Panel panelSendAndNotice;
  74. private System.Windows.Forms.Panel panel14;
  75. private System.Windows.Forms.Panel panel7;
  76. private System.Windows.Forms.Panel panel17;
  77. private System.Windows.Forms.Panel panel16;
  78. private System.Windows.Forms.Panel panel15;
  79. private DevComponents.DotNetBar.Bar bar4;
  80. private DevComponents.DotNetBar.TabControl tabCsendFile;
  81. private DevComponents.DotNetBar.ButtonItem buttonItemNotice;
  82. private DevComponents.DotNetBar.LabelItem labelItem1;
  83. private System.Windows.Forms.Panel panelAVchat;
  84. private LanMsg.MyAV myAV1;
  85. private DevComponents.DotNetBar.ButtonItem ButAVchat;
  86. private System.Windows.Forms.Label labelNotice;
  87.         
  88. private LanMsg.ClassTextMsg SendTextMsg=new ClassTextMsg();
  89. #region 当前用户自行添加的图片集合类ClassGifs
  90. private class ClassGifs: System.Collections.CollectionBase 
  91. {
  92. public ClassGifs()
  93. {
  94. //
  95. // TODO: 在此处添加构造函数逻辑
  96. //
  97. }
  98. public void add(LanMsg.MyPicture tempGif)
  99. {
  100. base.InnerList.Add(tempGif);
  101. }
  102. public void Romove(LanMsg.MyPicture tempGif)
  103. {
  104. base.InnerList.Remove (tempGif);
  105. }
  106. }
  107. #endregion
  108. public FormSendMsg()
  109. {
  110. //
  111. // Windows 窗体设计器支持所必需的
  112. //
  113. InitializeComponent();
  114. this.RTBRecord.LinkClicked  +=new LinkClickedEventHandler(RTBRecord_LinkClicked);
  115. this.RTBSend.LinkClicked +=new LinkClickedEventHandler(RTBRecord_LinkClicked);
  116. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  117. //
  118. }
  119. /// <summary>
  120. /// 清理所有正在使用的资源。
  121. /// </summary>
  122. protected override void Dispose( bool disposing)
  123. {
  124. FormMain.formMain.forms.Romove(this);
  125. if( disposing )
  126. {
  127. if(components != null)
  128. {
  129. components.Dispose();
  130. }
  131. }
  132. base.Dispose(disposing);
  133. }
  134. #endregion
  135. #region Windows 窗体设计器生成的代码
  136. /// <summary>
  137. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  138. /// 此方法的内容。
  139. /// </summary>
  140. private void InitializeComponent()
  141. {
  142. this.components = new System.ComponentModel.Container();
  143. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FormSendMsg));
  144. this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl();
  145. this.buttonItemFormIco = new DevComponents.DotNetBar.ButtonItem();
  146. this.buttonItem4 = new DevComponents.DotNetBar.ButtonItem();
  147. this.ribbonTabItemGroup1 = new DevComponents.DotNetBar.RibbonTabItemGroup();
  148. this.itemContainer9 = new DevComponents.DotNetBar.ItemContainer();
  149. this.buttonItem14 = new DevComponents.DotNetBar.ButtonItem();
  150. this.qatCustomizeItem1 = new DevComponents.DotNetBar.QatCustomizeItem();
  151. this.labelStatus = new DevComponents.DotNetBar.LabelItem();
  152. this.labelPosition = new DevComponents.DotNetBar.LabelItem();
  153. this.bar1 = new DevComponents.DotNetBar.Bar();
  154. this.panel2 = new System.Windows.Forms.Panel();
  155. this.panelRiht = new System.Windows.Forms.Panel();
  156. this.panelAV = new System.Windows.Forms.Panel();
  157. this.panel5 = new System.Windows.Forms.Panel();
  158. this.panelRightNotice = new System.Windows.Forms.Panel();
  159. this.panelAVchat = new System.Windows.Forms.Panel();
  160. this.myAV1 = new LanMsg.MyAV();
  161. this.panelSendAndNotice = new System.Windows.Forms.Panel();
  162. this.panel14 = new System.Windows.Forms.Panel();
  163. this.labelNotice = new System.Windows.Forms.Label();
  164. this.panel7 = new System.Windows.Forms.Panel();
  165. this.panel17 = new System.Windows.Forms.Panel();
  166. this.panel16 = new System.Windows.Forms.Panel();
  167. this.panel15 = new System.Windows.Forms.Panel();
  168. this.bar4 = new DevComponents.DotNetBar.Bar();
  169. this.buttonItemNotice = new DevComponents.DotNetBar.ButtonItem();
  170. this.labelItem1 = new DevComponents.DotNetBar.LabelItem();
  171. this.tabCsendFile = new DevComponents.DotNetBar.TabControl();
  172. this.panel6 = new System.Windows.Forms.Panel();
  173. this.panelSend = new System.Windows.Forms.Panel();
  174. this.RTBSend = new LanMsg.MyExtRichTextBox();
  175. this.panel12 = new System.Windows.Forms.Panel();
  176. this.panelEx2 = new DevComponents.DotNetBar.PanelEx();
  177. this.bar2 = new DevComponents.DotNetBar.Bar();
  178. this.trtFontSet = new DevComponents.DotNetBar.ButtonItem();
  179. this.butFontColor = new DevComponents.DotNetBar.ButtonItem();
  180. this.trtFaceSet = new DevComponents.DotNetBar.ButtonItem();
  181. this.butSendPicture = new DevComponents.DotNetBar.ButtonItem();
  182. this.butCapture = new DevComponents.DotNetBar.ButtonItem();
  183. this.butSendFile = new DevComponents.DotNetBar.ButtonItem();
  184. this.panelButSend = new DevComponents.DotNetBar.PanelEx();
  185. this.panel8 = new System.Windows.Forms.Panel();
  186. this.butRecordshow = new DevComponents.DotNetBar.ButtonX();
  187. this.panel9 = new System.Windows.Forms.Panel();
  188. this.butSend = new DevComponents.DotNetBar.ButtonX();
  189. this.butEnterSend = new DevComponents.DotNetBar.ButtonItem();
  190. this.butEnterCtrlSend = new DevComponents.DotNetBar.ButtonItem();
  191. this.butClose = new DevComponents.DotNetBar.ButtonX();
  192. this.splitter1 = new System.Windows.Forms.Splitter();
  193. this.panel10 = new System.Windows.Forms.Panel();
  194. this.bar3 = new DevComponents.DotNetBar.Bar();
  195. this.buttonItem2 = new DevComponents.DotNetBar.ButtonItem();
  196. this.butOpenShared = new DevComponents.DotNetBar.ButtonItem();
  197. this.ButAVchat = new DevComponents.DotNetBar.ButtonItem();
  198. this.panelSendFile = new System.Windows.Forms.Panel();
  199. this.panel13 = new System.Windows.Forms.Panel();
  200. this.timerCheckSendIsSuccess = new System.Windows.Forms.Timer(this.components);
  201. this.balloonTip1 = new DevComponents.DotNetBar.BalloonTip();
  202. this.panel11 = new System.Windows.Forms.Panel();
  203. this.RTBRecord = new LanMsg.MyExtRichTextBox();
  204. this.dotNetBarManager1 = new DevComponents.DotNetBar.DotNetBarManager(this.components);
  205. this.barBottomDockSite = new DevComponents.DotNetBar.DockSite();
  206. this.barLeftDockSite = new DevComponents.DotNetBar.DockSite();
  207. this.barRightDockSite = new DevComponents.DotNetBar.DockSite();
  208. this.barTopDockSite = new DevComponents.DotNetBar.DockSite();
  209. ((System.ComponentModel.ISupportInitialize)(this.bar1)).BeginInit();
  210. this.panelRightNotice.SuspendLayout();
  211. this.panelAVchat.SuspendLayout();
  212. this.panelSendAndNotice.SuspendLayout();
  213. this.panel14.SuspendLayout();
  214. ((System.ComponentModel.ISupportInitialize)(this.bar4)).BeginInit();
  215. ((System.ComponentModel.ISupportInitialize)(this.tabCsendFile)).BeginInit();
  216. this.panelSend.SuspendLayout();
  217. this.panelEx2.SuspendLayout();
  218. ((System.ComponentModel.ISupportInitialize)(this.bar2)).BeginInit();
  219. this.panelButSend.SuspendLayout();
  220. this.panel8.SuspendLayout();
  221. this.panel9.SuspendLayout();
  222. this.panel10.SuspendLayout();
  223. ((System.ComponentModel.ISupportInitialize)(this.bar3)).BeginInit();
  224. this.panelSendFile.SuspendLayout();
  225. this.SuspendLayout();
  226. // 
  227. // ribbonControl1
  228. // 
  229. this.ribbonControl1.BackColor = System.Drawing.SystemColors.Control;
  230. this.ribbonControl1.CaptionVisible = true;
  231. this.ribbonControl1.Dock = System.Windows.Forms.DockStyle.Top;
  232. this.ribbonControl1.DockPadding.Bottom = 2;
  233. this.ribbonControl1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  234. this.ribbonControl1.KeyTipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  235. this.ribbonControl1.Location = new System.Drawing.Point(2, 2);
  236. this.ribbonControl1.MdiSystemItemVisible = false;
  237. this.ribbonControl1.Name = "ribbonControl1";
  238. this.ribbonControl1.QuickToolbarItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
  239.   this.buttonItemFormIco});
  240. this.ribbonControl1.RibbonStripIndent = 55;
  241. this.ribbonControl1.Size = new System.Drawing.Size(526, 30);
  242. this.ribbonControl1.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
  243. this.ribbonControl1.TabGroupHeight = 15;
  244. this.ribbonControl1.TabIndex = 42;
  245. // 
  246. // buttonItemFormIco
  247. // 
  248. this.buttonItemFormIco.Icon = ((System.Drawing.Icon)(resources.GetObject("buttonItemFormIco.Icon")));
  249. this.buttonItemFormIco.Name = "buttonItemFormIco";
  250. this.buttonItemFormIco.Text = "buttonItem5";
  251. // 
  252. // buttonItem4
  253. // 
  254. this.buttonItem4.Name = "buttonItem4";
  255. this.buttonItem4.Text = "保存对话";
  256. // 
  257. // ribbonTabItemGroup1
  258. // 
  259. this.ribbonTabItemGroup1.Color = DevComponents.DotNetBar.eRibbonTabGroupColor.Orange;
  260. this.ribbonTabItemGroup1.GroupTitle = "Tab Group";
  261. // 
  262. // ribbonTabItemGroup1.Style
  263. // 
  264. this.ribbonTabItemGroup1.Style.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(240)), ((System.Byte)(158)), ((System.Byte)(159)));
  265. this.ribbonTabItemGroup1.Style.BackColor2 = System.Drawing.Color.FromArgb(((System.Byte)(249)), ((System.Byte)(225)), ((System.Byte)(226)));
  266. this.ribbonTabItemGroup1.Style.BackColorGradientAngle = 90;
  267. this.ribbonTabItemGroup1.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
  268. this.ribbonTabItemGroup1.Style.BorderBottomWidth = 1;
  269. this.ribbonTabItemGroup1.Style.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(154)), ((System.Byte)(58)), ((System.Byte)(59)));
  270. this.ribbonTabItemGroup1.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
  271. this.ribbonTabItemGroup1.Style.BorderLeftWidth = 1;
  272. this.ribbonTabItemGroup1.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
  273. this.ribbonTabItemGroup1.Style.BorderRightWidth = 1;
  274. this.ribbonTabItemGroup1.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
  275. this.ribbonTabItemGroup1.Style.BorderTopWidth = 1;
  276. this.ribbonTabItemGroup1.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
  277. this.ribbonTabItemGroup1.Style.TextColor = System.Drawing.Color.Black;
  278. this.ribbonTabItemGroup1.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
  279. // 
  280. // itemContainer9
  281. // 
  282. this.itemContainer9.BeginGroup = true;
  283. this.itemContainer9.MinimumSize = new System.Drawing.Size(0, 0);
  284. this.itemContainer9.Name = "itemContainer9";
  285. // 
  286. // buttonItem14
  287. // 
  288. this.buttonItem14.Image = ((System.Drawing.Image)(resources.GetObject("buttonItem14.Image")));
  289. this.buttonItem14.Name = "buttonItem14";
  290. this.buttonItem14.OptionGroup = "statusGroup";
  291. this.buttonItem14.Text = "Web Layout";
  292. this.buttonItem14.Tooltip = "Web Layout";
  293. // 
  294. // qatCustomizeItem1
  295. // 
  296. this.qatCustomizeItem1.Name = "qatCustomizeItem1";
  297. // 
  298. // labelStatus
  299. // 
  300. this.labelStatus.BorderType = DevComponents.DotNetBar.eBorderType.None;
  301. this.labelStatus.Name = "labelStatus";
  302. this.labelStatus.PaddingLeft = 2;
  303. this.labelStatus.PaddingRight = 2;
  304. this.labelStatus.SingleLineColor = System.Drawing.Color.FromArgb(((System.Byte)(59)), ((System.Byte)(97)), ((System.Byte)(156)));
  305. this.labelStatus.Stretch = true;
  306. // 
  307. // labelPosition
  308. // 
  309. this.labelPosition.BorderType = DevComponents.DotNetBar.eBorderType.None;
  310. this.labelPosition.Name = "labelPosition";
  311. this.labelPosition.PaddingLeft = 2;
  312. this.labelPosition.PaddingRight = 2;
  313. this.labelPosition.SingleLineColor = System.Drawing.Color.FromArgb(((System.Byte)(59)), ((System.Byte)(97)), ((System.Byte)(156)));
  314. this.labelPosition.Width = 100;
  315. // 
  316. // bar1
  317. // 
  318. this.bar1.AccessibleDescription = "DotNetBar Bar (bar1)";
  319. this.bar1.AccessibleName = "DotNetBar Bar";
  320. this.bar1.AccessibleRole = System.Windows.Forms.AccessibleRole.StatusBar;
  321. this.bar1.AntiAlias = true;
  322. this.bar1.Dock = System.Windows.Forms.DockStyle.Bottom;
  323. this.bar1.GrabHandleStyle = DevComponents.DotNetBar.eGrabHandleStyle.ResizeHandle;
  324. this.bar1.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
  325. this.labelStatus,
  326. this.labelPosition});
  327. this.bar1.ItemSpacing = 2;
  328. this.bar1.Location = new System.Drawing.Point(2, 421);
  329. this.bar1.Name = "bar1";
  330. this.bar1.Size = new System.Drawing.Size(526, 17);
  331. this.bar1.Stretch = true;
  332. this.bar1.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
  333. this.bar1.TabIndex = 14;
  334. this.bar1.TabStop = false;
  335. this.bar1.Text = "barStatus";
  336. // 
  337. // panel2
  338. // 
  339. this.panel2.Dock = System.Windows.Forms.DockStyle.Right;
  340. this.panel2.Location = new System.Drawing.Point(522, 32);
  341. this.panel2.Name = "panel2";
  342. this.panel2.Size = new System.Drawing.Size(6, 389);
  343. this.panel2.TabIndex = 19;
  344. // 
  345. // panelRiht
  346. // 
  347. this.panelRiht.Dock = System.Windows.Forms.DockStyle.Right;
  348. this.panelRiht.Location = new System.Drawing.Point(376, 32);
  349. this.panelRiht.Name = "panelRiht";
  350. this.panelRiht.Size = new System.Drawing.Size(6, 389);
  351. this.panelRiht.TabIndex = 21;
  352. // 
  353. // panelAV
  354. // 
  355. this.panelAV.Dock = System.Windows.Forms.DockStyle.Left;
  356. this.panelAV.Location = new System.Drawing.Point(2, 32);
  357. this.panelAV.Name = "panelAV";
  358. this.panelAV.Size = new System.Drawing.Size(4, 389);
  359. this.panelAV.TabIndex = 22;
  360. // 
  361. // panel5
  362. // 
  363. this.panel5.Dock = System.Windows.Forms.DockStyle.Top;
  364. this.panel5.Location = new System.Drawing.Point(6, 32);
  365. this.panel5.Name = "panel5";
  366. this.panel5.Size = new System.Drawing.Size(370, 8);
  367. this.panel5.TabIndex = 23;
  368. // 
  369. // panelRightNotice
  370. // 
  371. this.panelRightNotice.BackColor = System.Drawing.Color.Cyan;
  372. this.panelRightNotice.Controls.Add(this.panelAVchat);
  373. this.panelRightNotice.Controls.Add(this.panelSendAndNotice);
  374. this.panelRightNotice.Controls.Add(this.panel6);
  375. this.panelRightNotice.Dock = System.Windows.Forms.DockStyle.Right;
  376. this.panelRightNotice.Location = new System.Drawing.Point(382, 32);
  377. this.panelRightNotice.Name = "panelRightNotice";
  378. this.panelRightNotice.Size = new System.Drawing.Size(140, 389);
  379. this.panelRightNotice.TabIndex = 20;
  380. // 
  381. // panelAVchat
  382. // 
  383. this.panelAVchat.Controls.Add(this.myAV1);
  384. this.panelAVchat.Dock = System.Windows.Forms.DockStyle.Fill;
  385. this.panelAVchat.Location = new System.Drawing.Point(0, 8);
  386. this.panelAVchat.Name = "panelAVchat";
  387. this.panelAVchat.Size = new System.Drawing.Size(140, 381);
  388. this.panelAVchat.TabIndex = 29;
  389. this.panelAVchat.Visible = false;
  390. // 
  391. // myAV1
  392. // 
  393. this.myAV1.BackColor = System.Drawing.Color.Cyan;
  394. this.myAV1.Dock = System.Windows.Forms.DockStyle.Fill;
  395. this.myAV1.Location = new System.Drawing.Point(0, 0);
  396. this.myAV1.Name = "myAV1";
  397. this.myAV1.Size = new System.Drawing.Size(140, 381);
  398. this.myAV1.TabIndex = 0;
  399. this.myAV1.AVReceve += new LanMsg.MyAV.AVReceveEventHandler(this.myAV1_AVReceve);
  400. this.myAV1.AVCancel += new LanMsg.MyAV.AVCancelEventHandler(this.myAV1_AVCancel);
  401. // 
  402. // panelSendAndNotice
  403. // 
  404. this.panelSendAndNotice.Controls.Add(this.panel14);
  405. this.panelSendAndNotice.Controls.Add(this.tabCsendFile);
  406. this.panelSendAndNotice.Dock = System.Windows.Forms.DockStyle.Fill;
  407. this.panelSendAndNotice.Location = new System.Drawing.Point(0, 8);
  408. this.panelSendAndNotice.Name = "panelSendAndNotice";
  409. this.panelSendAndNotice.Size = new System.Drawing.Size(140, 381);
  410. this.panelSendAndNotice.TabIndex = 28;
  411. // 
  412. // panel14
  413. // 
  414. this.panel14.Controls.Add(this.labelNotice);
  415. this.panel14.Controls.Add(this.panel7);
  416. this.panel14.Controls.Add(this.panel17);
  417. this.panel14.Controls.Add(this.panel16);
  418. this.panel14.Controls.Add(this.panel15);
  419. this.panel14.Controls.Add(this.bar4);
  420. this.panel14.Dock = System.Windows.Forms.DockStyle.Fill;
  421. this.panel14.Location = new System.Drawing.Point(0, 235);
  422. this.panel14.Name = "panel14";
  423. this.panel14.Size = new System.Drawing.Size(140, 146);
  424. this.panel14.TabIndex = 27;
  425. // 
  426. // labelNotice
  427. // 
  428. this.labelNotice.Dock = System.Windows.Forms.DockStyle.Fill;
  429. this.labelNotice.ForeColor = System.Drawing.Color.DarkSlateGray;
  430. this.labelNotice.Location = new System.Drawing.Point(4, 31);
  431. this.labelNotice.Name = "labelNotice";
  432. this.labelNotice.Size = new System.Drawing.Size(132, 109);
  433. this.labelNotice.TabIndex = 47;
  434. this.labelNotice.Text = "    LanMsg当前版本支持音视频对话,支持文件传输(可用于传输保密文件),支持屏幕截图,支持GIF动画表情等功能。";
  435. // 
  436. // panel7
  437. // 
  438. this.panel7.Dock = System.Windows.Forms.DockStyle.Bottom;
  439. this.panel7.Location = new System.Drawing.Point(4, 140);
  440. this.panel7.Name = "panel7";
  441. this.panel7.Size = new System.Drawing.Size(132, 6);
  442. this.panel7.TabIndex = 45;
  443. // 
  444. // panel17
  445. // 
  446. this.panel17.Dock = System.Windows.Forms.DockStyle.Right;
  447. this.panel17.Location = new System.Drawing.Point(136, 31);
  448. this.panel17.Name = "panel17";
  449. this.panel17.Size = new System.Drawing.Size(4, 115);
  450. this.panel17.TabIndex = 44;
  451. // 
  452. // panel16
  453. // 
  454. this.panel16.Dock = System.Windows.Forms.DockStyle.Left;
  455. this.panel16.Location = new System.Drawing.Point(0, 31);
  456. this.panel16.Name = "panel16";
  457. this.panel16.Size = new System.Drawing.Size(4, 115);
  458. this.panel16.TabIndex = 43;
  459. // 
  460. // panel15
  461. // 
  462. this.panel15.Dock = System.Windows.Forms.DockStyle.Top;
  463. this.panel15.Location = new System.Drawing.Point(0, 25);
  464. this.panel15.Name = "panel15";
  465. this.panel15.Size = new System.Drawing.Size(140, 6);
  466. this.panel15.TabIndex = 42;
  467. // 
  468. // bar4
  469. // 
  470. this.bar4.Dock = System.Windows.Forms.DockStyle.Top;
  471. this.bar4.DockSide = DevComponents.DotNetBar.eDockSide.Document;
  472. this.bar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
  473. this.buttonItemNotice,
  474. this.labelItem1});
  475. this.bar4.Location = new System.Drawing.Point(0, 0);
  476. this.bar4.Name = "bar4";
  477. this.bar4.Size = new System.Drawing.Size(140, 25);
  478. this.bar4.Stretch = true;
  479. this.bar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
  480. this.bar4.TabIndex = 41;
  481. this.bar4.TabStop = false;
  482. this.bar4.Text = "bar4";
  483. // 
  484. // buttonItemNotice
  485. // 
  486. this.buttonItemNotice.Icon = ((System.Drawing.Icon)(resources.GetObject("buttonItemNotice.Icon")));
  487. this.buttonItemNotice.Name = "buttonItemNotice";
  488. // 
  489. // labelItem1
  490. // 
  491. this.labelItem1.BorderType = DevComponents.DotNetBar.eBorderType.None;
  492. this.labelItem1.Name = "labelItem1";
  493. this.labelItem1.Text = "公告";
  494. // 
  495. // tabCsendFile
  496. // 
  497. this.tabCsendFile.BackColor = System.Drawing.Color.Cyan;
  498. this.tabCsendFile.CanReorderTabs = true;
  499. this.tabCsendFile.ColorScheme.TabItemBorderDark = System.Drawing.Color.Cyan;
  500. this.tabCsendFile.ColorScheme.TabItemHotBackground2 = System.Drawing.Color.Cyan;
  501. this.tabCsendFile.ColorScheme.TabItemSelectedBackground2 = System.Drawing.Color.Cyan;
  502. this.tabCsendFile.ColorScheme.TabItemSelectedBorder = System.Drawing.Color.DarkGray;
  503. this.tabCsendFile.ColorScheme.TabPanelBorder = System.Drawing.SystemColors.Control;
  504. this.tabCsendFile.Dock = System.Windows.Forms.DockStyle.Top;
  505. this.tabCsendFile.Location = new System.Drawing.Point(0, 0);
  506. this.tabCsendFile.Name = "tabCsendFile";
  507. this.tabCsendFile.SelectedTabFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
  508. this.tabCsendFile.SelectedTabIndex = -1;
  509. this.tabCsendFile.Size = new System.Drawing.Size(140, 235);
  510. this.tabCsendFile.TabIndex = 25;
  511. this.tabCsendFile.TabLayoutType = DevComponents.DotNetBar.eTabLayoutType.FixedWithNavigationBox;
  512. this.tabCsendFile.Text = "tabControl1";
  513. this.tabCsendFile.Visible = false;
  514. this.tabCsendFile.TabRemoved += new System.EventHandler(this.tabCsendFile_TabRemoved);
  515. // 
  516. // panel6
  517. // 
  518. this.panel6.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(175)), ((System.Byte)(201)), ((System.Byte)(235)));
  519. this.panel6.Dock = System.Windows.Forms.DockStyle.Top;
  520. this.panel6.Location = new System.Drawing.Point(0, 0);
  521. this.panel6.Name = "panel6";
  522. this.panel6.Size = new System.Drawing.Size(140, 8);
  523. this.panel6.TabIndex = 24;
  524. // 
  525. // panelSend
  526. // 
  527. this.panelSend.Controls.Add(this.RTBSend);
  528. this.panelSend.Controls.Add(this.panel12);
  529. this.panelSend.Controls.Add(this.panelEx2);
  530. this.panelSend.Controls.Add(this.panelButSend);
  531. this.panelSend.Dock = System.Windows.Forms.DockStyle.Bottom;
  532. this.panelSend.Location = new System.Drawing.Point(6, 277);
  533. this.panelSend.Name = "panelSend";
  534. this.panelSend.Size = new System.Drawing.Size(370, 144);
  535. this.panelSend.TabIndex = 37;
  536. // 
  537. // RTBSend
  538. // 
  539. this.RTBSend.AllowDrop = true;
  540. this.RTBSend.AutoWordSelection = true;
  541. this.RTBSend.BorderStyle = System.Windows.Forms.BorderStyle.None;
  542. this.dotNetBarManager1.SetContextMenuEx(this.RTBSend, "ButtonItem1");
  543. this.RTBSend.Dock = System.Windows.Forms.DockStyle.Fill;
  544. this.RTBSend.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
  545. this.RTBSend.HiglightColor = LanMsg.RtfColor.White;
  546. this.RTBSend.Location = new System.Drawing.Point(4, 24);
  547. this.RTBSend.MaxLength = 1000;
  548. this.RTBSend.Name = "RTBSend";
  549. this.RTBSend.Size = new System.Drawing.Size(366, 88);
  550. this.RTBSend.TabIndex = 50;
  551. this.RTBSend.Text = "";
  552. this.RTBSend.TextColor = LanMsg.RtfColor.Black;
  553. this.RTBSend.KeyDown += new System.Windows.Forms.KeyEventHandler(this.RTBSend_KeyDown);
  554. this.RTBSend.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.RTBRecord_LinkClicked);
  555. // 
  556. // panel12
  557. // 
  558. this.panel12.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
  559. this.panel12.Dock = System.Windows.Forms.DockStyle.Left;
  560. this.panel12.Location = new System.Drawing.Point(0, 24);
  561. this.panel12.Name = "panel12";
  562. this.panel12.Size = new System.Drawing.Size(4, 88);
  563. this.panel12.TabIndex = 37;
  564. // 
  565. // panelEx2
  566. // 
  567. this.panelEx2.CanvasColor = System.Drawing.SystemColors.Control;
  568. this.panelEx2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
  569. this.panelEx2.Controls.Add(this.bar2);
  570. this.panelEx2.Dock = System.Windows.Forms.DockStyle.Top;
  571. this.panelEx2.Location = new System.Drawing.Point(0, 0);
  572. this.panelEx2.Name = "panelEx2";
  573. this.panelEx2.Size = new System.Drawing.Size(370, 24);
  574. this.panelEx2.Style.Alignment = System.Drawing.StringAlignment.Center;
  575. this.panelEx2.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
  576. this.panelEx2.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2;
  577. this.panelEx2.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
  578. this.panelEx2.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
  579. this.panelEx2.Style.GradientAngle = 90;
  580. this.panelEx2.TabIndex = 36;
  581. // 
  582. // bar2
  583. // 
  584. this.bar2.Dock = System.Windows.Forms.DockStyle.Fill;
  585. this.bar2.DockSide = DevComponents.DotNetBar.eDockSide.Top;
  586. this.bar2.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
  587. this.trtFontSet,
  588. this.butFontColor,
  589. this.trtFaceSet,
  590. this.butSendPicture,
  591. this.butCapture,
  592. this.butSendFile});
  593. this.bar2.Location = new System.Drawing.Point(0, 0);
  594. this.bar2.Name = "bar2";
  595. this.bar2.Size = new System.Drawing.Size(370, 24);
  596. this.bar2.Stretch = true;
  597. this.bar2.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
  598. this.bar2.TabIndex = 0;
  599. this.bar2.TabStop = false;
  600. this.bar2.Text = "bar2";
  601. // 
  602. // trtFontSet
  603. // 
  604. this.trtFontSet.Icon = ((System.Drawing.Icon)(resources.GetObject("trtFontSet.Icon")));
  605. this.trtFontSet.Name = "trtFontSet";
  606. this.trtFontSet.Tooltip = "设置字体";
  607. this.trtFontSet.Click += new System.EventHandler(this.trtFontSet_Click);
  608. // 
  609. // butFontColor
  610. // 
  611. this.butFontColor.Icon = ((System.Drawing.Icon)(resources.GetObject("butFontColor.Icon")));
  612. this.butFontColor.Name = "butFontColor";
  613. this.butFontColor.Tooltip = "设置字体颜色";
  614. this.butFontColor.Click += new System.EventHandler(this.butFontColor_Click);
  615. // 
  616. // trtFaceSet
  617. // 
  618. this.trtFaceSet.Icon = ((System.Drawing.Icon)(resources.GetObject("trtFaceSet.Icon")));
  619. this.trtFaceSet.Name = "trtFaceSet";
  620. this.trtFaceSet.Text = "buttonItem3";
  621. this.trtFaceSet.Tooltip = "发送表情";
  622. // 
  623. // butSendPicture
  624. // 
  625. this.butSendPicture.Icon = ((System.Drawing.Icon)(resources.GetObject("butSendPicture.Icon")));
  626. this.butSendPicture.Name = "butSendPicture";
  627. this.butSendPicture.Text = "buttonItem3";
  628. this.butSendPicture.Tooltip = "发送图片";
  629. this.butSendPicture.Click += new System.EventHandler(this.butSendPicture_Click);
  630. // 
  631. // butCapture
  632. // 
  633. this.butCapture.Image = ((System.Drawing.Image)(resources.GetObject("butCapture.Image")));
  634. this.butCapture.Name = "butCapture";
  635. this.butCapture.Text = "butCapture";
  636. this.butCapture.Tooltip = "发送“屏幕截图”";
  637. this.butCapture.Click += new System.EventHandler(this.butCapture_Click);
  638. // 
  639. // butSendFile
  640. // 
  641. this.butSendFile.Icon = ((System.Drawing.Icon)(resources.GetObject("butSendFile.Icon")));
  642. this.butSendFile.Name = "butSendFile";
  643. this.butSendFile.Text = "发送文件";
  644. this.butSendFile.Tooltip = "发送文件";
  645. this.butSendFile.Click += new System.EventHandler(this.butSendFile_Click);
  646. // 
  647. // panelButSend
  648. // 
  649. this.panelButSend.CanvasColor = System.Drawing.SystemColors.Control;
  650. this.panelButSend.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
  651. this.panelButSend.Controls.Add(this.panel8);
  652. this.panelButSend.Controls.Add(this.panel9);
  653. this.panelButSend.Dock = System.Windows.Forms.DockStyle.Bottom;
  654. this.panelButSend.Location = new System.Drawing.Point(0, 112);
  655. this.panelButSend.Name = "panelButSend";
  656. this.panelButSend.Size = new System.Drawing.Size(370, 32);
  657. this.panelButSend.Style.Alignment = System.Drawing.StringAlignment.Center;
  658. this.panelButSend.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
  659. this.panelButSend.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2;
  660. this.panelButSend.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
  661. this.panelButSend.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
  662. this.panelButSend.Style.GradientAngle = 90;
  663. this.panelButSend.TabIndex = 34;
  664. // 
  665. // panel8
  666. // 
  667. this.panel8.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(175)), ((System.Byte)(201)), ((System.Byte)(235)));
  668. this.panel8.Controls.Add(this.butRecordshow);
  669. this.panel8.Dock = System.Windows.Forms.DockStyle.Fill;
  670. this.panel8.Location = new System.Drawing.Point(0, 0);
  671. this.panel8.Name = "panel8";
  672. this.panel8.Size = new System.Drawing.Size(218, 32);
  673. this.panel8.TabIndex = 2;
  674. // 
  675. // butRecordshow
  676. // 
  677. this.butRecordshow.ColorScheme.DockSiteBackColorGradientAngle = 0;
  678. this.butRecordshow.Location = new System.Drawing.Point(1, 5);
  679. this.butRecordshow.Name = "butRecordshow";
  680. this.butRecordshow.Size = new System.Drawing.Size(80, 24);
  681. this.butRecordshow.TabIndex = 1;
  682. this.butRecordshow.Text = "对话记录(&H)";
  683. this.butRecordshow.Click += new System.EventHandler(this.butRecordshow_Click);
  684. // 
  685. // panel9
  686. // 
  687. this.panel9.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(175)), ((System.Byte)(201)), ((System.Byte)(235)));
  688. this.panel9.Controls.Add(this.butSend);
  689. this.panel9.Controls.Add(this.butClose);
  690. this.panel9.Dock = System.Windows.Forms.DockStyle.Right;
  691. this.panel9.Location = new System.Drawing.Point(218, 0);
  692. this.panel9.Name = "panel9";
  693. this.panel9.Size = new System.Drawing.Size(152, 32);
  694. this.panel9.TabIndex = 1;
  695. // 
  696. // butSend
  697. // 
  698. this.butSend.ColorScheme.DockSiteBackColorGradientAngle = 0;
  699. this.butSend.Location = new System.Drawing.Point(87, 4);
  700. this.butSend.Name = "butSend";
  701. this.butSend.Size = new System.Drawing.Size(64, 24);
  702. this.butSend.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
  703.   this.butEnterSend,
  704.   this.butEnterCtrlSend});
  705. this.butSend.TabIndex = 2;
  706. this.butSend.Text = "发送(&S)";
  707. this.butSend.Click += new System.EventHandler(this.butSend_Click);
  708. // 
  709. // butEnterSend
  710. // 
  711. this.butEnterSend.Checked = true;
  712. this.butEnterSend.Name = "butEnterSend";
  713. this.butEnterSend.Text = "按Enter键发送消息";
  714. this.butEnterSend.Click += new System.EventHandler(this.butEnterSend_Click);
  715. // 
  716. // butEnterCtrlSend
  717. // 
  718. this.butEnterCtrlSend.Name = "butEnterCtrlSend";
  719. this.butEnterCtrlSend.Text = "按Ctrl + Enter 键发送消息";
  720. this.butEnterCtrlSend.Click += new System.EventHandler(this.butEnterCtrlSend_Click);
  721. // 
  722. // butClose
  723. // 
  724. this.butClose.ColorScheme.DockSiteBackColorGradientAngle = 0;
  725. this.butClose.Location = new System.Drawing.Point(17, 4);
  726. this.butClose.Name = "butClose";
  727. this.butClose.Size = new System.Drawing.Size(64, 24);
  728. this.butClose.TabIndex = 1;
  729. this.butClose.Text = "关闭(&C)";
  730. this.butClose.Click += new System.EventHandler(this.butClose_Click);
  731. // 
  732. // splitter1
  733. // 
  734. this.splitter1.Dock = System.Windows.Forms.DockStyle.Bottom;
  735. this.splitter1.Location = new System.Drawing.Point(6, 276);
  736. this.splitter1.MinExtra = 100;
  737. this.splitter1.Name = "splitter1";
  738. this.splitter1.Size = new System.Drawing.Size(370, 1);
  739. this.splitter1.TabIndex = 38;
  740. this.splitter1.TabStop = false;
  741. // 
  742. // panel10
  743. // 
  744. this.panel10.Controls.Add(this.bar3);
  745. this.panel10.Dock = System.Windows.Forms.DockStyle.Top;
  746. this.panel10.Location = new System.Drawing.Point(6, 40);
  747. this.panel10.Name = "panel10";
  748. this.panel10.Size = new System.Drawing.Size(370, 24);
  749. this.panel10.TabIndex = 39;
  750. // 
  751. // bar3
  752. // 
  753. this.bar3.Dock = System.Windows.Forms.DockStyle.Fill;
  754. this.bar3.DockSide = DevComponents.DotNetBar.eDockSide.Top;
  755. this.bar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
  756. this.buttonItem2,
  757. this.butOpenShared,
  758. this.ButAVchat});
  759. this.bar3.Location = new System.Drawing.Point(0, 0);
  760. this.bar3.Name = "bar3";
  761. this.bar3.Size = new System.Drawing.Size(370, 24);
  762. this.bar3.Stretch = true;
  763. this.bar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
  764. this.bar3.TabIndex = 40;
  765. this.bar3.TabStop = false;
  766. this.bar3.Text = "bar3";
  767. // 
  768. // buttonItem2
  769. // 
  770. this.buttonItem2.Name = "buttonItem2";
  771. // 
  772. // butOpenShared
  773. // 
  774. this.butOpenShared.FontUnderline = true;
  775. this.butOpenShared.Name = "butOpenShared";
  776. this.butOpenShared.Text = "打开共享";
  777. this.butOpenShared.Visible = false;
  778. this.butOpenShared.Click += new System.EventHandler(this.butOpenShared_Click);
  779. // 
  780. // ButAVchat
  781. // 
  782. this.ButAVchat.Name = "ButAVchat";
  783. this.ButAVchat.Text = "视频对话";
  784. this.ButAVchat.Click += new System.EventHandler(this.AVchat_Click);
  785. // 
  786. // panelSendFile
  787. // 
  788. this.panelSendFile.Controls.Add(this.panel13);
  789. this.panelSendFile.Dock = System.Windows.Forms.DockStyle.Bottom;
  790. this.panelSendFile.Location = new System.Drawing.Point(6, 252);
  791. this.panelSendFile.Name = "panelSendFile";
  792. this.panelSendFile.Size = new System.Drawing.Size(370, 24);
  793. this.panelSendFile.TabIndex = 40;
  794. this.panelSendFile.Visible = false;
  795. // 
  796. // panel13
  797. // 
  798. this.panel13.BackColor = System.Drawing.Color.Transparent;
  799. this.panel13.Dock = System.Windows.Forms.DockStyle.Fill;
  800. this.panel13.Location = new System.Drawing.Point(0, 0);
  801. this.panel13.Name = "panel13";
  802. this.panel13.Size = new System.Drawing.Size(370, 24);
  803. this.panel13.TabIndex = 33;
  804. // 
  805. // timerCheckSendIsSuccess
  806. // 
  807. this.timerCheckSendIsSuccess.Tick += new System.EventHandler(this.timerCheckSendIsSuccess_Tick);
  808. // 
  809. // balloonTip1
  810. // 
  811. this.balloonTip1.AlertAnimation = DevComponents.DotNetBar.eAlertAnimation.LeftToRight;
  812. this.balloonTip1.AutoCloseTimeOut = 3;
  813. this.balloonTip1.DefaultBalloonWidth = 400;
  814. this.balloonTip1.Enabled = false;
  815. // 
  816. // panel11
  817. // 
  818. this.panel11.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
  819. this.panel11.Dock = System.Windows.Forms.DockStyle.Left;
  820. this.panel11.Location = new System.Drawing.Point(6, 64);
  821. this.panel11.Name = "panel11";
  822. this.panel11.Size = new System.Drawing.Size(4, 188);
  823. this.panel11.TabIndex = 43;
  824. // 
  825. // RTBRecord
  826. // 
  827. this.RTBRecord.BorderStyle = System.Windows.Forms.BorderStyle.None;
  828. this.dotNetBarManager1.SetContextMenuEx(this.RTBRecord, "ButtonItem1");
  829. this.RTBRecord.Dock = System.Windows.Forms.DockStyle.Fill;
  830. this.RTBRecord.HiglightColor = LanMsg.RtfColor.White;
  831. this.RTBRecord.Location = new System.Drawing.Point(10, 64);
  832. this.RTBRecord.Name = "RTBRecord";
  833. this.RTBRecord.ReadOnly = true;
  834. this.RTBRecord.Size = new System.Drawing.Size(366, 188);
  835. this.RTBRecord.TabIndex = 50;
  836. this.RTBRecord.Text = "";
  837. this.RTBRecord.TextColor = LanMsg.RtfColor.Black;
  838. this.RTBRecord.TextChanged += new System.EventHandler(this.RTBRecord_TextChanged);
  839. this.RTBRecord.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.RTBRecord_LinkClicked);
  840. // 
  841. // dotNetBarManager1
  842. // 
  843. this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.F1);
  844. this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlC);
  845. this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlA);
  846. this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlV);
  847. this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlX);
  848. this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlZ);
  849. this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlY);
  850. this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.Del);
  851. this.dotNetBarManager1.AutoDispatchShortcuts.Add(DevComponents.DotNetBar.eShortcut.Ins);
  852. this.dotNetBarManager1.BottomDockSite = this.barBottomDockSite;
  853. this.dotNetBarManager1.DefinitionName = "FormSendMsg.dotNetBarManager1.xml";
  854. this.dotNetBarManager1.EnableFullSizeDock = false;
  855. this.dotNetBarManager1.LeftDockSite = this.barLeftDockSite;
  856. this.dotNetBarManager1.ParentForm = this;
  857. this.dotNetBarManager1.RightDockSite = this.barRightDockSite;
  858. this.dotNetBarManager1.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
  859. this.dotNetBarManager1.ThemeAware = false;
  860. this.dotNetBarManager1.TopDockSite = this.barTopDockSite;
  861. this.dotNetBarManager1.ItemClick += new System.EventHandler(this.dotNetBarManager1_ItemClick);
  862. // 
  863. // barBottomDockSite
  864. // 
  865. this.barBottomDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
  866. this.barBottomDockSite.Dock = System.Windows.Forms.DockStyle.Bottom;
  867. this.barBottomDockSite.Location = new System.Drawing.Point(2, 438);
  868. this.barBottomDockSite.Name = "barBottomDockSite";
  869. this.barBottomDockSite.NeedsLayout = false;
  870. this.barBottomDockSite.Size = new System.Drawing.Size(526, 0);
  871. this.barBottomDockSite.TabIndex = 55;
  872. this.barBottomDockSite.TabStop = false;
  873. // 
  874. // barLeftDockSite
  875. // 
  876. this.barLeftDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
  877. this.barLeftDockSite.Dock = System.Windows.Forms.DockStyle.Left;
  878. this.barLeftDockSite.Location = new System.Drawing.Point(2, 2);
  879. this.barLeftDockSite.Name = "barLeftDockSite";
  880. this.barLeftDockSite.NeedsLayout = false;
  881. this.barLeftDockSite.Size = new System.Drawing.Size(0, 436);
  882. this.barLeftDockSite.TabIndex = 52;
  883. this.barLeftDockSite.TabStop = false;
  884. // 
  885. // barRightDockSite
  886. // 
  887. this.barRightDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
  888. this.barRightDockSite.Dock = System.Windows.Forms.DockStyle.Right;
  889. this.barRightDockSite.Location = new System.Drawing.Point(528, 2);
  890. this.barRightDockSite.Name = "barRightDockSite";
  891. this.barRightDockSite.NeedsLayout = false;
  892. this.barRightDockSite.Size = new System.Drawing.Size(0, 436);
  893. this.barRightDockSite.TabIndex = 53;
  894. this.barRightDockSite.TabStop = false;
  895. // 
  896. // barTopDockSite
  897. // 
  898. this.barTopDockSite.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
  899. this.barTopDockSite.Dock = System.Windows.Forms.DockStyle.Top;
  900. this.barTopDockSite.Location = new System.Drawing.Point(2, 2);
  901. this.barTopDockSite.Name = "barTopDockSite";
  902. this.barTopDockSite.NeedsLayout = false;
  903. this.barTopDockSite.Size = new System.Drawing.Size(526, 0);
  904. this.barTopDockSite.TabIndex = 54;
  905. this.barTopDockSite.TabStop = false;
  906. // 
  907. // FormSendMsg
  908. // 
  909. this.AllowDrop = true;
  910. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  911. this.ClientSize = new System.Drawing.Size(530, 440);
  912. this.Controls.Add(this.RTBRecord);
  913. this.Controls.Add(this.panel11);
  914. this.Controls.Add(this.panelSendFile);
  915. this.Controls.Add(this.panel10);
  916. this.Controls.Add(this.splitter1);
  917. this.Controls.Add(this.panelSend);
  918. this.Controls.Add(this.panel5);
  919. this.Controls.Add(this.panelAV);
  920. this.Controls.Add(this.panelRiht);
  921. this.Controls.Add(this.panelRightNotice);
  922. this.Controls.Add(this.panel2);
  923. this.Controls.Add(this.bar1);
  924. this.Controls.Add(this.ribbonControl1);
  925. this.Controls.Add(this.barLeftDockSite);
  926. this.Controls.Add(this.barRightDockSite);
  927. this.Controls.Add(this.barTopDockSite);
  928. this.Controls.Add(this.barBottomDockSite);
  929. this.DockPadding.Bottom = 2;
  930. this.DockPadding.Left = 2;
  931. this.DockPadding.Right = 2;
  932. this.DockPadding.Top = 2;
  933. this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
  934. this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  935. this.MinimumSize = new System.Drawing.Size(530, 440);
  936. this.Name = "FormSendMsg";
  937. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  938. this.Text = "与某某对话";
  939. this.Closing += new System.ComponentModel.CancelEventHandler(this.FormSendMsg_Closing);
  940. this.Load += new System.EventHandler(this.FormSendMsg_Load);
  941. ((System.ComponentModel.ISupportInitialize)(this.bar1)).EndInit();
  942. this.panelRightNotice.ResumeLayout(false);
  943. this.panelAVchat.ResumeLayout(false);
  944. this.panelSendAndNotice.ResumeLayout(false);
  945. this.panel14.ResumeLayout(false);
  946. ((System.ComponentModel.ISupportInitialize)(this.bar4)).EndInit();
  947. ((System.ComponentModel.ISupportInitialize)(this.tabCsendFile)).EndInit();
  948. this.panelSend.ResumeLayout(false);
  949. this.panelEx2.ResumeLayout(false);
  950. ((System.ComponentModel.ISupportInitialize)(this.bar2)).EndInit();
  951. this.panelButSend.ResumeLayout(false);
  952. this.panel8.ResumeLayout(false);
  953. this.panel9.ResumeLayout(false);
  954. this.panel10.ResumeLayout(false);
  955. ((System.ComponentModel.ISupportInitialize)(this.bar3)).EndInit();
  956. this.panelSendFile.ResumeLayout(false);
  957. this.ResumeLayout(false);
  958. }
  959. #endregion
  960. #region 窗体加载、窗体关闭、关闭按钮、字体、颜色按钮事件
  961. private void FormSendMsg_Load(object sender, System.EventArgs e)
  962. {
  963. IniFace();
  964. }
  965. private void butClose_Click(object sender, System.EventArgs e)
  966. {
  967.              this.Close();
  968. }
  969. private void trtFontSet_Click(object sender, System.EventArgs e)
  970. {
  971. System.Windows.Forms.FontDialog fd=new FontDialog();
  972. if (fd.ShowDialog()==System.Windows.Forms.DialogResult.OK)
  973. this.RTBSend.Font=fd.Font;
  974. }
  975. private void butFontColor_Click(object sender, System.EventArgs e)
  976. {
  977. System.Windows.Forms.ColorDialog cd=new ColorDialog();
  978. if ( cd.ShowDialog()==System.Windows.Forms.DialogResult.OK)
  979. this.RTBSend.ForeColor =cd.Color;
  980. }
  981. private void FormSendMsg_Closing(object sender, System.ComponentModel.CancelEventArgs e)
  982. {
  983. if(this.tabCsendFile.Tabs.Count>0)
  984. if(MessageBox.Show("您还有"+this.tabCsendFile.Tabs.Count.ToString()+"个文件在传输任务中,确定要关闭对话框并终止文件传输吗?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Information)==System.Windows.Forms.DialogResult.No )
  985. e.Cancel=true;
  986. if(!this.ButAVchat.Enabled)
  987. if(MessageBox.Show("您正在写对方进行视频对话,确定退出视频对话吗?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Information)==System.Windows.Forms.DialogResult.No)
  988. e.Cancel=true;
  989. else
  990. {
  991. LanMsg.ClassUserInfo userinfo =this.FormMain.formMain.findUser(this.Tag.ToString());
  992. if(userinfo!=null)
  993. this.FormMain.formMain.sendMsgToOneUser(new LanMsg.Controls.ClassMsg(15,"",null),userinfo.IP,userinfo.Port);
  994. }
  995. }
  996. #endregion
  997. #region 发送图片 按钮事件
  998. private void butSendPicture_Click(object sender, System.EventArgs e)
  999. {
  1000. System.Windows.Forms.OpenFileDialog  fd=new OpenFileDialog();
  1001. fd.Filter ="图像文件|*.*;*.jpg;*.jpeg;*.gif;*.ico"; 
  1002. if (fd.ShowDialog()==System.Windows.Forms.DialogResult.OK)
  1003. {
  1004. System.IO.FileInfo fInfo=new System.IO.FileInfo(fd.FileName);
  1005. if(fInfo.Length/(1024*70)>0)
  1006. {
  1007. MessageBox.Show("当前版本不支持发送大于70K的图片,请使用发送文件功能来发送。","提示",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Information );
  1008. return;
  1009. }
  1010. else
  1011. {
  1012. LanMsg.MyPicture pic =new MyPicture ();
  1013. pic.SizeMode=System.Windows.Forms.PictureBoxSizeMode.AutoSize;
  1014. pic.BackColor=this.RTBSend.BackColor;
  1015. pic.Image=System.Drawing.Image.FromFile(fd.FileName);
  1016. System.Random R=new Random();
  1017. pic.Tag=R.Next(200,2147483627);
  1018. System.IO.DirectoryInfo dInfo=new System.IO.DirectoryInfo(Application.StartupPath +"\sendImage");
  1019. if(!dInfo.Exists)
  1020. dInfo.Create();
  1021. pic.Image.Save(Application.StartupPath +"\sendImage\"+ pic.Tag.ToString() +".gif",System.Drawing.Imaging.ImageFormat.Gif );
  1022. this.RTBSend.InsertMyControl(pic);
  1023. System.Drawing.ImageAnimator.Animate(pic.Image,new System.EventHandler(this.OnFrameChanged));
  1024. this.SendGifs.add(pic);
  1025. }
  1026. }
  1027. }
  1028. #endregion 
  1029. #region 发送消息 菜单事件
  1030. private void butEnterSend_Click(object sender, System.EventArgs e)
  1031. {
  1032. this.butEnterSend.Checked=true;
  1033. this.butEnterCtrlSend.Checked=!this.butEnterSend.Checked;
  1034. }
  1035. private void butEnterCtrlSend_Click(object sender, System.EventArgs e)
  1036. {
  1037. this.butEnterSend.Checked=false;
  1038. this.butEnterCtrlSend.Checked=!this.butEnterSend.Checked;
  1039. }
  1040. private void RTBSend_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
  1041. {
  1042. if(this.butEnterSend.Checked  && e.KeyCode==System.Windows.Forms.Keys.Enter)
  1043. this.butSend_Click(null,null);
  1044. else if(this.butEnterCtrlSend.Checked  && e.Control  && e.KeyCode== System.Windows.Forms.Keys.Enter  )
  1045. this.butSend_Click(null,null);
  1046. }
  1047.         #endregion 
  1048. #region 发送消息 按钮事件 与启用或禁用发送按钮函数
  1049. private void butSend_Click(object sender, System.EventArgs e)
  1050. {
  1051. if(this.RTBSend.Text=="")
  1052. {
  1053. balloonTip1.SetBalloonCaption(this.RTBSend ,"提示");   
  1054. balloonTip1.SetBalloonText(this.RTBSend,"不能发送空消息。");
  1055. balloonTip1.ShowBalloon(this.RTBSend);
  1056. //MessageBox.Show("不能发送空消息。","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
  1057. return;
  1058. }
  1059.   currUserInfo=this.FormMain.formMain.findUser(this.Tag.ToString());
  1060. if(currUserInfo!=null)
  1061. {
  1062. EnBut(false);//禁用发送功能
  1063. currUserInfo.SendIsSuccess=false;//假设消息发送不成功
  1064. // LanMsg.Controls.ClassMsg msg=new LanMsg.Controls.ClassMsg(5,"", System.Text.Encoding.Unicode.GetBytes(this.RTBSend.Rtf));
  1065. LanMsg.Controls.ClassMsg msg=new LanMsg.Controls.ClassMsg(12,"",GetSendString());
  1066. FormMain.formMain.sendMsgToOneUser(msg,currUserInfo.IP,currUserInfo.Port );
  1067. }
  1068. }
  1069.  
  1070. private void EnBut(bool t)//启用或禁用发送功能
  1071. {
  1072. this.butSend.Enabled=t;
  1073. this.RTBSend.ReadOnly=!t;
  1074. OutTime=0;
  1075. this.timerCheckSendIsSuccess.Enabled=!t;//开始检测消息是否发送成功
  1076. }
  1077. #endregion 
  1078.         #region 获得要发送的 文本消息 序列化后的字节数据
  1079. private byte[] GetSendString()//获得要发送的序列化字串
  1080. {
  1081.             this.SendTextMsg=GetSendTextMsg();
  1082. return ( new LanMsg.ClassSerializers().SerializeBinary(this.SendTextMsg).ToArray()); 
  1083. }
  1084. #endregion 
  1085. #region 检查 消息是否发送成功 timer事件
  1086. private void timerCheckSendIsSuccess_Tick(object sender, System.EventArgs e)
  1087. {   
  1088. if(currUserInfo!=null)
  1089. {
  1090. OutTime++;
  1091. if(OutTime==50 && !currUserInfo.SendIsSuccess)//如果消息没有发送成功
  1092. {
  1093. balloonTip1.SetBalloonCaption(this.butSend,"提示");   
  1094. balloonTip1.SetBalloonText(this.butSend,"消息发送不成功(原因可能是对方已经脱机或要发送的消息数据量太大以及其它网络故障)。");
  1095. balloonTip1.ShowBalloon(this.butSend);
  1096. //MessageBox.Show("消息发送不成功(原因可能是对方已经脱机或网络出现故障)。","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
  1097. EnBut(true);//启用发送功能
  1098. this.RTBSend.Focus();
  1099. }
  1100. string title="";
  1101. if(currUserInfo.SendIsSuccess)//如果消息发送成功 
  1102. {
  1103. if(this.RTBSend.Text!="")
  1104. this.FormMain.formMain.MsgAddToDB(this.SendTextMsg.MsgContent,this.FormMain.formMain.selfInfo.ID,currUserInfo.ID,this.FormMain.formMain.selfInfo.AssemblyVersion,System.DateTime.Now.ToString(),this.SendTextMsg.ImageInfo,true);//将消息添加进数据库
  1105.     title=this.FormMain.formMain.selfInfo.UserName  +"("+ System.DateTime.Now.ToString() +")";
  1106. // this.newMsg(this.RTBSend.Rtf,title,new System.Drawing.Font("宋体",10),Color.Red);
  1107.                     this.newTextMsg(title,new System.Drawing.Font("宋体",10),Color.Red);
  1108. this.sendSelfImage();//发送附加的自定义图片
  1109. this.RTBSend.Clear();
  1110. EnBut(true);//启用发送功能
  1111. }
  1112. }
  1113. }
  1114. #endregion
  1115. #region //发送自定义的图片文件
  1116. private void sendSelfImage()//发送图片文件
  1117. {
  1118. foreach(LanMsg.MyPicture pic in this.SendGifs)
  1119. {
  1120. if(pic.IsSent)
  1121. {
  1122.     currUserInfo=this.FormMain.formMain.findUser(this.Tag.ToString());
  1123. if(currUserInfo!=null)
  1124. {
  1125. LanMsg.ClassSendImage sImage=new ClassSendImage();//要发送的图片文件类
  1126. sImage.ID=Convert.ToUInt32(pic.Tag);
  1127. sImage.Image=Image.FromFile(Application.StartupPath +"\sendImage\"+ pic.Tag.ToString() +".gif");
  1128. LanMsg.Controls.ClassMsg msg=new LanMsg.Controls.ClassMsg(11,"",new ClassSerializers().SerializeBinary(sImage).ToArray());
  1129. FormMain.formMain.sendMsgToOneUser(msg,currUserInfo.IP,currUserInfo.Port);
  1130. System.Threading.Thread.Sleep(500);
  1131. }
  1132. }
  1133. }
  1134. this.SendGifs.Clear();
  1135. }
  1136. #endregion
  1137. #region RichBox 关联 菜单事件
  1138. private void dotNetBarManager1_ItemClick(object sender, System.EventArgs e)
  1139. {
  1140. switch((sender as DevComponents.DotNetBar.ButtonItem ).Name )
  1141. {
  1142. case "复制" :
  1143. if(this.RTBRecord.Focus())
  1144. this.RTBRecord.Copy (); 
  1145. if(this.RTBSend.Focus())
  1146. this.RTBSend.Copy (); 
  1147. break;
  1148. case "粘贴" :
  1149. if(this.RTBRecord.Focus())
  1150. {   }
  1151. if(this.RTBSend.Focus())
  1152. this.RTBSend.Paste (); 
  1153. break;
  1154. case "全选" :
  1155. if(this.RTBRecord.Focus())
  1156. this.RTBRecord.SelectAll (); 
  1157. if(this.RTBSend.Focus())
  1158. this.RTBSend.SelectAll (); 
  1159. break;
  1160. case "剪切" :
  1161. if(this.RTBRecord.Focus())
  1162. {} 
  1163. if(this.RTBSend.Focus())
  1164. this.RTBSend.Cut (); 
  1165. break;
  1166. }
  1167. }
  1168. #endregion
  1169. #region RichBox 超链接 单击事件
  1170. private void RTBRecord_LinkClicked(object sender, LinkClickedEventArgs e)
  1171. {
  1172. try
  1173. {
  1174. this.Text=e.LinkText + this.RTBRecord.GetRichEditOleInterface().GetLinkCount().ToString();
  1175. System.Diagnostics.Process.Start(e.LinkText);
  1176. }
  1177. catch 
  1178. {
  1179. //MessageBox.Show("无法打开链接。","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
  1180. }
  1181. }
  1182. #endregion
  1183. #region 历史richbox 文本改变后 事件
  1184. private void RTBRecord_TextChanged(object sender, System.EventArgs e)
  1185. {
  1186. this.RTBRecord.Focus();
  1187. this.RTBRecord.Select(this.RTBRecord.Text.Length-1,0);
  1188. this.RTBSend.Focus();
  1189. }
  1190. #endregion
  1191. #region 打开共享 按钮单击事件
  1192. private void butOpenShared_Click(object sender, System.EventArgs e)
  1193. {
  1194. try
  1195. {
  1196. string sharedComputerName="\\"+ Convert.ToString(this.Tag);
  1197. System.Diagnostics.Process.Start(sharedComputerName);
  1198. }
  1199. catch  
  1200. {
  1201. MessageBox.Show("无法打开对方("+ Convert.ToString(this.Tag) +")的共享文件夹(原因可能是对方没有开机或没有设置共享以及其它网络故障造成的)。","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
  1202. }
  1203. }
  1204. #endregion
  1205.  
  1206. #region 发送文件请求事件及其函数
  1207. private void butSendFile_Click(object sender, System.EventArgs e)
  1208. {
  1209. System.Windows.Forms.OpenFileDialog  fd=new OpenFileDialog();
  1210. fd.Filter ="所有文件|*.*"; 
  1211. if (fd.ShowDialog()==System.Windows.Forms.DialogResult.OK)
  1212. {
  1213. sendFileRequest(fd.FileName );
  1214. }
  1215. }
  1216. public void sendFileRequest(string fileName)//发送文件请求
  1217. {
  1218. //添加Tab
  1219. DevComponents.DotNetBar.TabControlPanel pa =new DevComponents.DotNetBar.TabControlPanel();
  1220. pa.Dock=System.Windows.Forms.DockStyle.Fill;
  1221. tabCsendFile.Controls.Add(pa);
  1222. DevComponents.DotNetBar.TabItem tabItem=new DevComponents.DotNetBar.TabItem(this.components);
  1223. tabItem.AttachedControl=pa;
  1224. tabItem.Text=Convert.ToString(this.tabCsendFile.Tabs.Count + 1) ;
  1225. bool isF;
  1226. for(int i=1;i<=this.tabCsendFile.Tabs.Count;i++) 
  1227. {
  1228. isF=false;
  1229. foreach(DevComponents.DotNetBar.TabItem tItem in this.tabCsendFile.Tabs)
  1230. {  
  1231. if(tItem.Text==i.ToString())
  1232. isF=true;
  1233. }
  1234. if(!isF)
  1235. {
  1236. tabItem.Text=i.ToString();goto xx;
  1237. }
  1238. }
  1239. xx:
  1240. tabCsendFile.Tabs.Add(tabItem);
  1241. //添加filesSend控件
  1242. LanMsg.Controls.filesSend fSend=new LanMsg.Controls.filesSend();
  1243. pa.Controls.Add(fSend);
  1244. System.IO.FileInfo f=new System.IO.FileInfo(fileName);
  1245. fSend.SetParameter(true,f.Name,fileName,f.Length,System.Net.IPAddress.Parse("127.0.0.1"),0,f.Extension);
  1246. fSend.fileSendCancel +=new LanMsg.Controls.filesSend.fileSendCancelEventHandler(fs_fileSendCancel);
  1247. fSend.fileSendEnd +=new LanMsg.Controls.filesSend.fileSendEndEventHandler(fs_fileSendEnd); 
  1248. string fileInfo=f.Name +"|"+ f.Extension +"|"+ f.Length.ToString();//初次请求发送文件时要先发送“控件参数”到对方,请求对方创建“文件发送控件”并建立连接
  1249. fSend.Dock=System.Windows.Forms.DockStyle.Fill;
  1250. LanMsg.Controls.ClassMsg msg=new LanMsg.Controls.ClassMsg(10,this.FormMain.formMain.selfInfo.ID,System.Text.Encoding.Unicode.GetBytes(fileInfo));
  1251. //发送消息给对方,让对方接收文件
  1252. currUserInfo=this.FormMain.formMain.findUser(this.Tag.ToString()); 
  1253. if(currUserInfo!=null)
  1254. fSend.SendData(currUserInfo.IP ,currUserInfo.Port, new  ClassSerializers().SerializeBinary(msg).ToArray());
  1255. AppendSystemRtf("等待对方接收文件 "+ f.Name  +"("+ fSend.GetSizeStr(f.Length) +") 。请等待回应或取消文件传输");
  1256. //显示tab控件
  1257. this.tabCsendFile.Visible=true;
  1258. this.tabCsendFile.SelectedTab=tabItem; 
  1259. this.tabCsendFile.Refresh();
  1260. }
  1261. #endregion 
  1262. #region 接收文件 函数
  1263. public void ReceiveFileRequest(string fileName,string Extension,long FileSize,System.Net.IPAddress Ip,int Port)//接收文件请求
  1264. {
  1265. //添加Tab
  1266. DevComponents.DotNetBar.TabControlPanel pa =new DevComponents.DotNetBar.TabControlPanel();
  1267. pa.Dock=System.Windows.Forms.DockStyle.Fill;
  1268. tabCsendFile.Controls.Add(pa);
  1269. DevComponents.DotNetBar.TabItem tabItem=new DevComponents.DotNetBar.TabItem(this.components);
  1270. tabItem.AttachedControl=pa;
  1271. tabItem.Text=Convert.ToString(this.tabCsendFile.Tabs.Count + 1) ;
  1272. bool isF;
  1273. for(int i=1;i<=this.tabCsendFile.Tabs.Count;i++) 
  1274. {
  1275. isF=false;
  1276. foreach(DevComponents.DotNetBar.TabItem tItem in this.tabCsendFile.Tabs)
  1277. {  
  1278. if(tItem.Text==i.ToString())
  1279. isF=true;
  1280. }
  1281. if(!isF)
  1282. {
  1283. tabItem.Text=i.ToString();goto xx;
  1284. }
  1285. }
  1286. xx:
  1287. tabCsendFile.Tabs.Add(tabItem);
  1288. //添加filesSend控件
  1289. LanMsg.Controls.filesSend fSend=new LanMsg.Controls.filesSend();
  1290. pa.Controls.Add(fSend);
  1291. fSend.SetParameter(false,fileName,fileName,FileSize,Ip,Port,Extension);
  1292. fSend.fileSendCancel +=new LanMsg.Controls.filesSend.fileSendCancelEventHandler(fs_fileSendCancel);
  1293. fSend.fileSendEnd +=new LanMsg.Controls.filesSend.fileSendEndEventHandler(fs_fileSendEnd);
  1294. fSend.fileSend +=new LanMsg.Controls.filesSend.fileSendEventHandler(fSend_fileSend);
  1295. fSend.Dock=System.Windows.Forms.DockStyle.Fill;
  1296. AppendSystemRtf("对方要传文件 "+ fileName +"("+ fSend.GetSizeStr(FileSize) +")" +" 给您,请接收或取消文件传输");
  1297. //显示tab控件
  1298. this.tabCsendFile.Visible=true;
  1299. this.tabCsendFile.SelectedTab=tabItem; 
  1300. this.tabCsendFile.Refresh();
  1301. this.panelAVchat.Visible=false;//将视频对话面板隐藏,以便用户接收或取消文件传输
  1302. }
  1303. #endregion
  1304. #region 文件发送取消、文件发送结束 事件
  1305. private void fs_fileSendCancel(object sender, bool isSelf)
  1306. {
  1307. LanMsg.Controls.filesSend FileSend=(sender as LanMsg.Controls.filesSend);
  1308. if(isSelf)
  1309. AppendSystemRtf("您已经取消了文件 "+FileSend.labFileName.Text  +" 的传输");
  1310. else
  1311. AppendSystemRtf("对方已经取消了文件 "+FileSend.labFileName.Text  +" 的传输");
  1312. delTabItem(FileSend);//删除文件传输Tab控件
  1313. if(!this.ButAVchat.Enabled)this.panelAVchat.Visible=true;//显示视频对话面板
  1314. }
  1315. private void fSend_fileSend(object sender, bool isSelf)//文件发送事件
  1316. {
  1317.             if(!this.ButAVchat.Enabled)this.panelAVchat.Visible=true;//显示视频对话面板
  1318. LanMsg.Controls.filesSend FileSend=(sender as LanMsg.Controls.filesSend);
  1319. if(isSelf)
  1320. AppendSystemRtf("您已经接收了文件 "+FileSend.labFileName.Text  +" 的传输,文件正在传输中...");
  1321. else
  1322. AppendSystemRtf("对方已经接收了文件 "+FileSend.labFileName.Text  +" 的传输,文件正在传输中...");
  1323. }
  1324. private void fs_fileSendEnd(object sender, bool isSelf)
  1325. {
  1326. LanMsg.Controls.filesSend FileSend=(sender as LanMsg.Controls.filesSend);
  1327. if(isSelf)
  1328. AppendSystemRtf("文件 "+ FileSend.labFileName.Text  +" 已经传输完成");
  1329. else
  1330. AppendSystemRtf("文件 "+ FileSend.labFileName.Text  +" 已经传输完成,保存路径<file:\\"+ FileSend.FileName +">" );
  1331. delTabItem(FileSend);//删除文件传输Tab控件
  1332. }
  1333. private void AppendSystemRtf(string str)
  1334. {
  1335. LanMsg.MyExtRichTextBox rich=new MyExtRichTextBox();
  1336. rich.AppendText("n  " );
  1337. rich.InsertImage(this.FormMain.formMain.imageList1.Images[18]);
  1338. rich.AppendText(" "+str);
  1339. rich.ForeColor=Color.Brown;
  1340. this.RTBRecord.AppendRtf (rich.Rtf);
  1341. rich.Clear();
  1342. rich.Dispose();
  1343. }
  1344. private void delTabItem(LanMsg.Controls.filesSend FileSend)//删除文件传输Tab控件
  1345. {
  1346. try
  1347. {
  1348. DevComponents.DotNetBar.TabControlPanel tPanel=(FileSend.Parent as DevComponents.DotNetBar.TabControlPanel);
  1349. tPanel.Text="0" ;
  1350. foreach(DevComponents.DotNetBar.TabItem tabItem in this.tabCsendFile.Tabs)
  1351. if((tabItem.AttachedControl as DevComponents.DotNetBar.TabControlPanel).Text=="0")
  1352. this.tabCsendFile.Tabs.Remove(tabItem);
  1353. FileSend.Dispose();
  1354. tPanel.Dispose();
  1355. tabItem.Dispose();
  1356. this.tabCsendFile.Refresh();
  1357. return;
  1358. }
  1359. }
  1360. catch
  1361. {
  1362. }
  1363. }
  1364. private void tabCsendFile_TabRemoved(object sender, System.EventArgs e)
  1365. {
  1366. if(this.tabCsendFile.Tabs.Count==0)
  1367. this.tabCsendFile.Visible=false;
  1368. }
  1369. #endregion
  1370. #region 重新绘制 richbox 事件
  1371. private void RTBRecordOnFrameChanged(object sender, EventArgs e) 
  1372. {
  1373. this.RTBRecord.Invalidate();
  1374. }
  1375. private void OnFrameChanged(object sender, EventArgs e) 
  1376. {
  1377. this.RTBSend.Invalidate();
  1378. }
  1379. #endregion
  1380. # region 显示 对话历史 按钮事件
  1381. private void butRecordshow_Click(object sender, System.EventArgs e)
  1382. {
  1383. this.currUserInfo=this.FormMain.formMain.findUser(this.Tag.ToString());
  1384. if(this.currUserInfo!=null)
  1385. this.FormMain.formMain.OpenMsgMis(this.currUserInfo.ID);
  1386. }
  1387. #endregion
  1388. #region 当 文本消息 发送成功后将自己发送的消息加入历史RICHBOX 函数
  1389. public void newTextMsg(string title,Font titleFont,Color titleColor)//将发送的消息加入历史rich
  1390. {
  1391. LanMsg.MyExtRichTextBox  rich =new  MyExtRichTextBox();
  1392. rich.AppendText(title);
  1393. rich.Font=titleFont;
  1394. rich.ForeColor=titleColor;
  1395. this.RTBRecord.AppendRtf(rich.Rtf);
  1396. this.RTBRecord.AppendText("  ");
  1397. LanMsg.ClassTextMsg textMsg=this.SendTextMsg;
  1398. int iniPos=this.RTBRecord.TextLength;//获得当前记录richBox中最后的位置
  1399. rich.Clear();
  1400. rich.Dispose();
  1401. if(textMsg.ImageInfo!="")//如果消息中有图片,则添加图片
  1402. {
  1403. string[] imagePos=textMsg.ImageInfo.Split('|');
  1404. int addPos=0;//
  1405. int currPos=0;//当前正要添加的文本位置
  1406. int textPos=0;
  1407. for(int i=0;i<imagePos.Length-1;i++)
  1408. {
  1409. string[] imageContent=imagePos[i].Split(',');//获得图片所在的位置、图片名称、图片宽、高
  1410. currPos=Convert.ToInt32(imageContent[0]);
  1411. this.RTBRecord.AppendText(textMsg.MsgContent.Substring(textPos,currPos-addPos));
  1412. this.RTBRecord.SelectionStart=this.RTBRecord.TextLength;
  1413. textPos += currPos-addPos ;
  1414. addPos += currPos-addPos;
  1415. LanMsg.MyPicture pic=new MyPicture();
  1416. pic.BackColor=this.RTBRecord.BackColor;
  1417. pic.SizeMode=System.Windows.Forms.PictureBoxSizeMode.AutoSize; 
  1418. if(Convert.ToUInt32(imageContent[1])<96)
  1419. pic.Image=System.Drawing.Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LanMsg.Resources."+ imageContent[1] +".gif")) ; 
  1420. else
  1421. {
  1422. pic.Tag=imageContent[1];
  1423. pic.Image=this.findPic(imageContent[1],this.SendGifs).Image;
  1424. }
  1425. System.Drawing.ImageAnimator.Animate(pic.Image,new System.EventHandler(this.RTBRecordOnFrameChanged));
  1426. this.RTBRecord.InsertMyControl(pic);
  1427. addPos ++;
  1428. }
  1429. this.RTBRecord.AppendText(textMsg.MsgContent.Substring(textPos,textMsg.MsgContent.Length-textPos) +"n");
  1430. }
  1431. else//如果消息中没有图片,则直接添加消息文本
  1432. {
  1433. this.RTBRecord.AppendText(textMsg.MsgContent +"n");
  1434. }
  1435. this.RTBRecord.Focus();
  1436. this.RTBRecord.Select(iniPos,this.RTBRecord.TextLength-iniPos);
  1437. this.RTBRecord.SelectionFont=textMsg.font ;
  1438. this.RTBRecord.Select(iniPos,this.RTBRecord.TextLength-iniPos);
  1439. this.RTBRecord.SelectionColor=textMsg.color;
  1440. this.RTBSend.Focus();
  1441. }
  1442. private LanMsg.ClassTextMsg GetSendTextMsg()//获得要发送的序列化字串
  1443. {
  1444. LanMsg.ClassTextMsg textMsg=new ClassTextMsg();
  1445. LanMsg.MyExtRichTextBox rich=new MyExtRichTextBox();
  1446. rich.Rtf=this.RTBSend.Rtf  ;
  1447. textMsg.MsgContent =rich.Text;//获得消息内容
  1448. textMsg.font=this.RTBSend.Font;//获得文本字体
  1449. textMsg.color=this.RTBSend.ForeColor;//获得文本颜色
  1450. REOBJECT reObject = new REOBJECT();
  1451. LanMsg.MyPicture pic;
  1452. for (int i=0 ; i<this.RTBSend.GetRichEditOleInterface().GetObjectCount();i++)
  1453. {
  1454. this.RTBSend.GetRichEditOleInterface().GetObject(i, reObject, GETOBJECTOPTIONS.REO_GETOBJ_ALL_INTERFACES);
  1455. pic=this.findPic(reObject.dwUser.ToString(),this.SendGifs);
  1456. if(pic!=null)
  1457. {
  1458. pic.IsSent=true;//发送此图片
  1459. textMsg.ImageInfo += reObject.cp.ToString() +","+reObject.dwUser.ToString()+ ","+ pic.Image.Size.Width.ToString() +","+pic.Image.Size.Height.ToString() + "|";
  1460. }
  1461. else
  1462. {
  1463. textMsg.ImageInfo += reObject.cp.ToString() +","+reObject.dwUser.ToString()+ "|";
  1464. }
  1465. }
  1466. rich.Clear();
  1467.             rich.Dispose();
  1468. return textMsg; 
  1469. }
  1470. #endregion
  1471. #region 收到对方发送过来的 文本消息
  1472. public void newTextMsg(byte[] content,string title,Font titleFont,Color titleColor)//收到对方发送过来文本消息
  1473. {
  1474. LanMsg.MyExtRichTextBox  rich =new  MyExtRichTextBox();
  1475. rich.AppendText(title);
  1476. rich.Font=titleFont;
  1477. rich.ForeColor=titleColor;
  1478. this.RTBRecord.AppendRtf(rich.Rtf);
  1479. this.RTBRecord.AppendText("  ");
  1480. LanMsg.ClassTextMsg textMsg=(new ClassSerializers().DeSerializeBinary(new System.IO.MemoryStream(content)) as ClassTextMsg);
  1481. int iniPos=this.RTBRecord.TextLength;//获得当前记录richBox中最后的位置
  1482. rich.Clear();
  1483. rich.Dispose();
  1484. if(textMsg.ImageInfo!="")//如果消息中有图片,则添加图片
  1485. {
  1486. string[] imagePos=textMsg.ImageInfo.Split('|');
  1487. int addPos=0;//
  1488. int currPos=0;//当前正要添加的文本位置
  1489. int textPos=0;
  1490. for(int i=0;i<imagePos.Length-1;i++)
  1491. {
  1492. string[] imageContent=imagePos[i].Split(',');//获得图片所在的位置、图片名称、图片宽、高
  1493. currPos=Convert.ToInt32(imageContent[0]);
  1494. this.RTBRecord.AppendText(textMsg.MsgContent.Substring(textPos,currPos-addPos));
  1495. this.RTBRecord.SelectionStart=this.RTBRecord.TextLength;
  1496. textPos += currPos-addPos ;
  1497. addPos += currPos-addPos;
  1498. LanMsg.MyPicture pic=new MyPicture();
  1499. pic.BackColor=this.RTBRecord.BackColor; 
  1500. if(Convert.ToUInt32(imageContent[1])<96)//如果发送的图片是自带的,则已知尺寸
  1501. {
  1502. pic.Image=System.Drawing.Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LanMsg.Resources."+ imageContent[1] +".gif")) ; 
  1503. pic.SizeMode=System.Windows.Forms.PictureBoxSizeMode.AutoSize;
  1504. }
  1505. else//如果发送的图片是自定义的,则需要知道尺寸
  1506. {
  1507. pic.Image=System.Drawing.Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LanMsg.Resources.ErrorImage.GIF")) ;
  1508. pic.Tag=imageContent[1];
  1509. pic.SizeMode=System.Windows.Forms.PictureBoxSizeMode.Normal;
  1510. pic.Size=new Size( Convert.ToInt32(imageContent[2]),Convert.ToInt32(imageContent[3]));
  1511. this.ArrivalGifs.add(pic);
  1512. }
  1513. this.RTBRecord.InsertMyControl(pic);
  1514. System.Drawing.ImageAnimator.Animate(pic.Image,new System.EventHandler(this.RTBRecordOnFrameChanged));
  1515. addPos ++;
  1516. }
  1517. this.RTBRecord.AppendText(textMsg.MsgContent.Substring(textPos,textMsg.MsgContent.Length-textPos) +"n");
  1518. }
  1519. else//如果消息中没有图片,则直接添加消息文本
  1520. {
  1521. this.RTBRecord.AppendText(textMsg.MsgContent +"n");
  1522. }
  1523. this.RTBRecord.Focus();
  1524. this.RTBRecord.Select(iniPos,this.RTBRecord.TextLength-iniPos);
  1525. this.RTBRecord.SelectionFont=textMsg.font ;
  1526. this.RTBRecord.Select(iniPos,this.RTBRecord.TextLength-iniPos);
  1527. this.RTBRecord.SelectionColor=textMsg.color;
  1528.       
  1529. this.RTBSend.Focus();
  1530. this.currUserInfo=this.FormMain.formMain.findUser(this.Tag.ToString());
  1531. if(this.currUserInfo!=null)
  1532. this.FormMain.formMain.sendMsgToOneUser(new LanMsg.Controls.ClassMsg(6,this.FormMain.formMain.selfInfo.ID,null),currUserInfo.IP,currUserInfo.Port );//告诉发消息的联系人已经收到发送的消息
  1533. this.FormMain.formMain.MsgAddToDB(textMsg.MsgContent,this.Tag.ToString(),this.FormMain.formMain.selfInfo.ID,this.FormMain.formMain.selfInfo.AssemblyVersion,System.DateTime.Now.ToString(),textMsg.ImageInfo,true);//将消息添加进数据库
  1534. }
  1535. #endregion
  1536. #region 在Gifs中查找图片控件
  1537. private LanMsg.MyPicture findPic(string ID,ClassGifs gifs)
  1538. {
  1539.             foreach(LanMsg.MyPicture pic in gifs)
  1540.  if(Convert.ToString(pic.Tag)==ID)
  1541.  return pic;
  1542. return null;
  1543. }
  1544. #endregion 
  1545. #region 收到对方发送来的自定义的GIF图片
  1546. public void newMsg(byte[] content,string title,Font titleFont,Color titleColor)//收到对方发送过来的GIF图片
  1547. {
  1548. System.IO.MemoryStream Ms=new System.IO.MemoryStream(content);
  1549.             LanMsg.ClassSendImage sImage=(new ClassSerializers().DeSerializeBinary(Ms)) as ClassSendImage ;
  1550.             Ms.Close();
  1551.           
  1552. LanMsg.MyPicture pic=this.findPic(Convert.ToString(sImage.ID),this.ArrivalGifs);
  1553. if(pic!=null)
  1554. {
  1555. System.IO.DirectoryInfo dInfo=new System.IO.DirectoryInfo(Application.StartupPath +"\ArrivalImage");
  1556. if(!dInfo.Exists)
  1557. dInfo.Create();
  1558. pic.Image=sImage.Image;
  1559. pic.Image.Save(Application.StartupPath +"\ArrivalImage\"+ pic.Tag.ToString() +".gif");
  1560. pic.Size=pic.Image.Size;
  1561. System.Drawing.ImageAnimator.Animate(pic.Image,new System.EventHandler(this.RTBRecordOnFrameChanged));
  1562. pic.Refresh();
  1563. pic.Invalidate();
  1564. this.RTBRecord.Invalidate();
  1565. this.RTBRecord.Refresh();
  1566. }
  1567. }
  1568. #endregion
  1569. #region 收到对方发送过来的 Rtf 消息
  1570. public void newMsg(string rtfMsg,string title,Font titleFont,Color titleColor)
  1571. {
  1572. System.Windows.Forms.RichTextBox rich =new RichTextBox();
  1573. rich.AppendText(title);
  1574. rich.Font=titleFont;
  1575. rich.ForeColor=titleColor;
  1576. this.RTBRecord.AppendRtf(rich.Rtf);
  1577. rich.Clear();
  1578. rich.Dispose();
  1579. this.RTBRecord.AppendTextAsRtf("    ");
  1580. this.RTBRecord.AppendRtf(rtfMsg);
  1581. }
  1582. #endregion
  1583. #region 屏幕截图 
  1584. private void butCapture_Click(object sender, System.EventArgs e)
  1585. {
  1586. FormCapture cf=new FormCapture();
  1587. cf.ShowDialog();
  1588. if(cf.Image!=null)
  1589. {
  1590.     System.IO.MemoryStream Ms=new System.IO.MemoryStream();
  1591.                 cf.Image.Save(Ms,System.Drawing.Imaging.ImageFormat.Gif);
  1592. LanMsg.MyPicture pic =new MyPicture ();
  1593. pic.SizeMode=System.Windows.Forms.PictureBoxSizeMode.AutoSize;
  1594. pic.BackColor=this.RTBSend.BackColor;
  1595. pic.Image=System.Drawing.Image.FromStream(Ms); 
  1596. Ms.Close();
  1597. System.Random R=new Random();
  1598. pic.Tag=R.Next(200,2147483627);
  1599. System.IO.DirectoryInfo dInfo=new System.IO.DirectoryInfo(Application.StartupPath +"\sendImage");
  1600. if(!dInfo.Exists)
  1601. dInfo.Create();
  1602. cf.Image.Save(Application.StartupPath +"\sendImage\"+ pic.Tag.ToString() +".gif",System.Drawing.Imaging.ImageFormat.Gif );
  1603. this.RTBSend.InsertMyControl(pic);
  1604. this.SendGifs.add(pic);
  1605. }
  1606. cf.Dispose();
  1607. }
  1608. #endregion 
  1609. #region 表情菜单 单击事件 
  1610. private void item_Click(object sender, EventArgs e)//表情单击事件代码
  1611. {
  1612. //DevComponents.DotNetBar.ButtonItem faceItem=(sender as DevComponents.DotNetBar.ButtonItem );
  1613. //this.RTBSend.InsertImage(faceItem.Image );
  1614. LanMsg.MyPicture pic =new MyPicture ();
  1615. pic.SizeMode=System.Windows.Forms.PictureBoxSizeMode.AutoSize;
  1616. pic.BackColor=this.RTBSend.BackColor;
  1617. pic.Tag=(sender as DevComponents.DotNetBar.ButtonItem).Tag ;
  1618. pic.Image=System.Drawing.Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LanMsg.Resources."+ (sender as DevComponents.DotNetBar.ButtonItem).Tag.ToString()  +".gif")) ; 
  1619. this.RTBSend.InsertMyControl(pic);
  1620. System.Drawing.ImageAnimator.Animate(pic.Image,new System.EventHandler(this.OnFrameChanged));
  1621. }
  1622. #endregion 
  1623. #region 初始化表情菜单
  1624. private void IniFace()
  1625. {
  1626. int j=0;
  1627. DevComponents.DotNetBar.ItemContainer itemCon=null;
  1628. for (int i=0;i<this.FormMain.formMain.imageListFace.Images.Count ;i++)
  1629. {   
  1630. DevComponents.DotNetBar.ButtonItem  item= new DevComponents.DotNetBar.ButtonItem() ;
  1631. item.Tag=i; 
  1632. item.Tooltip=i.ToString(); 
  1633. item.Image=this.FormMain.formMain.imageListFace.Images[i];
  1634. if(i % 15==0)
  1635. {
  1636. DevComponents.DotNetBar.ItemContainer itemC=new DevComponents.DotNetBar.ItemContainer();
  1637. this.trtFaceSet.SubItems.Add(itemC,j);
  1638. itemCon=itemC;
  1639. itemCon.Name=j.ToString();
  1640. itemCon.MinimumSize=new Size(0,0);
  1641. j++; 
  1642. }
  1643. itemCon.SubItems.Add(item,i % 15);
  1644. item.Click +=new EventHandler(item_Click);
  1645. }
  1646. }
  1647. #endregion
  1648. #region 视频对话部分
  1649. public void BeginAV(System.Net.IPAddress Ip,int Port)//对方要求开始视频对话
  1650. {
  1651. this.myAV1.serverIp=this.currUserInfo.IP;
  1652. this.myAV1.serverPort =this.currUserInfo.Port;
  1653. this.myAV1.Connect(Ip.ToString(),Port);
  1654. AppendSystemRtf("已经与对方建立UDP连接...");
  1655. }
  1656. public void AVrequest(System.Net.IPAddress Ip,int Port)//AV对话请求
  1657. {//参数为对方IP与端口,使用P2P方式传送AV数据
  1658. this.currUserInfo=this.FormMain.formMain.findUser(this.Tag.ToString());
  1659. if(this.currUserInfo!=null)
  1660. {
  1661. this.panelRightNotice.Width=296;
  1662. this.Width=this.MinimumSize.Width +156;
  1663. this.panelAVchat.Visible=true;
  1664. this.ButAVchat.Enabled=false;
  1665. this.myAV1.msg=new LanMsg.Controls.ClassMsg(14,this.FormMain.formMain.selfInfo.ID,null);
  1666. this.myAV1.serverIp=this.currUserInfo.IP;
  1667. this.myAV1.serverPort =this.currUserInfo.Port;
  1668.                 this.myAV1.linkLabelReceve.Visible=true;
  1669. AppendSystemRtf("对方请求与您进行视频对话,请接收请求或取消视频对话...");
  1670. }
  1671. }
  1672. private void AVchat_Click(object sender, System.EventArgs e)
  1673. {
  1674. this.currUserInfo=this.FormMain.formMain.findUser(this.Tag.ToString());
  1675. if(this.currUserInfo!=null)
  1676. {
  1677. this.panelRightNotice.Width=296;
  1678. this.Width=this.MinimumSize.Width +156;
  1679.             this.panelAVchat.Visible=true;
  1680. this.ButAVchat.Enabled=false;
  1681. this.myAV1.SetParameter(this.currUserInfo.IP,this.currUserInfo.Port,new LanMsg.Controls.ClassMsg(13,this.FormMain.formMain.selfInfo.ID,null));
  1682. AppendSystemRtf("您请求了与对方进行视频对话,请等待对方接收请求或取消视频对话...");
  1683. }
  1684. // LanMsg.FormAVWizard fAV=new FormAVWizard();
  1685. // fAV.ShowDialog();
  1686. }
  1687. private void myAV1_AVCancel(object sender, bool isSelf)
  1688. {
  1689. if (isSelf)
  1690. {
  1691. AppendSystemRtf("您已经取消了与对方的视频对话!");
  1692. }
  1693. else
  1694. {
  1695. AppendSystemRtf("对方已经取消了与您的视频对话!");
  1696. }
  1697. this.ButAVchat.Enabled=true;
  1698. this.panelAVchat.Visible=false;
  1699. this.panelRightNotice.Width=140;
  1700. this.Width=this.MinimumSize.Width;
  1701. LanMsg.ClassUserInfo userinfo =this.FormMain.formMain.findUser(this.Tag.ToString());
  1702. if(userinfo!=null)
  1703.             this.FormMain.formMain.sendMsgToOneUser(new LanMsg.Controls.ClassMsg(15,"",null),userinfo.IP,userinfo.Port);
  1704. }
  1705. public void CancelAV()
  1706. {
  1707. AppendSystemRtf("对方已经取消了与您的视频对话!");
  1708. this.ButAVchat.Enabled=true;
  1709. this.panelAVchat.Visible=false;
  1710. this.panelRightNotice.Width=140;
  1711. this.Width=this.MinimumSize.Width;
  1712.            
  1713. this.myAV1.ColseAV();
  1714. }
  1715. private void myAV1_AVReceve(object sender, bool isSelf)
  1716. {
  1717. if (isSelf)
  1718. {
  1719. AppendSystemRtf("您已经接收了对方的视频对话请求!");
  1720. }
  1721. else
  1722. {
  1723. AppendSystemRtf("对方已经接收了您的视频对话请求!");
  1724. }
  1725. }
  1726. #endregion
  1727. }
  1728. }