Пример #1
0
 public APIClientVM()
 {
     _connectionLostCallback  = new Callback(UpdateServerDown);
     _requestReceivedCallback = new Callback(UpdateRequestReceived);
     _responseSentCallback    = new Callback(UpdateResponseSent);
     _client = new APIClientWrapper(_connectionLostCallback, _requestReceivedCallback, _responseSentCallback);
     APIClientWrapper.InitClient();
 }
Пример #2
0
        public APIClientVM(IDialogService dialogService) // injects services
        {
            _dialogService = dialogService;

            _connectionLostCallback  = new Callback(UpdateServerDown);
            _requestReceivedCallback = new Callback(UpdateRequestReceived);
            _responseSentCallback    = new Callback(UpdateResponseSent);
            _client = new APIClientWrapper(_connectionLostCallback, _requestReceivedCallback, _responseSentCallback);

            _reloadReaders    = new DelegateCommand(OnReloadReaders, null);
            _connectClient    = new DelegateCommand(OnConnectClient, CanConnectClient);
            _disconnectClient = new DelegateCommand(OnDisconnectClient, CanDisconnectClient);
            _clearLogs        = new DelegateCommand(OnClearLogs, null);

            CheckError(APIClientWrapper.InitClient());
        }