示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 private List <FavoriteConfigurationElement> ConvertFavoritesToExport(List <IFavorite> favorites)
 {
     return(favorites.Distinct()
            .Select(favorite => ModelConverterV2ToV1.ConvertToFavorite(favorite, this.persistence, this.connectionManager))
            .ToList());
 }