using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.ServiceModel;

namespace MessageServer
{
    public partial class Form1 : Form
    {
        private MessageService service;
        private ServiceHost host;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            service = new MessageService(this);
            host = new ServiceHost(service);
            host.Open();
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            host.Close();
        }

        internal void DisplayMessage(string msg)
        {
            textBox1.Text += msg + Environment.NewLine;     
        }


    }
}
