예제 #1
0
        private void SendMessage(Action action, string payload)
        {
            try
            {
                if (this.txtIdentify.InvokeRequired)
                {
                    SendMessageCallback d = new SendMessageCallback(SendMessage);
                    this.Invoke(d, new object[] { action, payload });
                }
                else
                {
                    switch (action)
                    {
                    case Action.SendMessage:
                        txtIdentify.Text          += payload + "\r\n\r\n";
                        txtIdentify.SelectionStart = txtIdentify.TextLength;
                        txtIdentify.ScrollToCaret();
                        break;

                    case Action.ShowMatchedEntry:
                        this.btnShowResult.Visible = true;
                        break;

                    case Action.HideMatchedEntry:
                        this.btnShowResult.Visible = false;
                        break;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #2
0
        private void SendMessage(Action state, object payload)
        {
            if (this.cnicTextBox.InvokeRequired)
            {
                SendMessageCallback d = new SendMessageCallback(SendMessage);
                this.Invoke(d, new object[] { state, payload });
            }
            else
            {
                switch (state)
                {
                case Action.Enlarge:
                    this.Size = new Size(700, 557);
                    this.dataGridView1.Visible = true;
                    break;

                case Action.Delarge:
                    this.Size = new Size(519, 407);
                    this.dataGridView1.Visible = false;
                    break;

                default:
                    break;
                }
            }
        }
예제 #3
0
        private void SendMessage(Action state, object payload)
        {
            if (this.txtReaderSelected.InvokeRequired)
            {
                SendMessageCallback d = new SendMessageCallback(SendMessage);
                this.Invoke(d, new object[] { state, payload });
            }
            else
            {
                switch (state)
                {
                case Action.UpdateReaderState:
                    if ((Reader)payload != null)
                    {
                        txtReaderSelected.Text = ((Reader)payload).Description.SerialNumber;
                        //btnRegistration.Enabled = true;
                        btnIdentify.Enabled = true;
                    }
                    else
                    {
                        txtReaderSelected.Text = String.Empty;
                        //btnRegistration.Enabled = false;
                        btnIdentify.Enabled = false;
                    }
                    break;

                default:
                    break;
                }
            }
        }
예제 #4
0
        private void SendMessage(Action action, object payload)
        {
            try
            {
                if (this.tbxNumSocio.InvokeRequired)
                {
                    SendMessageCallback d = new SendMessageCallback(SendMessage);
                    this.Invoke(d, new object[] { action, payload });
                }
                else
                {
                    switch (action)
                    {
                    case Action.SendMessage:
                        (new frmMensaje((string)payload, "Error")).ShowDialog(this);
                        break;

                    case Action.SendOK:
                        string numSocio = (string)payload;
                        for (int i = 0; i < numSocio.Length; i++)
                        {
                            tbxNumSocio.Text += numSocio[i];
                            System.Threading.Thread.Sleep(50);
                            Application.DoEvents();
                        }
                        btnRegEntrada_Click(btnRegEntrada, new EventArgs());
                        break;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #5
0
        private void SendMessage(Action action, object payload)
        {
            try
            {
                if (this.tbxNumSocio.InvokeRequired)
                {
                    SendMessageCallback d = new SendMessageCallback(SendMessage);
                    this.Invoke(d, new object[] { action, payload });
                }
                else
                {
                    switch (action)
                    {
                    case Action.SendMessage:
                        (new frmMensajeIngreso((string)payload, "Error")).ShowDialog(this);
                        break;

                    case Action.SendOK:
                        string numSocio = (string)payload;
                        tbxNumSocio.Text = numSocio;
                        btnRegEntrada_Click(btnRegEntrada, new EventArgs());
                        break;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #6
0
        private void SendMessage(Action action, object payload)
        {
            try
            {
                if (this.pcbHuella.InvokeRequired)
                {
                    SendMessageCallback d = new SendMessageCallback(SendMessage);
                    this.Invoke(d, new object[] { action, payload });
                }
                else
                {
                    switch (action)
                    {
                    case Action.SendMessage:
                        MessageBox.Show((string)payload);
                        break;

                    case Action.SendBitmap:
                        pcbHuella.Image = (Bitmap)payload;
                        pcbHuella.Refresh();
                        break;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #7
0
 private void SendMessage(Action action, string payload)
 {
     try
     {
         if (this.txtVerify.InvokeRequired)
         {
             SendMessageCallback d = new SendMessageCallback(SendMessage);
             this.Invoke(d, new object[] { action, payload });
         }
         else
         {
             switch (action)
             {
             case Action.SendMessage:
                 txtVerify.Text          += payload + "\r\n\r\n";
                 txtVerify.SelectionStart = txtVerify.TextLength;
                 txtVerify.ScrollToCaret();
                 break;
             }
         }
     }
     catch (Exception)
     {
     }
 }
예제 #8
0
        public void SendMessage <T>(byte code, T message)
            where T : struct
        {
            var data = jsonSerializer.Serialize(new MessageData()
            {
                Code = code,
                Data = jsonSerializer.Serialize(message)
            });

            SendMessageCallback?.Invoke(data);
        }
        public ClientDistributedGreenScreenRoom(SendMessageCallback sendMessage, DistributedObjectId doId, List <object> messageData)
            : base(sendMessage, doId)
        {
            mRoomName           = CheckType.TryAssignType <string>(messageData[5]);
            mRoomId             = CheckType.TryAssignType <RoomId>(messageData[7]);
            mRoomOwnerAccountId = CheckType.TryAssignType <AccountId>(messageData[8]);

            BuildEntity();

            string roomItemsXmlString = CheckType.TryAssignType <string>(messageData[3]);

            SetupAssetsFromItemsXml(roomItemsXmlString);
        }
예제 #10
0
        private void SendMessage(Action action, object payload)
        {
            try
            {
                if (this.txtEnroll.InvokeRequired)
                {
                    SendMessageCallback d = new SendMessageCallback(SendMessage);
                    this.Invoke(d, new object[] { action, payload });
                }
                else
                {
                    switch (action)
                    {
                    case Action.SendMessage:
                        txtEnroll.Text          += payload + "\r\n\r\n";
                        txtEnroll.SelectionStart = txtEnroll.TextLength;
                        txtEnroll.ScrollToCaret();
                        break;

                    case Action.SendBitmap:
                        this.enrollPictureBox.Image = (Bitmap)payload;
                        this.enrollPictureBox.Refresh();
                        break;

                    case Action.WindowEnlargement:
                        break;

                    case Action.UpdateReaderState:
                        if ((Reader)payload != null)
                        {
                            this.txtEnroll.Visible          = true;
                            this.enrollPictureBox.Visible   = true;
                            this.deviceNotConnected.Visible = false;
                        }
                        else
                        {
                            this.txtEnroll.Visible          = false;
                            this.enrollPictureBox.Visible   = false;
                            this.deviceNotConnected.Visible = true;
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #11
0
 private void SendMessage(string payload)
 {
     if (txtEnroll.InvokeRequired)
     {
         var d = new SendMessageCallback(SendMessage);
         Invoke(d, new object[] { payload });
     }
     else
     {
         txtEnroll.Text          += payload + "\r\n\r\n";
         txtEnroll.SelectionStart = txtEnroll.TextLength;
         txtEnroll.ScrollToCaret();
     }
 }
예제 #12
0
        private void SendMessage(Action state, object payload)
        {
            using (Tracer tracer = new Tracer("Form_Main::SendMessage"))
            {
                if (this.txtReaderSelected.InvokeRequired)
                {
                    SendMessageCallback d = new SendMessageCallback(SendMessage);
                    this.Invoke(d, new object[] { state, payload });
                }
                else
                {
                    switch (state)
                    {
                    case Action.UpdateReaderState:
                        if ((Reader)payload != null)
                        {
                            txtReaderSelected.Text       = ((Reader)payload).Description.SerialNumber;
                            btnCapture.Enabled           = true;
                            btnStreaming.Enabled         = true;
                            btnVerify.Enabled            = true;
                            btnIdentify.Enabled          = true;
                            btnEnroll.Enabled            = true;
                            btnEnrollmentControl.Enabled = true;
                            if (fmds.Count > 0)
                            {
                                btnIdentificationControl.Enabled = true;
                            }
                        }
                        else
                        {
                            txtReaderSelected.Text           = String.Empty;
                            btnCapture.Enabled               = false;
                            btnStreaming.Enabled             = false;
                            btnVerify.Enabled                = false;
                            btnIdentify.Enabled              = false;
                            btnEnroll.Enabled                = false;
                            btnEnrollmentControl.Enabled     = false;
                            btnIdentificationControl.Enabled = false;
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
        }
예제 #13
0
        private void SendMessage(Action action, object payload)
        {
            try
            {
                Huella.huellaBase64 = null;
                if (this.pbFingerprint.InvokeRequired)
                {
                    SendMessageCallback d = new SendMessageCallback(SendMessage);
                    this.Invoke(d, new object[] { action, payload });
                }
                else
                {
                    switch (action)
                    {
                    case Action.SendMessage:
                        MessageBox.Show((string)payload);
                        break;

                    case Action.SendBitmap:
                        pbFingerprint.Image = (Bitmap)payload;
                        pbFingerprint.Refresh();

                        if (Form_Main.OptFormulario == 1)
                        {
                            Huella.pbImageFrame.Image    = (Bitmap)payload;
                            Huella.pbImageFrame.SizeMode = PictureBoxSizeMode.StretchImage;
                            Huella.pbImageFrame.Refresh();
                            Huella.MarcarHuellaDos();
                        }
                        else
                        {
                            RegistroEmpleado.pbImageFrame.Image    = (Bitmap)payload;
                            RegistroEmpleado.pbImageFrame.SizeMode = PictureBoxSizeMode.StretchImage;
                            RegistroEmpleado.pbImageFrame.Refresh();
                        }

                        break;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #14
0
 private void SendMessage(object payload)
 {
     try
     {
         if (this.pcbHuella.InvokeRequired)
         {
             SendMessageCallback d = new SendMessageCallback(SendMessage);
             this.Invoke(d, new object[] { payload });
         }
         else
         {
             pcbHuella.Image = (Bitmap)payload;
             pcbHuella.Refresh();
         }
     }
     catch (Exception)
     {
     }
 }
예제 #15
0
        public AvatarDistributedObject(SendMessageCallback sendMessage, DistributedObjectId doId, List <object> messageData)
            : base(sendMessage, doId)
        {
            mScheduler = GameFacade.Instance.RetrieveMediator <SchedulerMediator>().Scheduler;
            mPath      = (string)messageData[1];

            string xmlString = (string)messageData[3];

            mAvatarDna.LoadXml(xmlString);

            mAvatarName = (string)messageData[4];

            if (this.AvatarDna == null)
            {
                throw new Exception("this.AvatarDna is null when trying to Build Local Avatar Entity.");
            }

            BuildEntity();
        }
예제 #16
0
 public void RegisterSendMessageCallback(SendMessageCallback sendMessageCallback)
 {
 }
 public ClientDistributedMiniGameRoom(SendMessageCallback sendMessage, DistributedObjectId doId, List <object> messageData)
     : base(sendMessage, doId)
 {
     BuildEntity();
 }
예제 #18
0
 public ClientDistributedObject(SendMessageCallback sendMessage, DistributedObjectId doId)
     : base(doId)
 {
     mSendMessage = sendMessage;
 }
 public ForeignAvatarDistributedObject(SendMessageCallback sendMessage, DistributedObjectId doId, List <object> messageData)
     : base(sendMessage, doId, messageData)
 {
 }
예제 #20
0
 public FashionMinigame(SendMessageCallback sendMessage, DistributedObjectId doId, List <object> messageData, FashionGameStateMachine stateMachine)
     : base(sendMessage, doId, messageData)
 {
     GameFacade.Instance.SendNotification(GameFacade.ENTER_FASHION_MINIGAME);
     mCurrentStateMachine = stateMachine;
 }
예제 #21
0
        private void SendMessage(Action action, object payload)
        {
            try
            {
                if (this.txtEnroll.InvokeRequired)
                {
                    SendMessageCallback d = new SendMessageCallback(SendMessage);
                    this.Invoke(d, new object[] { action, payload });
                }
                else
                {
                    switch (action)
                    {
                    case Action.SendMessage:
                        txtEnroll.Text          += payload + "\r\n\r\n";
                        txtEnroll.SelectionStart = txtEnroll.TextLength;
                        txtEnroll.ScrollToCaret();
                        break;

                    case Action.SendBitmap:
                        this.enrollPictureBox.Image = (Bitmap)payload;
                        this.enrollPictureBox.Refresh();
                        break;

                    case Action.WindowEnlargement:
                        //this.okButton.Visible = true;
                        //this.enrollPictureBox.Visible = true;
                        //this.Size = new Size(674, 312);
                        break;

                    case Action.UpdateReaderState:
                        if ((Reader)payload != null)
                        {
                            this.txtEnroll.Visible        = true;
                            this.enrollPictureBox.Visible = true;
                            //txtReaderSelected.Text = ((Reader)payload).Description.SerialNumber;
                            //btnCapture.Enabled = true;
                            //btnStreaming.Enabled = true;
                            //btnVerify.Enabled = true;
                            //btnIdentify.Enabled = true;
                            //btnEnroll.Enabled = true;
                            //btnEnrollmentControl.Enabled = true;

                            //this.buttonFingerPrint.Enabled = true;

                            //if (fmds.Count > 0)
                            //{
                            //    btnIdentificationControl.Enabled = true;
                            //}
                        }
                        else
                        {
                            this.txtEnroll.Visible        = false;
                            this.enrollPictureBox.Visible = false;
                            //txtReaderSelected.Text = String.Empty;
                            //btnCapture.Enabled = false;
                            //btnStreaming.Enabled = false;
                            //btnVerify.Enabled = false;
                            //btnIdentify.Enabled = false;
                            //btnEnroll.Enabled = false;
                            //btnEnrollmentControl.Enabled = false;
                            //btnIdentificationControl.Enabled = false;

                            //this.buttonFingerPrint.Enabled = false;
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
 public ClientMockDistributedObject(SendMessageCallback sendMessage, DistributedObjectId doId) : base(sendMessage, doId)
 {
 }
예제 #23
0
 public void RegisterSendMessageCallback(SendMessageCallback sendMessageCallback)
 {
     mSendMessage = sendMessageCallback;
     mDistributedObjectFactory.RegisterSendMessageCallback(mSendMessage);
 }