Exemple #1
0
        void btnStartSession_Click(object sender, EventArgs e)
        {
            DialogInput dlg = new DialogInput("Please enter target user name:");

            if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            client.RequestSession(dlg.Result, (senderClient, args) =>
            {
                if (args.IsConfirmed)
                {
                    Status("Session started with " + dlg.Result);

                    InvokeUI(() =>
                    {
                        btnSendMessage.Enabled   = true;
                        btnRemoteDesktop.Enabled = true;

                        btnUploadFile.Enabled = true;
                        btnEndSession.Enabled = true;
                    });
                }
                else
                {
                    Status(args.Exception.ToString());
                }
            });
        }
Exemple #2
0
        void btnLogin_Click(object sender, EventArgs e)
        {
            DialogInput dlg = new DialogInput("Please enter your user name:");

            if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            client.Login(dlg.Result, (senderClient, args) =>
            {
                if (args.IsValid)
                {
                    Status("User Validated!");
                    this.InvokeUI(() =>
                    {
                        this.Text = "Client - " + dlg.Result;
                        btnStartSession.Enabled = true;
                        btnLogin.Enabled        = false;
                    });
                }

                if (args.HasError)
                {
                    Status(args.Exception.ToString());
                }
            });
        }
Exemple #3
0
        void btnSendMessage_Click(object sender, EventArgs e)
        {
            DialogInput dlg = new DialogInput("Enter text message:");

            if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            client.SendTextMessage(dlg.Result);
        }