//constructor
        public ChatProxy(ShowReceivedMessage srm, ShowStatus sst, string myport, string partneraddress)
        {
            StartChatServer(myport);
            if (Status)
            {
                _srm = srm;
                _sst = sst;
                _client = new HttpClient() { BaseAddress = new Uri(partneraddress) };

                ChatController.ThrowMessageArrivedEvent += (sender, args) => { ShowMessage(args.Message); };
            }
        }
Ejemplo n.º 2
0
        //constructor
        public ChatProxy(ShowReceivedMessage srm, ShowStatus sst, string myport, string partneraddress)
        {
            StartChatServer(myport);
            if (Status)
            {
                _srm    = srm;
                _sst    = sst;
                _client = new HttpClient()
                {
                    BaseAddress = new Uri(partneraddress)
                };

                ChatController.ThrowMessageArrivedEvent += (sender, args) => { ShowMessage(args.Message); };
            }
        }
        //constructor
        public ChatProxy(ShowReceivedMessage srm, ShowError sst, ShowStatusMsg stm, string token, Patient patient, AppSettings settings, string username)
        {
            _patient  = patient;
            _token    = token;
            _settings = settings;
            _username = username;
            //start chat on port 1138 and connect to server
            StartChatServer("1138");
            if (Status)
            {
                //setting method calls
                _srm = srm;
                _sst = sst;
                _stm = stm;

                _clients = new List <Tuple <string, string, HttpClient> >();

                //catching event throwing
                ChatController.ThrowMessageArrivedEvent += (sender, args) => { ShowMessage(args.Message); };
            }
        }