コード例 #1
0
        public async Task LoadSqlInstanceAndDbs()
        {
            await SqlInstancesVm.RetrieveInstanceAsync();

            await SqlInstancesVm.RetrieveDbNamesAsync(SqlInstancesVm.SelectedInst);

            var pref = _userPreferencePersist.LoadPreference();

            DbRestorOptVm.TargetDbName = pref.LastUsedDbName;
        }
コード例 #2
0
        public void Setup()
        {
            _sqlServerUtil = Substitute.For <ISqlServerUtil>();
            _sqlServerUtil.GetSqlInstances().Returns(Instances);
            _progressBarProvider = Substitute.For <IProgressBarProvider>();
            _userPrefPersist     = Substitute.For <IUserPreferencePersist>();
            _userPrefPersist.LoadPreference().Returns(new UserPreference());

            _vm = new SqlInstancesVm(_sqlServerUtil, _progressBarProvider, _userPrefPersist);
        }
コード例 #3
0
 public MainWindowVm(ISqlServerUtil sqlserverUtil, IUserPreferencePersist userPreferencePersist)
 {
     _sqlserverUtil                    = sqlserverUtil;
     _userPreferencePersist            = userPreferencePersist;
     SqlInstancesVm                    = new SqlInstancesVm(_sqlserverUtil, this, userPreferencePersist);
     _DbRestoreOption.PropertyChanged += (sender, args) =>
     {
         if (args.PropertyName == nameof(DbRestorOptVm.TargetDbName))
         {
             var pref = _userPreferencePersist.LoadPreference();
             pref.LastUsedDbName = _DbRestoreOption.TargetDbName;
             _userPreferencePersist.SavePreference(pref);
         }
     };
 }
コード例 #4
0
 public void Setup()
 {
     _progressBarProvider = Substitute.For <IProgressBarProvider>();
     _userPrefPersist     = Substitute.For <IUserPreferencePersist>();
     _userPrefPersist.LoadPreference().Returns(new UserPreference());
 }