Esempio n. 1
0
        protected override void OnStartDemo(SampleViewport viewport)
        {
            this.sampleViewport = viewport;
            imageContentMan     = new ContentManagers.ImageContentManager(viewport.Platform);
            imageContentMan.ImageLoadingRequest += (s, e) =>
            {
                e.SetResultImage(LoadBitmap(e.ImagSource));
            };
            //init host
            myHtmlHost = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
                                                              (s, e) => this.imageContentMan.AddRequestImage(e.ImageBinder),
                                                              (s, e) => { });
            //-----------------------------------------------------

            this.groundHtmlBox = new HtmlBox(myHtmlHost, 800, 600);
            string html = @"<div></div>";

            //if you want to use full html-> use HtmlBox instead

            this.sampleViewport.AddContent(groundHtmlBox);
            //-----------------------------------------------------
            groundHtmlBox.LoadHtmlFragmentString(html);
            this.groundHtmlDoc = groundHtmlBox.HtmlContainer.WebDocument as HtmlDocument;
            OnHtmlHostCreated();
        }
Esempio n. 2
0
        public virtual void OnStartDemo(SampleViewport viewport)
        {
            //html box
            var contentMx = new LayoutFarm.ContentManagers.ImageContentManager();

            contentMx.ImageLoadingRequest += contentMx_ImageLoadingRequest;


            var host = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
                                                            (s, e) => contentMx.AddRequestImage(e.ImageBinder),
                                                            contentMx_LoadStyleSheet);

            //1. htmlbox
            int viewportW = viewport.ViewportControl.Width;
            int viewportH = viewport.ViewportControl.Height;

            htmlBox = new HtmlBox(host, viewportW, viewportH);
            viewport.AddContent(htmlBox);



            if (htmltext == null)
            {
                htmltext = @"<html><head></head><body>NOT FOUND!</body></html>";
            }

            htmlBox.LoadHtmlString(htmltext);
        }
Esempio n. 3
0
        public void StartModule(LayoutFarm.SampleViewport sampleViewport)
        {
            this.viewport = sampleViewport;
            dzBoardModule = new DesignBoardModule();

            menuModule = new MenuBoardModule();
            menuModule.menuItemClick += new EventHandler <MenuItemClickEventArgs>(menuModule_menuItemClick);


            var contentMx = new LayoutFarm.ContentManagers.ImageContentManager();

            contentMx.ImageLoadingRequest += contentMx_ImageLoadingRequest;
            //app specific here
            documentRootPath = System.Windows.Forms.Application.ExecutablePath;

            this.htmlHost = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
                                                                 (s, e) => contentMx.AddRequestImage(e.ImageBinder),
                                                                 contentMx_LoadStyleSheet);

            //1. design board
            dzBoardModule.StartModule(htmlHost, this.viewport);
            ////2. canvas board
            //drawingBoard.StartModule(htmlHost, this.viewport);
            //3. menu
            menuModule.StartModule(htmlHost, this.viewport);

            //------------------------------------------------------
            //context knowledge***
            //------------------------------------------------------
        }
 HtmlBoxes.HtmlHost GetHtmlHost(SampleViewport viewport)
 {
     if (htmlHost == null)
     {
         htmlHost = HtmlHostCreatorHelper.CreateHtmlHost(viewport, null, null);
         var htmlBoxContentMx = new HtmlHostContentManager();
         var contentMx = new LayoutFarm.ContentManagers.ImageContentManager();
         contentMx.ImageLoadingRequest += contentMx_ImageLoadingRequest;
         htmlBoxContentMx.AddImageContentMan(contentMx);
         htmlBoxContentMx.Bind(htmlHost);
     }
     return htmlHost;
 }
Esempio n. 5
0
 HtmlBoxes.HtmlHost GetHtmlHost(SampleViewport viewport)
 {
     if (htmlHost == null)
     {
         htmlHost = HtmlHostCreatorHelper.CreateHtmlHost(viewport, null, null);
         var htmlBoxContentMx = new HtmlHostContentManager();
         var contentMx        = new LayoutFarm.ContentManagers.ImageContentManager();
         contentMx.ImageLoadingRequest += contentMx_ImageLoadingRequest;
         htmlBoxContentMx.AddImageContentMan(contentMx);
         htmlBoxContentMx.Bind(htmlHost);
     }
     return(htmlHost);
 }
