public OptionsConversionContext(IGuardedCredentialFactory credentialsFactory, IFavorite favorite, FavoriteConfigurationElement configFavorite) { this.CredentialsFactory = credentialsFactory; this.Favorite = favorite; this.ConfigFavorite = configFavorite; }
private void ToTsgwOptions(FavoriteConfigurationElement source, TsGwOptions destination, IGuardedCredentialFactory credentialsFactory) { destination.CredentialSource = source.TsgwCredsSource; destination.HostName = source.TsgwHostname; destination.SeparateLogin = source.TsgwSeparateLogin; destination.UsageMethod = source.TsgwUsageMethod; IGuardedSecurity securityOptoins = credentialsFactory.CreateSecurityOptoins(destination.Security); securityOptoins.Domain = source.TsgwDomain; destination.Security.EncryptedPassword = source.TsgwEncryptedPassword; securityOptoins.UserName = source.TsgwUsername; }
protected ModelConvertersTemplate(IPersistence persistence, ConnectionManager connectionManager) { this.Persistence = persistence; this.CredentialFactory = new GuardedCredentialFactory(this.Persistence); this.ConnectionManager = connectionManager; }
private void FromTsgwOptions(FavoriteConfigurationElement favorite, TsGwOptions tsGateway, IGuardedCredentialFactory credentialsFactory) { favorite.TsgwCredsSource = tsGateway.CredentialSource; favorite.TsgwHostname = tsGateway.HostName; favorite.TsgwSeparateLogin = tsGateway.SeparateLogin; favorite.TsgwUsageMethod = tsGateway.UsageMethod; IGuardedCredential guarded = credentialsFactory.CreateCredential(tsGateway.Security); favorite.TsgwDomain = guarded.Domain; favorite.TsgwEncryptedPassword = tsGateway.Security.EncryptedPassword; favorite.TsgwUsername = guarded.UserName; }