Example #1
0
 private void TreeView_DragDrop(object sender, DragEventArgs e)
 {
     String[] files = e.Data.GetData(DataFormats.FileDrop) as String[];
     if (files != null)
     {
         List <FavoriteConfigurationElement> favoritesToImport = Integrations.Importers.ImportFavorites(files, -1);
         ImportWithDialogs managedImport = new ImportWithDialogs(this.ParentForm);
         managedImport.Import(favoritesToImport);
     }
 }
Example #2
0
        private void DropFiles(Form parentForm)
        {
            var files = this.data.GetData(DataFormats.FileDrop) as String[];

            if (files == null)
            {
                return;
            }

            var importers = new Importers(this.persistence);
            var toImport  = importers.ImportFavorites(files);

            this.ApplyTargetGroup(toImport);
            var managedImport = new ImportWithDialogs(parentForm, this.persistence, this.connectinManager);

            managedImport.Import(toImport);
        }
 private static bool InvokeTheImport(List<FavoriteConfigurationElement> toImport, IPersistence persistence,
     Func<int, DialogResult> strategy)
 {
     var moqInterface = new TestImportUi(strategy);
     var managedImport = new ImportWithDialogs(moqInterface, persistence);
     bool success = managedImport.Import(toImport);
     return success;
 }
Example #4
0
 private void ImportDiscoveredFavorites()
 {
     if (this.rdp.DiscoveredConnections.Count > 0)
     {
         String message = String.Format("Automatic Discovery was able to find {0} connections.\r\n" +
                                        "Would you like to add them to your connections list?",
                                        this.rdp.DiscoveredConnections.Count);
         if (MessageBox.Show(message, AssemblyInfo.Title + " Confirmation", MessageBoxButtons.YesNo) ==
             DialogResult.Yes)
         {
             List<FavoriteConfigurationElement> favoritesToImport = this.rdp.DiscoveredConnections.ToList();
             ImportWithDialogs managedImport = new ImportWithDialogs(this);
             managedImport.Import(favoritesToImport);
         }
     }
 }
Example #5
0
 private void OnButtonImportClick(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     List<FavoriteConfigurationElement> favoritesToImport =
         this.GetFavoritesFromBindingSource(this.domainTextbox.Text);
     ImportWithDialogs managedImport = new ImportWithDialogs(this);
     managedImport.Import(favoritesToImport);
 }
 private void ImportFavoritesWithManagerImport(List<FavoriteConfigurationElement> favoritesToImport)
 {
     var managedImport = new ImportWithDialogs(this, this.persistence);
     bool imported = managedImport.Import(favoritesToImport);
     if (imported)
         this.UpdateFavoritesBindingSource();
 }
Example #7
0
 private void TreeView_DragDrop(object sender, DragEventArgs e)
 {
     String[] files = e.Data.GetData(DataFormats.FileDrop) as String[];
     if (files != null)
     {
         List<FavoriteConfigurationElement> favoritesToImport = Integrations.Importers.ImportFavorites(files);
         ImportWithDialogs managedImport = new ImportWithDialogs(this.ParentForm);
         managedImport.Import(favoritesToImport);
     }
 }
 private void ImportSelectedItems(List<FavoriteConfigurationElement> favoritesToImport)
 {
     var managedImport = new ImportWithDialogs(this, this.persistence);
     managedImport.Import(favoritesToImport);
 }
        private void DropFiles(Form parentForm)
        {
            var files = this.data.GetData(DataFormats.FileDrop) as String[];
            if (files == null)
                return;

            var importers = Integrations.CreateImporters(this.persistence);
            List<FavoriteConfigurationElement> toImport = importers.ImportFavorites(files);
            this.ApplyTargetGroup(toImport);
            var managedImport = new ImportWithDialogs(parentForm, this.persistence);
            managedImport.Import(toImport);
        }