Пример #1
0
        public void MensajeRecibido(Lbl.Notificaciones.INotificacion notif)
        {
            ChatControl Ctrl       = null;
            bool        Encontrado = false;

            foreach (System.Windows.Forms.ToolStripItem Btn in this.Pestanias.Items)
            {
                if (Btn is System.Windows.Forms.ToolStripButton)
                {
                    Ctrl = Btn.Tag as ChatControl;
                    if (Ctrl.PersonaRemota.Id == notif.Remitente.Id)
                    {
                        Encontrado = true;
                        Ctrl.MensajeRecibido(notif);
                    }
                }
            }

            if (Encontrado == false)
            {
                Ctrl = this.IniciarChat(notif.Remitente, notif.EstacionOrigen);
                Ctrl.MensajeRecibido(notif);
            }

            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(delegate { this.ShowAndFlash(); }));
            }
            else
            {
                this.ShowAndFlash();
            }
        }
Пример #2
0
        public void MensajeRecibido(Lbl.Notificaciones.INotificacion notif)
        {
            if (EtiquetaNombre.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(delegate { this.MensajeRecibido(notif); }));
            }
            else
            {
                if (notif != null)
                {
                    if (EntradaConversacion.Text.Length > 0)
                    {
                        EntradaConversacion.AppendText(System.Environment.NewLine);
                    }
                    EntradaConversacion.AppendText(this.PersonaRemota.Nombres + ": ");
                    EntradaConversacion.AppendText(notif.Obs);
                    EntradaConversacion.SelectionStart = EntradaConversacion.TextLength;
                }

                if (this.ParentForm.Visible == false && this.ParentForm.InvokeRequired)
                {
                    this.ParentForm.Invoke(new MethodInvoker(delegate { this.ParentForm.Show(); }));
                }
            }
        }