Exemplo n.º 1
0
        public SettingsModel()
        {
            Singleton = this;

            Client                 = new Scripts.JsonClient(converterTCP, dataReceuveClient);
            Client.OnConnected    += delegate() { IsClient = true; InvokeConnection(); };
            Client.OnDisconnected += (byUser) => { IsClient = false; InvokeDisconnection(byUser); };

            Server            = new Scripts.JsonServer(converterTCP, dataReceuveServer);
            Server.OnStarted += delegate() { IsServer = true; InvokeConnection(); };
            Server.OnStopped += delegate() { IsServer = false; InvokeConnection(); };
        }
Exemplo n.º 2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     server = new Scripts.JsonServer(new Scripts.JsonObjectConverter(), new Scripts.DataReceivedServer());
     server.Debug_Output += o => Application.Current.Dispatcher.Invoke(delegate() { sOutput.Text += o + "\n"; });
     server.Start(7788);
 }