Esempio n. 6
0
        protected override void OnStartDemo(SampleViewport viewport)
        {
            //html box
            var contentMx = new LayoutFarm.ContentManagers.ImageContentManager();
            contentMx.ImageLoadingRequest += contentMx_ImageLoadingRequest;
            var host = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
                (s, e) => contentMx.AddRequestImage(e.ImageBinder),
                contentMx_LoadStyleSheet);
            htmlBox = new HtmlBox(host, 1024, 800);
            viewport.AddContent(htmlBox);
            if (htmltext == null)
            {
                htmltext = @"<html><head></head><body>NOT FOUND!</body></html>";
            }

            htmlBox.LoadHtmlString(htmltext);
        }
Esempio n. 7
0
        protected override void OnStartDemo(SampleViewport viewport)
        {
            //html box
            var contentMx = new LayoutFarm.ContentManagers.ImageContentManager();

            contentMx.ImageLoadingRequest += contentMx_ImageLoadingRequest;
            var host = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
                                                            (s, e) => contentMx.AddRequestImage(e.ImageBinder),
                                                            contentMx_LoadStyleSheet);

            htmlBox = new HtmlBox(host, 1024, 800);
            viewport.AddContent(htmlBox);
            if (htmltext == null)
            {
                htmltext = @"<html><head></head><body>NOT FOUND!</body></html>";
            }

            htmlBox.LoadHtmlString(htmltext);
        }
Esempio n. 8
0
        public virtual void OnViewportReady(SampleViewport viewport)
        {
            //html box
            var contentMx = new LayoutFarm.ContentManagers.ImageContentManager();
            contentMx.ImageLoadingRequest += contentMx_ImageLoadingRequest;
            var host = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
                (s, e) => contentMx.AddRequestImage(e.ImageBinder),
                contentMx_LoadStyleSheet);
            //1. htmlbox
            int viewportW = viewport.ViewportControl.Width;
            int viewportH = viewport.ViewportControl.Height;
            htmlBox = new HtmlBox(host, viewportW, viewportH);
            viewport.AddContent(htmlBox);
            if (htmltext == null)
            {
                htmltext = @"<html><head></head><body>NOT FOUND!</body></html>";
            }

            htmlBox.LoadHtmlString(htmltext);
        }
Esempio n. 9
0
 public void StartModule(LayoutFarm.SampleViewport sampleViewport)
 {
     this.viewport = sampleViewport;
     dzBoardModule = new DesignBoardModule();
     menuModule = new MenuBoardModule();
     menuModule.menuItemClick += new EventHandler<MenuItemClickEventArgs>(menuModule_menuItemClick);
     var contentMx = new LayoutFarm.ContentManagers.ImageContentManager();
     contentMx.ImageLoadingRequest += contentMx_ImageLoadingRequest;
     //app specific here
     documentRootPath = System.Windows.Forms.Application.ExecutablePath;
     this.htmlHost = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
         (s, e) => contentMx.AddRequestImage(e.ImageBinder),
         contentMx_LoadStyleSheet);
     //1. design board
     dzBoardModule.StartModule(htmlHost, this.viewport);
     ////2. canvas board
     //drawingBoard.StartModule(htmlHost, this.viewport);
     //3. menu
     menuModule.StartModule(htmlHost, this.viewport);
     //------------------------------------------------------
     //context knowledge*** 
     //------------------------------------------------------
 }
Esempio n. 10
0
        protected override void OnStartDemo(SampleViewport viewport)
        {
            this.sampleViewport = viewport;
            imageContentMan = new ContentManagers.ImageContentManager();
            imageContentMan.ImageLoadingRequest += (s, e) =>
            {
                e.SetResultImage(LoadBitmap(e.ImagSource));
            };
            //init host 
            myHtmlHost = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
              (s, e) => this.imageContentMan.AddRequestImage(e.ImageBinder),
              (s, e) => { });
            //-----------------------------------------------------

            this.groundHtmlBox = new HtmlBox(myHtmlHost, 800, 600);
            string html = @"<div></div>";
            //if you want to use full html-> use HtmlBox instead  

            this.sampleViewport.AddContent(groundHtmlBox);
            //----------------------------------------------------- 
            groundHtmlBox.LoadHtmlFragmentString(html);
            this.groundHtmlDoc = groundHtmlBox.HtmlContainer.WebDocument as HtmlDocument;
            OnHtmlHostCreated();
        }