/// <summary> /// Prepares the current instance for use. /// </summary> /// <param name="apiKey">The API key to use when authenticating with SendWithUs.</param> /// <param name="worker">The HTTP implementation.</param> /// <param name="responseFactory">The factory used to construct response objects.</param> /// <returns>The current instance.</returns> protected virtual ConnectClientLib Initialize(string user, string password, HttpClient worker, IResponseFactory responseFactory) { EnsureArgument.NotNullOrEmpty(user, "user"); EnsureArgument.NotNullOrEmpty(password, "password"); EnsureArgument.NotNull(worker, "worker"); EnsureArgument.NotNull(responseFactory, "responseFactory"); ServicePointManager.ServerCertificateValidationCallback += ValidateRemoteCertificate; this.authInformation = this.BuildAuthenticationToken(user, password); this.WorkerDelme = worker; return(this); }
public static T Of <T>(object value, string paramName) where T : class { return(EnsureArgument.Of <T>(value, paramName, String.Format(CultureInfo.InvariantCulture, "The value of '{0}' must be of type '{1}'.", paramName, typeof(T)))); }