Ejemplo n.º 1
0
        private void SetupRAConnection()
        {
            if (raClient != null && raClient.isConnected())
                raClient.Disconnect();

            raClient = new Client(Settings.Default.raHost, Settings.Default.raPort, Settings.Default.raUsername,
            Settings.Default.raPassword);

            raClient.msgReceived += raClient_msgReceived;
            raClient.receiveFailed += raClient_receiveFailed;
            raClient.connFailed += raClient_connFailed;
            raClient.clientConnected += raClient_clientConnected;

            raClient.StartConnection();
        }
Ejemplo n.º 2
0
        private void raClient_msgReceived(object sender, Client.MessageReceivedEventArgs e)
        {
            string msg = e.message;

            if (msg.ToLower().Contains("authentication failed"))
            {
                Invoke((MethodInvoker) delegate
                {
                    EnableDisableFeatures(false);

                    TaskDialog.Show(new TaskDialogInfo("Authentication Failed",
                    eTaskDialogIcon.Stop,
                    "Authentication Failed!",
                    "Disabling Features...",
                    eTaskDialogButton.Ok));
                });
            }

            Invoke((MethodInvoker) delegate
            {
                consoleTextBoxX.AppendText(msg + Environment.NewLine);
                consoleTextBoxX.SelectionStart = consoleTextBoxX.Text.Length;
                consoleTextBoxX.ScrollToCaret();
            });
        }