annotate Stocks/Stocks.Common/WebClientShim.cs @ 2:29ed98d659e9

Adding WebClientShim files
author stevenh7776 stevenhollidge@hotmail.com
date Mon, 20 Feb 2012 22:04:50 +0700
parents
children 57f20ba55884
rev   line source
2
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
1 using System;
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
2 using System.Collections.Generic;
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
3 using System.Linq;
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
4 using System.Text;
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
5 using System.Net;
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
6
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
7 namespace Stocks.Common
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
8 {
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
9 public class WebClientShim : IWebClientShim
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
10 {
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
11 private readonly WebClient _webClient;
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
12
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
13 public WebClientShim(WebClient webClient)
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
14 {
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
15 _webClient = webClient;
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
16 }
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
17
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
18 public string DownloadString(string address)
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
19 {
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
20 return _webClient.DownloadData(address).ToString();
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
21 }
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
22 }
29ed98d659e9 Adding WebClientShim files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
23 }