LayoutFarm.CustomWidgets.HtmlBox.LoadHtmlFragmentString C# (CSharp) Method

LoadHtmlFragmentString() public method

public LoadHtmlFragmentString ( string fragmentHtmlString ) : void
fragmentHtmlString string
return void
        public void LoadHtmlFragmentString(string fragmentHtmlString)
        {
            if (htmlRenderBox == null)
            {
                this.waitingContentKind = WaitingContentKind.HtmlFragmentString;
                this.waitingHtmlString = fragmentHtmlString;
            }
            else
            {
                //just parse content and load 
                this.myHtmlCont = HtmlContainerHelper.CreateHtmlContainerFromFragmentHtml(this.htmlhost, fragmentHtmlString, htmlRenderBox);
                SetHtmlContainerEventHandlers();
                ClearWaitingContent();
            }
        }

Usage Example

 protected override void OnStartDemo(SampleViewport viewport)
 {
     htmlHost = HtmlHostCreatorHelper.CreateHtmlHost(viewport, null, null);
     ////==================================================
     //html box
     {
         HtmlBox lightHtmlBox = new HtmlBox(htmlHost, 800, 50);
         lightHtmlBox.SetLocation(50, 450);
         viewport.AddContent(lightHtmlBox);
         //light box can't load full html
         //all light boxs of the same lightbox host share resource with the host
         string html = @"<div>OK1</div><div>OK2</div>";
         //if you want to use full html-> use HtmlBox instead  
         lightHtmlBox.LoadHtmlFragmentString(html);
     }
     //==================================================  
     {
         HtmlBox lightHtmlBox2 = new HtmlBox(htmlHost, 800, 50);
         lightHtmlBox2.SetLocation(0, 60);
         viewport.AddContent(lightHtmlBox2);
         //light box can't load full html
         //all light boxs of the same lightbox host share resource with the host
         string html2 = @"<div>OK3</div><div>OK4</div>";
         //if you want to use ful l html-> use HtmlBox instead  
         lightHtmlBox2.LoadHtmlFragmentString(html2);
     }
     //==================================================  
     {
         HtmlBox lightHtmlBox3 = new HtmlBox(htmlHost, 800, 50);
         lightHtmlBox3.SetLocation(0, 100);
         viewport.AddContent(lightHtmlBox3);
         //fragment dom 
         //create dom then to thie light box
         lightHtmlBox3.LoadHtmlDom(CreateSampleHtmlDoc());
     }
     //================================================== 
     //textbox
     var textbox = new LayoutFarm.CustomWidgets.TextBox(400, 150, true);
     textbox.SetLocation(0, 200);
     viewport.AddContent(textbox);
     textbox.Focus();
 }
All Usage Examples Of LayoutFarm.CustomWidgets.HtmlBox::LoadHtmlFragmentString