~dangarner/xibo/107-client

« back to all changes in this revision

Viewing changes to client/dotNET/Rss.cs

  • Committer: Daniel Garner
  • Date: 2009-12-31 11:16:07 UTC
  • mfrom: (81.1.12 105-client-test)
  • Revision ID: dan@xibo.org.uk-20091231111607-b547kt1lm9jtlczk
MergedĀ lp:~dangarner/xibo/105-client-test

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
using System.Windows.Forms;
25
25
using System.Xml;
26
26
using System.Net;
 
27
using System.Diagnostics;
27
28
 
28
29
namespace XiboClient
29
30
{
101
102
            _updateInterval = options.updateInterval;
102
103
            _scrollSpeed = options.scrollSpeed;
103
104
 
104
 
            System.Diagnostics.Trace.WriteLine(String.Format("Scrolling Speed: {0}, Update Interval: {1})", _scrollSpeed.ToString(), _updateInterval.ToString()), "Rss - Constructor");
 
105
            System.Diagnostics.Debug.WriteLine(String.Format("Scrolling Speed: {0}, Update Interval: {1})", _scrollSpeed.ToString(), _updateInterval.ToString()), "Rss - Constructor");
105
106
 
106
107
            // Generate a temporary file to store the rendered object in.
107
108
            _tempHtml = new TemporaryHtml();
225
226
</script>";
226
227
            }
227
228
 
228
 
            _headText = String.Format("{2}<style type='text/css'>body {{{1}}}, p, h1, h2, h3, h4, h5 {{ margin:2px; font-size:{0}em; }}</style>", _scaleFactor.ToString(), bodyStyle, initFunction);
 
229
            _headText = initFunction + "<style type='text/css'>body {" + bodyStyle + " font-size:" + _scaleFactor.ToString() + "em; }</style>";
229
230
 
230
231
            // Store the document text in the temporary HTML space
231
232
            _tempHtml.HeadContent = _headText;
243
244
 
244
245
                _wc = new System.Net.WebClient();
245
246
                _wc.UseDefaultCredentials = true;
 
247
                
246
248
                _wc.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(wc_OpenReadCompleted);
247
249
                
248
250
                _wc.OpenReadAsync(new Uri(_filePath));
487
489
                {
488
490
                    System.Diagnostics.Debug.WriteLine("Web browser control already disposed", "Rss - Dispose");
489
491
                }
 
492
 
 
493
                try
 
494
                {
 
495
                    _wc.Dispose();
 
496
                }
 
497
                catch
 
498
                {
 
499
                    System.Diagnostics.Debug.WriteLine("Web Client control already disposed", "Rss - Dispose");
 
500
                }
 
501
 
 
502
                // Remove the temporary file we created
 
503
                try
 
504
                {
 
505
                    _tempHtml.Dispose();
 
506
                }
 
507
                catch (Exception ex)
 
508
                {
 
509
                    Trace.WriteLine(new LogMessage("Dispose", String.Format("Unable to dispose TemporaryHtml with exception {0}", ex.Message)));
 
510
                }
490
511
            }
491
512
 
492
513
            base.Dispose(disposing);