Exemple #1
0
 private void PopulateTargetDatabases(TargetConnection target)
 {
     _dialog.Dispatcher.Invoke(new Action(() => _dialog.Status.Text = Properties.Resources.CopyCollections_LoadingTargets));
     try
     {
         var dbs = MongoUtilities.Create(target.ConnectionInfo).GetDatabaseNames().OrderBy(item => item);
         _dialog.Dispatcher.Invoke(new Action(() => dbs.ToList().ForEach(item => { if (!_targetDatabases.Contains(item)) _targetDatabases.Add(item); })));
     }
     catch (Exception ex)
     {
         Utilities.LogException(ex);
     }
     _dialog.Dispatcher.Invoke(new Action(() => _dialog.Status.Text = string.Empty));
 }
Exemple #2
0
        private void CopyButtonClick(object sender, RoutedEventArgs e)
        {
            if (ValidatePreCopy())
            {
                _prepareProgress = new ProgressDialog();
                _prepareProgress.Title = Properties.Resources.CopyCollections_PrepareTitle;
                _prepareProgress.Owner = _dialog;

                _targetConnection = _dialog.TargetServer.SelectedItem as TargetConnection;

                _prepareTask = new CancelableTask<string>(() => PrepareToCopy(), PrepareToCopyComplete);
                _prepareTask.Execute();
                if (!(bool)_prepareProgress.ShowDialog())
                {
                    _prepareProgress = null;
                    if (_prepareTask != null)
                    {
                        _prepareTask.Cancel();
                    }
                }
            }
        }