private ArrayList FavoritesToSharedList() { IFavorites favoritesToShare = this.persistence.Favorites; ArrayList list = new ArrayList(); foreach (IFavorite favorite in favoritesToShare) { FavoriteConfigurationElement configFavorite = ModelConverterV2ToV1.ConvertToFavorite(favorite, persistence, this.connectionManager); list.Add(SharedFavorite.ConvertFromFavorite(this.persistence, configFavorite)); } return(list); }
private ArrayList FavoritesToSharedList() { var favoritesToShare = this.persistence.Favorites; var list = new ArrayList(); foreach (var favorite in favoritesToShare) { var configFavorite = ModelConverterV2ToV1.ConvertToFavorite(favorite, this.persistence, this.connectionManager); list.Add(SharedFavorite.ConvertFromFavorite(this.persistence, configFavorite)); } return(list); }
private static void ExportFavorite(IFavorite favorite, IPersistence persistence) { FavoriteConfigurationElement favoriteElement = ModelConverterV2ToV1.ConvertToFavorite(favorite, persistence, TestConnectionManager.Instance); ExportOptions options = new ExportOptions { ProviderFilter = ImportTerminals.TERMINALS_FILEEXTENSION, Favorites = new List <FavoriteConfigurationElement> { favoriteElement }, FileName = TEST_FILE, IncludePasswords = true }; Exporters exporters = new Exporters(persistence, TestConnectionManager.Instance); exporters.Export(options); }
private void SaveDefaultFavorite(IFavorite favorite) { favorite.Name = String.Empty; favorite.ServerName = String.Empty; favorite.Notes = String.Empty; // to reset we dont need to go through encryption favorite.Security.EncryptedDomain = String.Empty; favorite.Security.EncryptedUserName = String.Empty; favorite.Security.EncryptedPassword = String.Empty; var defaultFavorite = ModelConverterV2ToV1.ConvertToFavorite(favorite, this.persistence, this.connectionManager); defaultFavorite.EnableSecuritySettings = false; defaultFavorite.SecurityWorkingFolder = string.Empty; defaultFavorite.SecurityStartProgram = string.Empty; defaultFavorite.SecurityFullScreen = false; settings.SaveDefaultFavorite(defaultFavorite); }
private List <FavoriteConfigurationElement> ConvertFavoritesToExport(List <IFavorite> favorites) { return(favorites.Distinct() .Select(favorite => ModelConverterV2ToV1.ConvertToFavorite(favorite, this.persistence, this.connectionManager)) .ToList()); }