Esempio n. 1
0
 /// <summary>
 /// Create a RequestWrapper instance without using Request.
 /// </summary>
 public RequestWrapper(string userName, SecureString userPassword, IWebProxy proxy, string[] headers, IRequestOutput output = null)
 {
     this.UserName     = userName;
     this.UserPassword = userPassword;
     this.Proxy        = proxy;
     this.Headers      = headers;
     this.Output       = output == null ? new NullRequestOutput() : output;
 }
Esempio n. 2
0
        /// <summary>
        /// Create a RequestWrapper that just calls into <paramref name="request"/>.
        /// </summary>
        /// <param name="request">The actual Request object.</param>
        public RequestWrapper(NuGetRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }

            this.Request = request;
            this.Output  = new NuGetRequestOutput(request);
        }
        /// <summary>
        /// Create a RequestWrapper that calls into <paramref name="request"/> with <param name="userName"> and <param name="userPassword"> credentials.
        /// </summary>
        /// <param name="request">The actual Request object.</param>
        /// <param name="credential">The NetworkCredential object.</param>
        public RequestWrapper(NuGetRequest request, NetworkCredential credential)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }

            this.Request = request;
            if (credential != null)
            {
                this.UserName     = credential.UserName;
                this.UserPassword = credential.SecurePassword;
            }
            this.Output = new NuGetRequestOutput(request);
        }
Esempio n. 4
0
 /// <summary>
 /// Create a RequestWrapper instance without using Request.
 /// </summary>
 public RequestWrapper(IRequestOutput output) : this(null, null, null, null, output)
 {
 }