示例#1
0
        public override void Execute(object parameter)
        {
            var newAccount = new FtpAccount();

            newAccount.AccountId = Guid.NewGuid().ToString();

            var interaction = new FtpAccountInteraction(newAccount, Translation.AddFtpAccount);

            _interactionRequest.Raise(interaction, AddFtpAccountCallback);
        }
示例#2
0
        private void UpdateFtpAccountsCallback(FtpAccountInteraction interaction)
        {
            if (!interaction.Success)
            {
                IsDone?.Invoke(this, new MacroCommandIsDoneEventArgs(ResponseStatus.Cancel));
                return;
            }

            interaction.FtpAccount.CopyTo(_currentAccount);
            IsDone?.Invoke(this, new MacroCommandIsDoneEventArgs(ResponseStatus.Success));
        }
示例#3
0
        private void AddFtpAccountCallback(FtpAccountInteraction interaction)
        {
            if (!interaction.Success)
            {
                IsDone?.Invoke(this, new MacroCommandIsDoneEventArgs(ResponseStatus.Cancel));
                return;
            }

            _ftpAccounts.Add(interaction.FtpAccount);

            IsDone?.Invoke(this, new MacroCommandIsDoneEventArgs(ResponseStatus.Success));
        }
        public void SetUp()
        {
            var translationUpdater = new TranslationUpdater(new TranslationFactory(null), new ThreadManager());

            _ftpAccount           = new FtpAccount();
            _ftpAccount.AccountId = "ID";
            _ftpAccount.UserName  = "******";
            _ftpAccount.Server    = "Server";
            _ftpAccount.Password  = "******";

            _ftpAccountInteraction = new FtpAccountInteraction(_ftpAccount, "FtpAccountTestTitle");

            _viewModel = new FtpAccountViewModel(translationUpdater);
        }
示例#5
0
        public override void Execute(object parameter)
        {
            _currentAccount = parameter as FtpAccount;
            if (_currentAccount == null)
            {
                return;
            }
            if (!_ftpAccounts.Contains(_currentAccount))
            {
                return;
            }

            var interaction = new FtpAccountInteraction(_currentAccount.Copy(), Translation.EditFtpAccount);

            _interactionRequest.Raise(interaction, UpdateFtpAccountsCallback);
        }