Пример #1
0
        private void OnButtonImportClick(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            List <FavoriteConfigurationElement> favoritesToImport = GetFavoritesFromBindingSource(this.domainTextbox.Text);
            var managedImport = new ImportWithDialogs(this, this.persistence, this.connectionManager);

            managedImport.Import(favoritesToImport);
        }
Пример #2
0
        private static bool InvokeTheImport(List <FavoriteConfigurationElement> toImport, IPersistence persistence,
                                            Func <int, DialogResult> strategy)
        {
            var moqInterface  = new TestImportUi(strategy);
            var managedImport = new ImportWithDialogs(moqInterface, persistence, TestConnectionManager.Instance);

            return(managedImport.Import(toImport));
        }
Пример #3
0
        private void ImportFavoritesWithManagerImport(List <FavoriteConfigurationElement> favoritesToImport)
        {
            var managedImport = new ImportWithDialogs(this, this.persistence, this.connectionManager);
            var imported      = managedImport.Import(favoritesToImport);

            if (imported)
            {
                this.UpdateFavoritesBindingSource();
            }
        }
Пример #4
0
        private void ImportFavoritesWithManagerImport(List <FavoriteConfigurationElement> favoritesToImport)
        {
            ImportWithDialogs managedImport = new ImportWithDialogs(this);
            bool imported = managedImport.Import(favoritesToImport);

            if (imported)
            {
                this.UpdateFavoritesBindingSource();
            }
        }
Пример #5
0
        private void MoveFavoritesFromConfigFile()
        {
            var tagsConvertert = new TagsConverter();

            foreach (FavoriteConfigurationElement favoriteConfigElement in settings.GetFavorites())
            {
                IFavorite favorite = ModelConverterV1ToV2.ConvertToFavorite(favoriteConfigElement, this.persistence, this.connectionManager);
                ImportWithDialogs.AddFavoriteIntoGroups(this.persistence, favorite, tagsConvertert.ResolveTagsList(favoriteConfigElement));
                this.persistence.Favorites.Add(favorite);
            }
        }
Пример #6
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, "Terminals Confirmation", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             List <FavoriteConfigurationElement> favoritesToImport = this.rdp.DiscoveredConnections.ToList();
             var managedImport = new ImportWithDialogs(this, this.persistence, this.connectionManager);
             managedImport.Import(favoritesToImport);
         }
     }
 }
Пример #7
0
        private void ImportSelectedItems(List <FavoriteConfigurationElement> favoritesToImport)
        {
            var managedImport = new ImportWithDialogs(this, this.persistence, this.connectionManager);

            managedImport.Import(favoritesToImport);
        }