Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MusicBrainzClient"/> class.
        /// </summary>
        /// <param name="httpClient">The <see cref="HttpClient"/> used for request to the webservice.</param>
        public MusicBrainzClient(HttpClient httpClient)
        {
            var urlBuilder = new UrlBuilder(true);

            Artists       = new ArtistService(this, urlBuilder);
            Recordings    = new RecordingService(this, urlBuilder);
            Releases      = new ReleaseService(this, urlBuilder);
            ReleaseGroups = new ReleaseGroupService(this, urlBuilder);
            Work          = new WorkService(this, urlBuilder);

            client = httpClient;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MusicBrainzClient"/> class.
        /// </summary>
        /// <param name="baseAddress">The base address of the webservice (default = <see cref="ServiceBaseAddress"/>).</param>
        /// <param name="proxy">The <see cref="IWebProxy"/> used to connect to the webservice.</param>
        public MusicBrainzClient(string baseAddress, IWebProxy proxy)
        {
            var urlBuilder = new UrlBuilder(true);

            Artists       = new ArtistService(this, urlBuilder);
            Recordings    = new RecordingService(this, urlBuilder);
            Releases      = new ReleaseService(this, urlBuilder);
            ReleaseGroups = new ReleaseGroupService(this, urlBuilder);
            Work          = new WorkService(this, urlBuilder);

            client = CreateHttpClient(new Uri(baseAddress), true, proxy);
        }