예제 #1
0
        static void Ingresar()
        {
            Console.WriteLine("Ingrese nombre: ");
            string nombre = Console.ReadLine().Trim();

            Console.WriteLine("Ingrese texto: ");
            string  texto   = Console.ReadLine().Trim();
            Mensaje mensaje = new Mensaje()
            {
                Nombre = nombre,
                Texto  = texto,
                Tipo   = "Aplicacion"
            };

            lock (mensajesDAL)
            {
                mensajesDAL.AgregarMensaje(mensaje);
            }
        }
예제 #2
0
        public void Ejecutar()
        {
            clienteCom.Escribir("Ingrese nombre: ");
            string nombre = clienteCom.Leer();

            clienteCom.Escribir("Ingrese texto: ");
            string  texto   = clienteCom.Leer();
            Mensaje mensaje = new Mensaje()
            {
                Nombre = nombre,
                Texto  = texto,
                Tipo   = "TCP"
            };

            lock (mensajesDAL)
            {
                mensajesDAL.AgregarMensaje(mensaje);
            }

            clienteCom.Desconectar();
        }