Ejemplo n.º 1
0
 private void StartService()
 {
     host = new ServiceHost(this);
     host.Open();
     channelFactory = new ChannelFactory <IChatBackend>("ChatEndpoint");
     _channel       = channelFactory.CreateChannel();
 }
Ejemplo n.º 2
0
        public void StartService()
        {
            host = new ServiceHost(this);
            host.Open();
            channelFactory = new ChannelFactory <IChatBackend>("ChatEndpoint");
            _channel       = channelFactory.CreateChannel();


            // Information to display locally
            _displayMessageDelegate(new CompositeType("Info", "Welcome to play Through the Ages"));
        }
Ejemplo n.º 3
0
        private void StartService()
        {
            host = new ServiceHost(this);
            host.Open();
            channelFactory = new ChannelFactory <IChatBackend>("ChatEndpoint");
            _channel       = channelFactory.CreateChannel();

            //displayed locally
            _displayMessageDelegate(new CompositeType("Info", "Welcome to MedPortal's Ask The Doctor, Go ahead and ask your question " +
                                                      "and a health care professional will be with you shortly"));
        }
Ejemplo n.º 4
0
        private void StartService()
        {
            host = new ServiceHost(this);
            host.Open();
            channelFactory = new ChannelFactory <IChatBackend>("ChatEndpoint");
            _channel       = channelFactory.CreateChannel();

            // Information to send to the channel
            _channel.DisplayMessage(new CompositeType("Event", _myUserName + " has entered the conversation."));

            // Information to display locally
            _displayMessageDelegate(new CompositeType("Info", "To change your name, type setname: NEW_NAME"));
        }
Ejemplo n.º 5
0
        private void StartService()
        {
            host = new ServiceHost(this);
            host.Open();
            _channelFactory = new ChannelFactory <IChatBackend>("ChatEndpoint");
            _channel        = _channelFactory.CreateChannel();

            // Информация, для отображения в канале
            _channel.DisplayMessage(new CompositeType("Событие", _myUserName + " вошел(-ла) в комнату чата."));

            // Информация, для отображения у вошедшего пользователя
            _displayMessageDelegate(new CompositeType("Информация", "Чтобы изменить имя, наберите: setname: НОВОЕ_ИМЯ"));
        }
Ejemplo n.º 6
0
        private void StartService()
        {
            host = new ServiceHost(this);
            host.Open();
            channelFactory = new ChannelFactory <IChatBackend>("ChatEndpoint");
            channel        = channelFactory.CreateChannel();

            if (File.Exists("options.xml"))
            {
                XmlSerializer xs   = new XmlSerializer(typeof(Information));
                FileStream    read = new FileStream("options.xml", FileMode.Open, FileAccess.Read, FileShare.Read);
                Information   info = (Information)xs.Deserialize(read);

                string username = info.UserName;

                channel.DisplayMessage(new CompositeType("Event", username + " has entered the conversation."));
            }
        }