public Flash(RegionOptions options) : base(options.Width, options.Height, options.Top, options.Left) { this._tempHtml = new TemporaryHtml(); this._backgroundImage = options.backgroundImage; this._backgroundColor = options.backgroundColor; this._backgroundTop = options.BackgroundTop + "px"; this._backgroundLeft = options.BackgroundLeft + "px"; this.GenerateHeadHtml(); string format = "\r\n <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' Width='{2}' Height='{3}' id='analog_clock' align='middle'>\r\n <param name='allowScriptAccess' value='sameDomain' />\r\n <param name='movie' value='{1}' />\r\n <param name='quality' value='high' />\r\n <param name='bgcolor' value='#000' />\r\n <param name='WMODE' value='transparent' />\r\n <embed src='{1}' quality='high' wmode='transparent' bgcolor='#ffffff' Width='{2}' Height='{3}' name='analog_clock' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\r\n </object>\r\n "; this._tempHtml.BodyContent = string.Format(format, new object[] { options.Uri, options.Uri, options.Width.ToString(), options.Height.ToString() }); this._webBrowser = new WebBrowser(); this._webBrowser.RenderSize = base.RenderSize; this._webBrowser.LoadCompleted += new LoadCompletedEventHandler(this._webBrowser_DocumentCompleted); this._webBrowser.Navigate(this._tempHtml.Path); }
/// <summary> /// Creates a Text display control /// </summary> /// <param name="options">Region Options for this control</param> public Text(RegionOptions options) : base(options.Width, options.Height, options.Top, options.Left) { // Collect some options from the Region Options passed in // and store them in member variables. _filePath = options.Uri; _direction = options.direction; _backgroundImage = options.backgroundImage; _backgroundColor = options.backgroundColor; _scaleFactor = options.ScaleFactor; _backgroundTop = options.BackgroundTop + "px"; _backgroundLeft = options.BackgroundLeft + "px"; _documentText = options.text; _scrollSpeed = options.scrollSpeed; _headJavaScript = options.javaScript; // Generate a temporary file to store the rendered object in. _tempHtml = new TemporaryHtml(); // Generate the Head Html and store to file. GenerateHeadHtml(); // Generate the Body Html and store to file. GenerateBodyHtml(); // Fire up a webBrowser control to display the completed file. _webBrowser = new WebBrowser(); _webBrowser.Height = options.Height; _webBrowser.Width = options.Width; _webBrowser.Margin = new Thickness(0,0,0,0); //_webBrowser.ScrollBarsEnabled = false; //_webBrowser.ScriptErrorsSuppressed = true; _webBrowser.LoadCompleted += (WebBrowserDocumentCompleted); _webBrowser.Navigated += delegate { HideScriptErrors(_webBrowser, true); }; // Navigate to temp file _webBrowser.Navigate(_tempHtml.Path); MediaCanvas.Children.Add(_webBrowser); }
/// <summary> /// Creates a Text display control /// </summary> /// <param name="options">Region Options for this control</param> public Text(RegionOptions options) : base(options.Width, options.Height, options.Top, options.Left) { // Collect some options from the Region Options passed in // and store them in member variables. _filePath = options.Uri; _direction = options.direction; _backgroundImage = options.backgroundImage; _backgroundColor = options.backgroundColor; _scaleFactor = options.ScaleFactor; _backgroundTop = options.BackgroundTop + "px"; _backgroundLeft = options.BackgroundLeft + "px"; _documentText = options.text; _scrollSpeed = options.scrollSpeed; _headJavaScript = options.javaScript; // Generate a temporary file to store the rendered object in. _tempHtml = new TemporaryHtml(); // Generate the Head Html and store to file. GenerateHeadHtml(); // Generate the Body Html and store to file. GenerateBodyHtml(); // Fire up a webBrowser control to display the completed file. _webBrowser = new WebBrowser(); _webBrowser.Height = options.Height; _webBrowser.Width = options.Width; _webBrowser.Margin = new Thickness(0, 0, 0, 0); //_webBrowser.ScrollBarsEnabled = false; //_webBrowser.ScriptErrorsSuppressed = true; _webBrowser.LoadCompleted += (WebBrowserDocumentCompleted); _webBrowser.Navigated += delegate { HideScriptErrors(_webBrowser, true); }; // Navigate to temp file _webBrowser.Navigate(_tempHtml.Path); MediaCanvas.Children.Add(_webBrowser); }
public Rss(RegionOptions options) : base(options.Width, options.Height, options.Top, options.Left) { if (string.IsNullOrEmpty(options.Uri)) { throw new ArgumentNullException("Uri", "The Uri for the RSS feed can not be empty"); } try { this._filePath = Uri.UnescapeDataString(options.Uri); } catch (Exception) { throw new ArgumentNullException("Uri", "The URI is invalid."); } this._direction = options.direction; this._backgroundImage = options.backgroundImage; this._backgroundColor = options.backgroundColor; this._copyrightNotice = options.copyrightNotice; this._mediaid = options.mediaid; this._scheduleId = options.scheduleId; this._layoutId = options.layoutId; this._scaleFactor = options.ScaleFactor; this._duration = options.Duration; this._updateInterval = options.updateInterval; this._scrollSpeed = options.scrollSpeed; this._numItems = Convert.ToInt32(options.Dictionary.Get("numItems", "0")); this._durationIsPerItem = Convert.ToInt32(options.Dictionary.Get("durationIsPerItem", "0")); this._takeItemsFrom = options.Dictionary.Get("takeItemsFrom", "start"); this._tempHtml = new TemporaryHtml(); this._backgroundTop = options.BackgroundTop + "px"; this._backgroundLeft = options.BackgroundLeft + "px"; this._documentText = options.text; this._documentTemplate = options.documentTemplate; this.GenerateHeadHtml(); this.PrepareRSS(); this._webBrowser = new WebBrowser(); if (this._rssReady) { this.LoadRssIntoTempFile(); this._webBrowser.Navigate(this._tempHtml.Path); } }
public Flash(RegionOptions options) : base(options.Width, options.Height, options.Top, options.Left) { _tempHtml = new TemporaryHtml(); _backgroundImage = options.backgroundImage; _backgroundColor = options.backgroundColor; _backgroundTop = options.BackgroundTop + "px"; _backgroundLeft = options.BackgroundLeft + "px"; // Create the HEAD of the document GenerateHeadHtml(); // Set the body string html = @" <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' Width='{2}' Height='{3}' id='analog_clock' align='middle'> <param name='allowScriptAccess' value='sameDomain' /> <param name='movie' value='{1}' /> <param name='quality' value='high' /> <param name='bgcolor' value='#000' /> <param name='WMODE' value='transparent' /> <embed src='{1}' quality='high' wmode='transparent' bgcolor='#ffffff' Width='{2}' Height='{3}' name='analog_clock' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /> </object> "; _tempHtml.BodyContent = string.Format(html, options.Uri, options.Uri, options.Width.ToString(), options.Height.ToString()); // Fire up a webBrowser control to display the completed file. _webBrowser = new WebBrowser(); _webBrowser.RenderSize = this.RenderSize; // _webBrowser.Size = this.Size; // _webBrowser.ScrollBarsEnabled = false; // _webBrowser.ScriptErrorsSuppressed = true; _webBrowser.LoadCompleted += (_webBrowser_DocumentCompleted); // Navigate to temp file _webBrowser.Navigate(_tempHtml.Path); }
/// <summary> /// Creates an RSS position with the RegionOptions parameter /// </summary> /// <param name="options"></param> public Rss(RegionOptions options) : base(options.Width, options.Height, options.Top, options.Left) { if (String.IsNullOrEmpty(options.Uri)) { throw new ArgumentNullException("Uri", "The Uri for the RSS feed can not be empty"); } // Try to make a URI out of the file path try { _filePath = Uri.UnescapeDataString(options.Uri); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message, "Rss"); throw new ArgumentNullException("Uri", "The URI is invalid."); } Debug.WriteLine("Ticker URL: " + _filePath + ". Options count: " + options.Dictionary.Count.ToString()); // Set the parameters based on the RegionOptions _direction = options.direction; _backgroundImage = options.backgroundImage; _backgroundColor = options.backgroundColor; _copyrightNotice = options.copyrightNotice; _mediaid = options.mediaid; _scheduleId = options.scheduleId; _layoutId = options.layoutId; _scaleFactor = options.ScaleFactor; _duration = options.Duration; // Update interval and scrolling speed _updateInterval = options.updateInterval; _scrollSpeed = options.scrollSpeed; Debug.WriteLine(String.Format("Scrolling Speed: {0}, Update Interval: {1})", _scrollSpeed.ToString(), _updateInterval.ToString()), "Rss - Constructor"); // Items to show and duration _numItems = Convert.ToInt32(options.Dictionary.Get("numItems", "0")); _durationIsPerItem = Convert.ToInt32(options.Dictionary.Get("durationIsPerItem", "0")); _takeItemsFrom = options.Dictionary.Get("takeItemsFrom", "start"); // Generate a temporary file to store the rendered object in. _tempHtml = new TemporaryHtml(); // Set up the backgrounds _backgroundTop = options.BackgroundTop + "px"; _backgroundLeft = options.BackgroundLeft + "px"; _documentText = options.text; _documentTemplate = options.documentTemplate; // Generate the HTML for the HEAD of the document GenerateHeadHtml(); // Prepare the RSS PrepareRSS(); // Create a webbrowser to take the temp file loc _webBrowser = new WebBrowser(); //_webBrowser.ScriptErrorsSuppressed = true; //_webBrowser.Size = this.Size; //_webBrowser.ScrollBarsEnabled = false; //_webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); // Is the RSS ready to be loaded into the temp location? if (_rssReady) { // Load the RSS LoadRssIntoTempFile(); // Navigate to temp file _webBrowser.Navigate(_tempHtml.Path); } }