示例#1
0
        void _service_ServerConnectionFailed(object sender, EventArgs e)
        {
            if (ServerConnectionFailed != null)
            {
                _service = null;
                _host = null;
                ServerConnectionFailed(sender, e);
            }

            LoggedIn = false;
        }
示例#2
0
        internal void StartHost()
        {
            if (_service != null) return;

            _host = new ServiceHost();

            _service = new ChatroomClientService(TermReceived);

            _service.ServerConnectionFailed += new EventHandler(_service_ServerConnectionFailed);

            _host.AddService(_service);

            _host.StartServiceHost();

            _host.OpenServices();

            _hostStarted = true;
        }
示例#3
0
        internal void StopHost()
        {
            if (_service == null) return;

            _host.CloseServices();
            _host.StopServiceHost();

            HostStarted = false;

            LoggedIn = false;

            _service = null;
        }
示例#4
0
        static void Main(string[] args)
        {
            ServiceHost host = new ServiceHost();

            ChatroomClientService service = new ChatroomClientService();
        }