Beispiel #1
0
        private async Task TestRemote(object sender, EventArgs <IRemoteSettings> e)
        {
            var profile = ProfilesService.CreateProfile(e.Value);

            _scriptWrapper = new ScriptWrapper <string>(profile, _view, d => d.ToString());

            await _scriptWrapper.Run("dir");

            if (_scriptWrapper.Results.Any())
            {
                _displayMessage.ShowInfo("Success", "Your connection details are valid.");
            }

            if (_scriptWrapper.Errors.Any() && _scriptWrapper.Errors.First() is RemoteTimeoutException)
            {
                _displayMessage.ShowError("Connection Error", "Falied to connect to remote machine with specified parameters");
            }

            _view.ToggleTestButton(true);
        }