/// <summary>
        /// Initializes a new instance of the TeleSignService class with the supplied
        /// configuration and webrequester.
        /// </summary>
        /// <param name="configuration">The configuration information for the service. If null will try to read the default configuration file.</param>
        /// <param name="webRequester">The web requester to use to perform web requests. If null will use the default.</param>
        protected TeleSignService(
            TeleSignServiceConfiguration configuration,
            IWebRequester webRequester)
        {
            this.configuration = (configuration == null)
                        ? TeleSignServiceConfiguration.ReadConfigurationFile()
                        : configuration;

            this.WebRequester = (webRequester == null)
                        ? new WebRequester()
                        : webRequester;

            this.ValidateConfiguration();

            this.authentication = new TeleSignAuthentication(this.configuration.Credential);
        }
        /// <summary>
        /// Initializes a new instance of the TeleSignService class with the supplied
        /// configuration and webrequester.
        /// </summary>
        /// <param name="configuration">The configuration information for the service. If null will try to read the default configuration file.</param>
        /// <param name="webRequester">The web requester to use to perform web requests. If null will use the default.</param>
        protected TeleSignService(
                    TeleSignServiceConfiguration configuration,
                    IWebRequester webRequester,
                    string accountName = "default")
        {
            this.configuration = (configuration == null)
                        ? TeleSignServiceConfiguration.ReadConfigurationFile(accountName)
                        : configuration;

            this.WebRequester = (webRequester == null)
                        ? new WebRequester()
                        : webRequester;

            this.ValidateConfiguration();

            this.authentication = new TeleSignAuthentication(this.configuration.Credential);
        }
 /// <summary>
 /// Initializes a new instance of the TeleSignService class with the supplied
 /// configuration.
 /// </summary>
 /// <param name="configuration">The configuration information for the service.</param>
 protected TeleSignService(TeleSignServiceConfiguration configuration)
     : this(configuration, null)
 {
 }
 /// <summary>
 /// Initializes a new instance of the TeleSignService class with the supplied
 /// configuration.
 /// </summary>
 /// <param name="configuration">The configuration information for the service.</param>
 protected TeleSignService(TeleSignServiceConfiguration configuration)
     : this(configuration, null)
 {
 }
 /// <summary>
 /// Implementation of IDisposable.
 /// </summary>
 public void Dispose()
 {
     this.WebRequester   = null;
     this.authentication = null;
     this.configuration  = null;
 }
        /// <summary>
        /// This reads a configuration file called TeleSign.config.xml from
        /// the same directory as this dll.
        /// </summary>
        /// <returns>An instantiated TeleSignServiceConfiguration object containing configuration.</returns>
        public static TeleSignServiceConfiguration ReadConfigurationFile(string accountName = "default")
        {
            string configFilePath = TeleSignServiceConfiguration.GetDefaultConfigurationFilePath();

            return(TeleSignServiceConfiguration.ReadConfigurationFile(configFilePath, accountName));
        }
        public static List <string> GetAccountNames()
        {
            string configFilePath = TeleSignServiceConfiguration.GetDefaultConfigurationFilePath();

            return(TeleSignServiceConfiguration.GetAccountNames(configFilePath));
        }
        /// <summary>
        /// This reads a configuration file called TeleSign.config.xml from
        /// the same directory as this dll.
        /// </summary>
        /// <returns>An instantiated TeleSignServiceConfiguration object containing configuration.</returns>
        public static TeleSignServiceConfiguration ReadConfigurationFile()
        {
            string configFilePath = TeleSignServiceConfiguration.GetDefaultConfigurationFilePath();

            return(TeleSignServiceConfiguration.ReadConfigurationFile(configFilePath));
        }