/// <summary>
 /// Initializes a new instance of the <see cref="DefaultWebClient"/> class.
 /// </summary>
 /// <param name="webClient">instance of <see cref="WebClient"/> to use</param>
 public DefaultWebClient(WebClient webClient)
 {
     this.innerClient = webClient;
     this.innerClient.UploadValuesCompleted += (o, e) =>
     {
         // Pass on the event
         if (this.UploadValuesCompleted != null)
         {
             this.UploadValuesCompleted(this, new BinaryDataEventArgs(e.Result, e.Error, e.Cancelled, e.UserState));
         }
     };
     this.webFunctions = new DefaultWebFunctions();
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultWebClient"/> class.
 /// </summary>
 /// <param name="webClient">instance of <see cref="WebClient"/> to use</param>
 public DefaultWebClient(WebClient webClient)
 {
     this.innerClient = webClient;
     this.innerClient.UploadValuesCompleted += (o, e) =>
     {
         // Pass on the event
         if (this.UploadValuesCompleted != null)
         {
             this.UploadValuesCompleted(this, new BinaryDataEventArgs(e.Result, e.Error, e.Cancelled, e.UserState));
         }
     };
     this.webFunctions = new DefaultWebFunctions();
 }
Пример #3
0
 /// <summary>
 /// Initialises a new <see cref="CruiseServerRemotingClient"/>.
 /// </summary>
 /// <param name="serverUri">The address of the server.</param>
 /// <param name="client">The <see cref="WebClient"/> to use.</param>
 public CruiseServerHttpClient(string serverUri, WebClient client)
 {
     this.serverUri    = serverUri.EndsWith("/", StringComparison.CurrentCulture) ? serverUri.Substring(0, serverUri.Length - 1) : serverUri;
     this.client       = client;
     this.webFunctions = new DefaultWebFunctions();
 }