Beispiel #1
0
        private void RDPEvent_OnDisconnected(int discReason)
        {
            const int UI_ERR_NORMAL_DISCONNECT = 0xB08;

            if (discReason != UI_ERR_NORMAL_DISCONNECT)
            {
                string reason = _rdpClient.GetErrorDescription((uint)discReason, (uint)_rdpClient.ExtendedDisconnectReason);
                Event_Disconnected(this, discReason + "\r\n" + reason);
            }

            if (Settings.Default.ReconnectOnDisconnect)
            {
                ReconnectGroup = new ReconnectGroup();
                ReconnectGroup.CloseClicked += Event_ReconnectGroupCloseClicked;
                ReconnectGroup.Left          = (int)(((double)Control.Width / 2) - ((double)ReconnectGroup.Width / 2));
                ReconnectGroup.Top           = (int)(((double)Control.Height / 2) - ((double)ReconnectGroup.Height / 2));
                ReconnectGroup.Parent        = Control;
                ReconnectGroup.Show();
                tmrReconnect.Enabled = true;
            }
            else
            {
                Close();
            }
        }
Beispiel #2
0
        private void ICAEvent_OnDisconnect(object sender, System.EventArgs e)
        {
            base.Event_Disconnected(this, e.ToString());

            if (mRemoteNG.Settings.Default.ReconnectOnDisconnect)
            {
                ReconnectGroup = new ReconnectGroup();
                //this.Load += ReconnectGroup_Load;
                ReconnectGroup.Left   = (int)(((double)Control.Width / 2) - ((double)ReconnectGroup.Width / 2));
                ReconnectGroup.Top    = (int)(((double)Control.Height / 2) - ((double)ReconnectGroup.Height / 2));
                ReconnectGroup.Parent = Control;
                ReconnectGroup.Show();
                tmrReconnect.Enabled = true;
            }
            else
            {
                base.Close();
            }
        }