using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Nuclex.Networking.Gallery3 { /// /// Stores connection-related resources required to access the gallery REST API /// internal class GalleryConnection : IGalleryConnection, IDisposable { /// Initializes a new gallery connection /// /// Factory used to issue new requests to the gallery installation /// /// /// API key for the user the requests will run as /// public GalleryConnection(Requests.IRequestFactory requestFactory, string apiKey) { this.requestFactory = requestFactory; this.apiKey = apiKey; } /// /// Factory used to create requests for the gallery installation /// /// /// If this is null, the connection has been closed. /// public Requests.IRequestFactory RequestFactory { get { return this.requestFactory; } } /// /// API key of the user the connection is impersonating /// public string ApiKey { get { return this.apiKey; } } /// Immediately releases all resources owned by the instance public void Dispose() { this.requestFactory = null; } /// Used to issue requests to the gallery installation private Requests.IRequestFactory requestFactory; /// API key of the user being impersonated by the connection private string apiKey; } } // namespace Nuclex.Networking.Gallery3