Exemplo n.º 1
0
        public async Task LoadSqlInstanceAndDbs()
        {
            await SqlInstancesVm.RetrieveInstanceAsync();

            await SqlInstancesVm.RetrieveDbNamesAsync(SqlInstancesVm.SelectedInst);

            var pref = _userPreferencePersist.LoadPreference();

            DbRestorOptVm.TargetDbName = pref.LastUsedDbName;
        }
Exemplo n.º 2
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);
         }
     };
 }
Exemplo n.º 3
0
 public void SaveInstSelection()
 {
     SqlInstancesVm.SavePreference();
 }
Exemplo n.º 4
0
 private void OnRestored()
 {
     DispatcherHelper.CheckBeginInvokeOnUI(
         async() => await SqlInstancesVm.RetrieveDbNamesAsync(SqlInstancesVm.SelectedInst));
 }