コード例 #1
0
        public void Init(Core.Media media)
        {
            website = media as WordsLive.Core.WebSite;

            if (website == null)
            {
                throw new ArgumentException("media must not be null and of type WebSite");
            }

            this.urlTextBox.Text = website.Url;

            presentation = Controller.PresentationManager.CreatePresentation <AwesomiumPresentation>();
            presentation.Load(true);
            presentation.Control.Web.DocumentReady += (sender, args) =>
            {
                if (isBible)
                {
                    var result = presentation.Control.Web.ExecuteJavascriptWithResult("(document.getElementById('searchSelect') != null) ? document.getElementById('searchSelect').children[1].children[0].attributes['value'].value : 'NULL'");
                    if (result.ToString() != "NULL")
                    {
                        bibleTextBox.Text = result.ToString();
                    }

                    // TODO: maybe use the following when it's supported:
                    // document.getElementById('pageMain').style.webkitHyphens = 'auto';
                    // document.getElementById('pageMain').style.textAlign = 'justify';

                    // adjust style and scroll selection into view (this is not done automatically by mobile version)
                    presentation.Control.Web.ExecuteJavascript(@"
					document.getElementById('pageMain').style.fontSize = '15pt';
					document.getElementById('pageMain').style.marginLeft = '3%';
					document.getElementById('pageMain').style.marginRight = '3%';
					
					var marked = document.getElementsByClassName('bgcolor_overlay');
					if (marked.length > 0)
					{
						if (marked[0].previousSibling != null && marked[0].previousSibling.tagName == 'H3')
							marked[0].previousSibling.scrollIntoView(true);
						else
							marked[0].scrollIntoView(true);
					}"                    );

                    /*presentation.Control.Web.ExecuteJavascript(@"
                     *              document.getElementsByClassName('top')[0].style.display = 'none';
                     *              document.getElementsByClassName('navi')[0].style.display = 'none';
                     *              document.getElementsByClassName('navi')[1].style.display = 'none';");*/
                }
            };

            presentation.Control.Web.LoadingFrame += (s, args) =>
            {
                // TODO
                this.urlTextBox.Text = args.Url.ToString();
            };
        }
コード例 #2
0
 public void Init(Core.Media media)
 {
     if (media is SlideshowMedia)
     {
         this.media = (SlideshowMedia)media;
         pres       = SlideshowPresentationFactory.CreatePresentation(this.media);
         SetupEventListeners();
         pres.Load();
     }
     else
     {
         throw new ArgumentException("media is not a valid slideshow media.");
     }
 }
コード例 #3
0
 public void Init(Core.Media media)
 {
     if (media is ImagesMedia)
     {
         this.media            = (ImagesMedia)media;
         pres                  = Controller.PresentationManager.CreatePresentation <ImagesPresentation>();
         pres.LoadingFinished += pres_LoadingFinished;
         Controller.PresentationManager.CurrentPresentation = pres;
         this.DataContext = this;
         if (this.media.Images.Count > 0)
         {
             this.slideListView.SelectedIndex = 0;
         }
     }
     else
     {
         throw new ArgumentException("media is not a valid images media.");
     }
 }
コード例 #4
0
        public void Init(Core.Media media)
        {
            this.media = media as AudioVideoMedia;

            if (this.media == null)
            {
                throw new ArgumentException("media must not be null and of type VideoMedia");
            }

            if (Properties.Settings.Default.UseVlc && VlcController.IsAvailable)
            {
                var vlc = Controller.PresentationManager.CreatePresentation <AudioVideoPresentation <VlcWrapper> >();
                Load(vlc);
            }
            else
            {
                var wpf = Controller.PresentationManager.CreatePresentation <AudioVideoPresentation <WpfWrapper> >();
                Load(wpf);
            }
        }