Example #1
0
        public void OpenOnScreenPad()
        {
            FormCollection formCollection = Application.OpenForms;

            if (Application.OpenForms["OnscreenDrawForm"] == null)
            {
                new Thread(() =>
                {
                    onscreenDrawForm = new OnscreenDrawForm();
                    User32.SetForegroundWindow(onscreenDrawForm.Handle);
                    onscreenDrawForm.Focus();
                    onscreenDrawForm.TopMost = true;
                    onscreenDrawForm.ShowDialog();
                    if (onscreenDrawForm.IsDisposed)
                    {
                        ReturnMessageToClient("OnscreenDrawForm");
                    }
                }
                           ).Start();
            }
            else
            {
                onscreenDrawForm.Focus();
                onscreenDrawForm.TopMost = true;
                onscreenDrawForm.BringToFront();
                onscreenDrawForm.Activate();
            }
        }
Example #2
0
        protected override void OnMessage(MessageEventArgs e)
        {
            string getEventDataFormClient = e.Data;

            if (getEventDataFormClient == "{Who:Customer,Why:Purchase}")
            {
                signpadDrawForm = new SignpadDrawForm();
                User32.SetForegroundWindow(signpadDrawForm.Handle);
                signpadDrawForm.Focus();
                signpadDrawForm.TopMost = true;
                signpadDrawForm.ShowDialog();
                if (signpadDrawForm.IsDisposed)
                {
                    dataSignaturePad.Event    = responseData.EventStatus; // "OnSigPadCompleted";
                    dataSignaturePad.SigImage = responseData.SignatureBase64;
                    dataSignaturePad.Message  = "Success";
                    var jsondata = Newtonsoft.Json.JsonConvert.SerializeObject(dataSignaturePad);
                    Send(jsondata);
                }
            }
            else
            {
                onscreenDrawForm = new OnscreenDrawForm();
                User32.SetForegroundWindow(onscreenDrawForm.Handle);
                onscreenDrawForm.Focus();
                onscreenDrawForm.TopMost = true;
                onscreenDrawForm.ShowDialog();
                if (onscreenDrawForm.IsDisposed)
                {
                    dataOnscreenPad.Event       = responseData.EventStatus; // "OnSignCompleted";
                    dataOnscreenPad.Base64Image = responseData.SignatureBase64;
                    dataOnscreenPad.Message     = "Success";
                    var jsondata = Newtonsoft.Json.JsonConvert.SerializeObject(dataOnscreenPad);
                    Send(jsondata);
                }
            }

            //Sessions.Broadcast(e.Data);
        }