void client_SessionRequest(Client client, EventArguments.SessionRequestEventArguments args)
        {
            var validClient = ConfigurationManager.AppSettings["ValidClient"];

            if (validClient.Split(',').Contains(args.Request.ClientName))
            {
                args.Confirm();
            }
            else
            {
                args.Refuse();
            }
        }
示例#2
0
        void client_SessionRequest(Client client, EventArguments.SessionRequestEventArguments args)
        {
            this.InvokeUI(() =>
            {
                if (MessageBox.Show(this, "Session request from " + args.Request.Email + ". Confirm request?", this.Text, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                {
                    args.Confirm();
                    Status("Session started with " + args.Request.Email);

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

                        btnUploadFile.Enabled = true;
                        btnEndSession.Enabled = true;
                    });
                }
                else
                {
                    args.Refuse();
                }
            });
        }