diff --git a/Tasks/UrlTester/DT2.cs b/Tasks/UrlTester/DT2/DT2.cs similarity index 100% rename from Tasks/UrlTester/DT2.cs rename to Tasks/UrlTester/DT2/DT2.cs diff --git a/Tasks/UrlTester/DT2.pdf b/Tasks/UrlTester/DT2/DT2.pdf similarity index 100% rename from Tasks/UrlTester/DT2.pdf rename to Tasks/UrlTester/DT2/DT2.pdf diff --git a/Tasks/UrlTester/DT3/DT3.pdf b/Tasks/UrlTester/DT3/DT3.pdf new file mode 100644 index 0000000..c61ec2d Binary files /dev/null and b/Tasks/UrlTester/DT3/DT3.pdf differ diff --git a/Tasks/UrlTester/DT3/DT3cs.cs b/Tasks/UrlTester/DT3/DT3cs.cs new file mode 100644 index 0000000..ee9b6a9 --- /dev/null +++ b/Tasks/UrlTester/DT3/DT3cs.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Threading.Tasks; +using System.Windows; +using DT2; + +namespace DT3 { + + public class UrlTesterModel /* TO BE DONE */ { + public event PropertyChangedEventHandler PropertyChanged; + + int size; + int time; + string url; + DT2.UrlTester urlTester; + + public UrlTesterModel() { + urlTester = new DT2.UrlTester(); + IDictionary sw = new Dictionary(); + urlTester.PageStart += url => { sw.Add(url, Stopwatch.StartNew()); }; + urlTester.PageLoaded += (url, size) => { + sw[url].Stop(); + int time = (int)sw[url].Elapsed.TotalMilliseconds; + Size = size; + Time = time; + sw.Remove(url); + }; + } + + public int Size { + get { return size; } + set /* TO BE DONE */ + } + + public int Time { + get { return time; } + set /* TO BE DONE */ + } + + public string Url { + get { return url; } + set /* TO BE DONE */ + } + } + +} \ No newline at end of file