annotate Stocks/Stocks.Common/WebClientShim.cs @ 4:57f20ba55884

Fix for webClientShim to use downloadString instead of downloadData Refactoring and introduction of static TimedDelegates.Execute() helper method
author stevenh7776 stevenhollidge@hotmail.com
date Mon, 20 Feb 2012 23:04:58 +0700
parents 29ed98d659e9
children c812bca7b1ac
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 {
4
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents: 2
diff changeset
20 return _webClient.DownloadString(address).ToString();
2
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 }