/// <summary>
 /// Constructs AutoaddressClient with a licence key and the other configuration settings using defaults.
 /// </summary>
 /// <param name="licenceKey">The licence key.</param>
 /// <exception cref="ArgumentNullException">licenceKey</exception>
 public AutoaddressClient(string licenceKey)
 {
     if (string.IsNullOrWhiteSpace(licenceKey)) throw new ArgumentNullException("licenceKey");
     
     _licenceKey = licenceKey;
     _autoaddressConfig = new AutoaddressConfig();
 }
Beispiel #2
0
        /// <summary>
        /// Constructs AutoaddressClient with a licence key and the other configuration settings using defaults.
        /// </summary>
        /// <param name="licenceKey">The licence key.</param>
        /// <exception cref="ArgumentNullException">licenceKey</exception>
        public AutoaddressClient(string licenceKey)
        {
            if (string.IsNullOrWhiteSpace(licenceKey))
            {
                throw new ArgumentNullException(nameof(licenceKey));
            }

            _licenceKey        = licenceKey;
            _autoaddressConfig = new AutoaddressConfig();
        }
        /// <summary>
        /// Constructs AutoaddressClient with the licence key loaded from the application's
        /// default configuration and the other configuration settings from an AutoaddressConfig object.
        ///
        /// Example App.config with licence key set. 
        /// <code>
        /// &lt;?xml version="1.0" encoding="utf-8" ?&gt;
        /// &lt;configuration&gt;
        ///     &lt;appSettings&gt;
        ///         &lt;add key="AutoAddress.AutoAddress2_0.Settings.Licence.Key" value="TheLicenceKey"/&gt;
        ///     &lt;/appSettings&gt;
        /// &lt;/configuration&gt;
        /// </code>
        /// </summary>
        /// <param name="autoaddressConfig">The autoaddress config.</param>
        /// <exception cref="System.ArgumentNullException">autoaddressConfig</exception>
        public AutoaddressClient(AutoaddressConfig autoaddressConfig)
        {
            if (autoaddressConfig == null) throw new ArgumentNullException("autoaddressConfig");

            _licenceKey = Settings.Licence.Key;
            _autoaddressConfig = autoaddressConfig;
        }
 /// <summary>
 /// Constructs AutoaddressClient with the licence key loaded from the application's
 /// default configuration and the other configuration settings using defaults.
 ///
 /// Example App.config with licence key set. 
 /// <code>
 /// &lt;?xml version="1.0" encoding="utf-8" ?&gt;
 /// &lt;configuration&gt;
 ///     &lt;appSettings&gt;
 ///         &lt;add key="AutoAddress.AutoAddress2_0.Settings.Licence.Key" value="TheLicenceKey"/&gt;
 ///     &lt;/appSettings&gt;
 /// &lt;/configuration&gt;
 /// </code>
 /// </summary>
 public AutoaddressClient()
 {
     _licenceKey = Settings.Licence.Key;
     _autoaddressConfig = new AutoaddressConfig();
 }
        /// <summary>
        /// Constructs AutoaddressClient with a licence key and an AutoaddressConfig object.
        /// </summary>
        /// <param name="licenceKey">The licence key.</param>
        /// <param name="autoaddressConfig">The autoaddress config.</param>
        /// <exception cref="System.ArgumentNullException">
        /// licenceKey
        /// or
        /// autoaddressConfig
        /// </exception>
        public AutoaddressClient(string licenceKey, AutoaddressConfig autoaddressConfig)
        {
            if (string.IsNullOrWhiteSpace(licenceKey)) throw new ArgumentNullException("licenceKey");
            if (autoaddressConfig == null) throw new ArgumentNullException("autoaddressConfig");

            _licenceKey = licenceKey;
            _autoaddressConfig = autoaddressConfig;
        }