public OptionsConversionContext(IGuardedCredentialFactory credentialsFactory,
                                 IFavorite favorite, FavoriteConfigurationElement configFavorite)
 {
     this.CredentialsFactory = credentialsFactory;
     this.Favorite           = favorite;
     this.ConfigFavorite     = configFavorite;
 }
示例#2
0
        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;
        }
示例#3
0
 protected ModelConvertersTemplate(IPersistence persistence, ConnectionManager connectionManager)
 {
     this.Persistence       = persistence;
     this.CredentialFactory = new GuardedCredentialFactory(this.Persistence);
     this.ConnectionManager = connectionManager;
 }
示例#4
0
        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;
        }