Ejemplo n.º 1
0
        /// <summary>
        /// A non blocking create account request/response cycle.
        /// </summary>
        /// <param name="email">The email address to create the account with.</param>
        /// <param name="password">The password to create the account with.</param>
        /// <param name="affiliateCode">The affiliate code to create the account with, if applicable.</param>
        /// <param name="termsOfService">A value indicating whether the terms of service are agreed to.</param>
        /// <param name="newsletter">A value indicating whether to subscribe the email address to the newsletter.</param>
        /// <param name="baseUrl">The service base URL.</param>
        /// <param name="callback">The call response.</param>
        public static void CreateAccount(string email, string password, string affiliateCode, bool?termsOfService, bool?newsletter, Uri baseUrl, Action <CreateAccountResponse> callback)
        {
            CreateAccountRequest request = new CreateAccountRequest(baseUrl)
            {
                AffiliateCode  = affiliateCode,
                Email          = email,
                Newsletter     = newsletter,
                Password       = password,
                TermsOfService = termsOfService,
            };

            request.GetResponseAsync(callback);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// A blocking create account request/response cycle.
        /// </summary>
        /// <param name="email">The email address to create the account with.</param>
        /// <param name="password">The password to create the account with.</param>
        /// <param name="affiliateCode">The affiliate code to create the account with, if applicable.</param>
        /// <param name="termsOfService">A value indicating whether the terms of service are agreed to.</param>
        /// <param name="newsletter">A value indicating whether to subscribe the email address to the newsletter.</param>
        /// <param name="baseUrl">The service base URL.</param>
        /// <returns>The call response.</returns>
        public static CreateAccountResponse CreateAccount(string email, string password, string affiliateCode, bool?termsOfService, bool?newsletter, Uri baseUrl)
        {
            CreateAccountRequest request = new CreateAccountRequest(baseUrl)
            {
                AffiliateCode  = affiliateCode,
                Email          = email,
                Newsletter     = newsletter,
                Password       = password,
                TermsOfService = termsOfService
            };

            return(request.GetResponse());
        }