Пример #1
0
        private void btnRegister_Click(object sender, EventArgs e)
        {
            if (Util.XmppServices.XmppCon != null)
            {
                if (Util.XmppServices.XmppCon.XmppConnectionState != XmppConnectionState.Disconnected)
                {
                    Util.XmppServices.XmppCon.Close();
                }
            }


            Util.XmppServices.XmppCon = new XmppClientConnection();
            CreateEvents();

            using (frmRegister frm = new frmRegister(rosterControl))
            {
                frm.StartPosition = FormStartPosition.CenterParent;

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    btnLogIn.Enabled    = false;
                    btnLogOut.Enabled   = true;
                    btnRegister.Enabled = false;
                }
                else
                {
                    btnLogOut.Enabled   = false;
                    btnLogIn.Enabled    = true;
                    btnRegister.Enabled = true;
                }
            }
        }
Пример #2
0
        private void btnRegister_Click(object sender, EventArgs e)
        {
            if (Util.XmppServices.XmppCon != null)
                if (Util.XmppServices.XmppCon.XmppConnectionState != XmppConnectionState.Disconnected)
                    Util.XmppServices.XmppCon.Close();


            Util.XmppServices.XmppCon = new XmppClientConnection();
            CreateEvents();

            using (frmRegister frm = new frmRegister(rosterControl))
            {

                frm.StartPosition = FormStartPosition.CenterParent;

                if (frm.ShowDialog() == DialogResult.OK)
                {

                    btnLogIn.Enabled = false;
                    btnLogOut.Enabled = true;
                    btnRegister.Enabled = false;
                }
                else
                {
                    btnLogOut.Enabled = false;
                    btnLogIn.Enabled = true;
                    btnRegister.Enabled = true;
                }

            }

        }