コード例 #1
0
 public ServerViewModel()
 {
     _TCPServer = new TCPServer(_Ip, _Port);
     _TryToStartServer = new CommandAction(GetConnection);
     _BackgroundHelper = new BackgroundConnectionHelper(
         new DoWorkEventHandler(AsyncOperations),
         new RunWorkerCompletedEventHandler(UpdateGUI));
     _Commands = new Commands();
 }
コード例 #2
0
 public void GetConnection()
 {
     if (_TCPServer != null)
     {
         _TCPServer.Dispose();
         _TCPServer = new TCPServer(_Ip, _Port);
         _TCPServer.StartServer();
         _BackgroundHelper.Start();
     }
     RaisePropertyChanged("IsConnectedProperty");
 }