Example #1
0
        /// <summary>
        ///     Instantiates a new instance of this class.
        /// </summary>
        /// <param name="httpClient">The HTTP client to be used.</param>
        /// <param name="connectionInfo">The connect details used when setting up a connection.</param>
        internal Mobius(HttpClient httpClient, MobiusConnectionInfo connectionInfo)
        {
            if (connectionInfo == null)
            {
                throw new ArgumentNullException(nameof(connectionInfo));
            }

            HttpClient httpClientToUse;

            if (httpClient == null)
            {
                _localHttpClientInstance = new HttpClient();
                httpClientToUse          = _localHttpClientInstance;
            }
            else
            {
                _localHttpClientInstance = null;
                httpClientToUse          = httpClient;
            }

            AppStore = new AppStoreClient(httpClientToUse, connectionInfo);
            Tokens   = new TokensClient(httpClientToUse, connectionInfo);
        }
Example #2
0
 /// <summary>
 ///     Instantiates a new instance of this class.
 /// </summary>
 /// <param name="connectionInfo">The connect details used when setting up a connection.</param>
 public Mobius(MobiusConnectionInfo connectionInfo) : this(null, connectionInfo)
 {
 }