/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { try { _connection.MessageGrabber.Remove(to_Jid); _connection.PresenceGrabber.Remove(to_Jid); MucManager mucManager = new MucManager(_connection); mucManager.LeaveRoom(to_Jid, _connection.MyJID.User); Util.GroupChatForms.Remove(to_Jid.Bare.ToLower()); } catch (Exception) { } _connection = null; if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }
private void btn_crate_Click(object sender, EventArgs e) { if (txt_pswd1.Texts.Trim()!=txt_pswd2.Texts.Trim()) { MsgBox.Show(this, "CSS&IM", "两次密码不一制!", MessageBoxButtons.OK); return; } MJid=new Jid(txt_name.Texts.Trim().ToString(), MJid.Server, null); XmppCon.MessageGrabber.Add(MJid, new BareJidComparer(), new MessageCB(MessageCallback), null); mucManager = new MucManager(XmppCon); mucManager.CreateReservedRoom(new Jid(txt_name.Texts.Trim().ToString(), MJid.Server, null), new IqCB(CreateReservedRoom), null); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { Util.GroupPresenceEvent -= new Util.PresenceHandler(Util_GroupPresenceEvent); RTBRecord.Dispose(); RTBRecord = null; rtfSend.Dispose(); rtfSend = null; if (QQcm_send_key != null) { QQcm_send_key.Dispose(); QQcm_send_key = null; } try { XmppConn.MessageGrabber.Remove(TO_Jid); XmppConn.PresenceGrabber.Remove(TO_Jid); } catch (Exception) { } try { MucManager mucManager = new MucManager(XmppConn); mucManager.LeaveRoom(TO_Jid, XmppConn.MyJID.User); } catch (Exception) { } try { Util.GroupChatForms.Remove(TO_Jid.Bare.ToLower()); } catch (Exception) { } if (emotionDropdown != null) { emotionDropdown.Dispose(); } if (chatGroupRoomSetForm != null) { chatGroupRoomSetForm.Dispose(); } if (PicQueue != null) { PicQueue.Dispose(); } if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); System.GC.Collect(); }