public ClientViewModel()
 {
     _netClient = new NetClient(_IP, _Port);
     _CommandControler = new Commands();
     _backgroundHelper = new BackgroundConnectionHelper(new DoWorkEventHandler(OnCallBack), new RunWorkerCompletedEventHandler(UpdateGUI));
     _ConnectClick = new CommandAction(StartClientClick);
 }
 public ServerViewModel()
 {
     _TCPServer = new TCPServer(_Ip, _Port);
     _TryToStartServer = new CommandAction(GetConnection);
     _BackgroundHelper = new BackgroundConnectionHelper(
         new DoWorkEventHandler(AsyncOperations),
         new RunWorkerCompletedEventHandler(UpdateGUI));
     _Commands = new Commands();
 }
Beispiel #3
0
		static void ExecuteCmd(GKBase gkBase, Commands cmd)
		{
			switch (cmd)
			{
				case Commands.SetAutomaticMode:
					{
						ClientManager.RubezhService.GKSetAutomaticRegime(gkBase);
						break;
					}
				case Commands.SetManualMode:
					{
						if (gkBase is GKZone) // Для охранной зоны данная команда запрещена
							break;

						ClientManager.RubezhService.GKSetManualRegime(gkBase);
						break;
					}
				case Commands.SetDisabledMode:
					{

						ClientManager.RubezhService.GKSetIgnoreRegime(gkBase);
						break;
					}
				case Commands.TurnOff:
					{
						ClientManager.RubezhService.GKTurnOff(gkBase);
						break;
					}
				case Commands.TurnOn:
					{
						ClientManager.RubezhService.GKTurnOn(gkBase);
						break;
					}
				case Commands.TurnOnNow:
					{
						ClientManager.RubezhService.GKTurnOnNow(gkBase);
						break;
					}
				case Commands.TurnOffNow:
					{
						ClientManager.RubezhService.GKTurnOffNow(gkBase);
						break;
					}
				case Commands.Stop:
					{
						ClientManager.RubezhService.GKStop(gkBase);
						break;
					}
				case Commands.Reset:
					{
						ClientManager.RubezhService.GKReset(gkBase);
						break;
					}
			}
		}