/// <summary> /// Opens file dialog to import favorites and imports them from selected files. /// </summary> internal void CallImport() { if (ImportOpenFileDialog.ShowDialog() == DialogResult.OK) { String[] filenames = this.ImportOpenFileDialog.FileNames; this.Focus(); this.Refresh(); this.Cursor = Cursors.WaitCursor; List <FavoriteConfigurationElement> favoritesToImport = this.importers.ImportFavorites(filenames); ImportFavoritesWithManagerImport(favoritesToImport); } }
/// <summary> /// Opens file dialog to import favorites and imports them from selected files. /// </summary> internal void CallImport() { if (ImportOpenFileDialog.ShowDialog() == DialogResult.OK) { var filenames = this.ImportOpenFileDialog.FileNames; this.Focus(); this.Refresh(); this.Cursor = Cursors.WaitCursor; var favoritesToImport = this.importers.ImportFavorites(filenames); ImportFavoritesWithManagerImport(favoritesToImport); } }
private void ImportFromFile() { bool needsReload = false; if (ImportOpenFileDialog.ShowDialog() == DialogResult.OK) { string filename = ImportOpenFileDialog.FileName; Integration.Integration i = new Terminals.Integration.Integration(); FavoriteConfigurationElementCollection coll = i.ImportFavorites(filename); if (coll != null) { needsReload = true; foreach (FavoriteConfigurationElement fav in coll) { Settings.AddFavorite(fav, false); } } } if (needsReload) { LoadConnections(); } }