예제 #1
0
 static RdioServiceDescription()
 {
     Default = new RdioServiceDescription
     {
         AccessTokenEndpoint = new Uri("http://api.rdio.com/oauth/access_token"),
         MediaEndpoint = new Uri("http://cdn3.rdio.com"),
         RequestTokenEndpoint = new Uri("http://api.rdio.com/oauth/request_token"),
         WebServiceEndpoint = new Uri("http://api.rdio.com/1/")
     };
 }
예제 #2
0
		/// <summary>
		/// Creates a new instance of RdioClient with Consumer and Access information.
		/// </summary>
		/// <param name="consumerKey">The OAuth consumer's key.</param>
		/// <param name="consumerSecret">The OAuth consumer's secret.</param>
		/// <param name="accessSecret">The OAuth access secret.</param>
		/// <param name="accessToken">The OAuth access token.</param>
		/// <param name="serviceDescription">A custom <seealso cref="RdioServiceDescription"/> object defining
		/// API endpoints.</param>
		public RdioClient(string consumerKey, string consumerSecret, string accessToken, string accessSecret, RdioServiceDescription serviceDescription)
			: this(consumerKey, consumerSecret, serviceDescription)
		{
			if (string.IsNullOrEmpty(accessToken))
				throw new ArgumentNullException("accessToken");

			if (string.IsNullOrEmpty(accessSecret))
				throw new ArgumentNullException("accessSecret");

			Credentials.Token = new OAuthToken
			{
				Token = accessToken,
				Secret = accessSecret,
				Type = OAuthTokenType.Access
			};
		}
예제 #3
0
		/// <summary>
		/// Creates a new instance of RdioClient with just Consumer information. To access
		/// protected methods, you must request user authorization first.
		/// </summary>
		/// <param name="consumerKey">The OAuth consumer's key.</param>
		/// <param name="consumerSecret">The OAuth consumer's secret.</param>
		/// <param name="serviceDescription">A custom <seealso cref="RdioServiceDescription"/> object defining
		/// API endpoints.</param>
		public RdioClient(string consumerKey, string consumerSecret, RdioServiceDescription serviceDescription)
		{
			if (string.IsNullOrEmpty(consumerKey))
				throw new ArgumentNullException("consumerKey");

			if (serviceDescription == null)
				throw new ArgumentNullException("serviceDescription");

			_serviceDescription = serviceDescription;

			Credentials = new OAuthCredentials
			{
				ConsumerKey = consumerKey,
				ConsumerSecret = consumerSecret
			};

			InitializeMethods();
		}