Пример #1
0
 /// <summary>
 /// Manejador del inicio de la ventana del chat.
 /// Cierra la ventana de selección de comunicaciones y crea la nueva ventana.
 /// </summary>
 /// <param name="source">Fuente del evento.</param>
 /// <param name="e">Argumentos del evento.</param>
 void ventanaComunicaciones_OnInicioComunicacion(object source, MascotaVirtual.Comunicaciones.IComunicaciones e)
 {
     chat = new MascotaVirtual.Comunicaciones.ChatSeleccion();
     chat.OnVentanaCerrada  += new MascotaVirtual.Comunicaciones.ChatSeleccion.ManejadorVentanaCerrada(chat_OnVentanaCerrada);
     chat.OnPasoIntercambio += new MascotaVirtual.Comunicaciones.ChatSeleccion.ManejadorPasoIntercambio(chat_OnPasoIntercambio);
     chat.OnPasoJuego       += new ChatSeleccion.ManejadorPasoJuego(chat_OnPasoJuego);
     chat.SetComunicador(e);
     chat.Iniciar();
     chat.Enabled = true;
     chat.Show();
     ventanaComunicaciones.Dispose();
     ventanaComunicaciones = null;
 }
Пример #2
0
        /// <summary>
        /// Manejador del cambio de ventanas desde la ventana principal.
        /// En función del botón pulsado iniciará la ventana de conexiones o la de juegos.
        /// </summary>
        /// <param name="source">Fuente del evento.</param>
        /// <param name="e">Argumentos del evento.</param>
        void ventanaPrincipal_OnVentanaCambiada(object source, string e)
        {
            switch (e)
            {
            case "Jugar": IniciarJugar();
                break;

            case "Conexiones":
                ventanaComunicaciones = new MascotaVirtual.Comunicaciones.VentanaComunicaciones();
                ventanaComunicaciones.Show();
                ventanaComunicaciones.OnInicioComunicacion += new MascotaVirtual.Comunicaciones.VentanaComunicaciones.ManejadorInicioComunicacion(ventanaComunicaciones_OnInicioComunicacion);
                ventanaComunicaciones.OnVentanaCerrada     += new MascotaVirtual.Comunicaciones.VentanaComunicaciones.ManejadorVentanaCerrada(ventanaComunicaciones_OnVentanaCerrada);
                break;
            }
        }
Пример #3
0
 /// <summary>
 /// Manejador del cierre de la ventana de comunicaciones.
 /// </summary>
 /// <param name="source">Fuente del evento.</param>
 /// <param name="e">Argumentos del evento.</param>
 void ventanaComunicaciones_OnVentanaCerrada(object source, EventArgs e)
 {
     ventanaComunicaciones.Dispose();
     ventanaComunicaciones = null;
 }