public LoadHtmlDom ( LayoutFarm doc, string defaultCss ) : void | ||
doc | LayoutFarm | |
defaultCss | string | |
return | void |
protected override void OnStartDemo(HtmlPanel panel) { var htmldoc = panel.HtmlHost.CreatePresentationHtmlDoc(); var rootNode = htmldoc.RootNode; //1. create body node // and content //style 2, lambda and adhoc attach event rootNode.AddChild("body", body => { body.AddChild("div", div => { div.AddChild("span", span => { span.AddTextContent("ABCD"); //3. attach event to specific span span.AttachEvent(UIEventName.MouseDown, e => { #if DEBUG // System.Diagnostics.Debugger.Break(); //test change span property //clear prev content and add new text content span.ClearAllElements(); span.AddTextContent("XYZ0001"); //affect layout of html dom panel.ForceRefreshHtmlDomChange(htmldoc); #endif e.StopPropagation(); }); }); div.AddChild("span", span => { span.AddTextContent("EFGHIJK"); }); //---------------------- div.AttachEvent(UIEventName.MouseDown, e => { #if DEBUG //this will not print //if e has been stop by its child // System.Diagnostics.Debugger.Break(); //Console.WriteLine("div"); #endif }); }); }); //2. add to view panel.LoadHtmlDom(htmldoc, LayoutFarm.Composers.CssDefaults.DefaultStyleSheet); }
protected override void OnStartDemo(HtmlPanel panel) { var htmldoc = panel.HtmlHost.CreatePresentationHtmlDoc(); var rootNode = htmldoc.RootNode; //1. create body node // and content //style 2, lambda and adhoc attach event rootNode.AddChild("body", body => { body.AddChild("div", div => { div.AddChild("span", span => { span.AddTextContent("ABCD"); //3. attach event to specific span span.AttachMouseDownEvent(e => { #if DEBUG // System.Diagnostics.Debugger.Break(); //test change span property //clear prev content and add new text content span.ClearAllElements(); span.AddTextContent("XYZ0001"); #endif e.StopPropagation(); }); }); div.AddChild("span", span => { span.AddTextContent("EFGHIJK"); span.AttachMouseDownEvent(e => { span.ClearAllElements(); span.AddTextContent("LMNOP0003"); }); }); //---------------------- div.AttachEvent(UIEventName.MouseDown, e => { #if DEBUG //this will not print //if e has been stop by its child // System.Diagnostics.Debugger.Break(); //Console.WriteLine("div"); #endif }); }); }); //2. add to view panel.LoadHtmlDom(htmldoc, LayoutFarm.Composers.CssDefaults.DefaultStyleSheet); }
protected override void OnStartDemo(HtmlPanel panel) { var htmldoc = panel.HtmlHost.CreatePresentationHtmlDoc(); var rootNode = htmldoc.RootNode; //1. create body node // and content //style 2, lambda and adhoc attach event rootNode.AddChild("body", body => { body.AddChild("div", div => { div.AddChild("span", span => { span.AddTextContent("ABCD"); //3. attach event to specific span span.AttachEvent(UIEventName.MouseDown, e => { //------------------------------- //mousedown on specific span ! //------------------------------- #if DEBUG // System.Diagnostics.Debugger.Break(); //Console.WriteLine("span"); #endif //test stop propagation e.StopPropagation(); }); }); //---------------------- div.AttachEvent(UIEventName.MouseDown, e => { #if DEBUG //this will not print //if e has been stop by its child // System.Diagnostics.Debugger.Break(); //Console.WriteLine("div"); #endif }); }); }); //2. add to view panel.LoadHtmlDom(htmldoc, LayoutFarm.Composers.CssDefaults.DefaultStyleSheet); }
protected override void OnStartDemo(HtmlPanel panel) { var htmldoc = panel.HtmlHost.CreatePresentationHtmlDoc(); var rootNode = htmldoc.RootNode; //1. create body node // and content DomElement body, div, span; //style 1 rootNode.AddChild("body") .AddChild("div", out div) .AddChild("span", out span); //-------------------------------------------- span.AddTextContent("ABCD"); //2. add to view panel.LoadHtmlDom(htmldoc, LayoutFarm.Composers.CssDefaults.DefaultStyleSheet); //3. attach event to specific span span.AttachEvent(UIEventName.MouseDown, e => { //------------------------------- //mousedown on specific span ! //------------------------------- #if DEBUG // System.Diagnostics.Debugger.Break(); //Console.WriteLine("span"); #endif //test stop propagation e.StopPropagation(); }); div.AttachEvent(UIEventName.MouseDown, e => { #if DEBUG //this will not print //if e has been stop by its child // System.Diagnostics.Debugger.Break(); //Console.WriteLine("div"); #endif }); }
protected override void OnStartDemo(HtmlPanel panel) { var htmldoc = panel.HtmlHost.CreatePresentationHtmlDoc(); var rootNode = htmldoc.RootNode; //1. create body node // and content //style 2, lambda and adhoc attach event rootNode.AddChild("body", body => { body.AddChild("div", div => { div.AddChild("span", span => { span.AddTextContent("ABCD"); //3. attach event to specific span span.AttachMouseDownEvent(e => { #if DEBUG var s_span = new EaseScriptElement(span); s_span.ChangeFontColor(PixelFarm.Drawing.Color.Blue); #endif e.StopPropagation(); }); }); div.AddChild("span", span => { span.AddTextContent("EFGHIJK"); span.AttachMouseDownEvent(e => { span.ClearAllElements(); span.AddTextContent("LMNOP0003"); var s_span = new EaseScriptElement(span); s_span.ChangeFontColor(PixelFarm.Drawing.Color.Red); s_span.ChangeBackgroundColor(PixelFarm.Drawing.Color.Yellow); }); span.AttachMouseUpEvent(e => { var s_span = new EaseScriptElement(span); s_span.ChangeFontColor(PixelFarm.Drawing.Color.Black); s_span.ChangeBackgroundColor(PixelFarm.Drawing.Color.White); }); }); //---------------------- div.AttachEvent(UIEventName.MouseDown, e => { #if DEBUG //this will not print //if e has been stop by its child // System.Diagnostics.Debugger.Break(); //Console.WriteLine("div"); #endif }); }); }); //2. add to view panel.LoadHtmlDom(htmldoc, LayoutFarm.Composers.CssDefaults.DefaultStyleSheet); }
protected override void OnStartDemo(HtmlPanel panel) { var htmldoc = panel.HtmlHost.CreatePresentationHtmlDoc(); var rootNode = htmldoc.RootNode; //1. create body node // and content //style 2, lambda and adhoc attach event rootNode.AddChild("body", body => { body.AddChild("div", div => { div.AddChild("span", span => { span.AddTextContent("ABCD"); //3. attach event to specific span span.AttachMouseDownEvent(e => { #if DEBUG var s_span = new EaseScriptElement(span); s_span.ChangeFontColor(PixelFarm.Drawing.Color.Blue); #endif e.StopPropagation(); }); }); div.AddChild("span", span => { span.AddTextContent("EFGHIJK"); span.AttachMouseDownEvent(e => { span.ClearAllElements(); span.AddTextContent("LMNOP0003"); var s_span = new EaseScriptElement(span); s_span.ChangeFontColor(PixelFarm.Drawing.Color.Red); s_span.ChangeBackgroundColor(PixelFarm.Drawing.Color.Yellow); }); span.AttachMouseUpEvent(e => { var s_span = new EaseScriptElement(span); s_span.ChangeFontColor(PixelFarm.Drawing.Color.Black); s_span.ChangeBackgroundColor(PixelFarm.Drawing.Color.White); }); }); //---------------------- div.AttachEvent(UIEventName.MouseDown, e => { #if DEBUG //this will not print //if e has been stop by its child // System.Diagnostics.Debugger.Break(); //Console.WriteLine("div"); #endif }); }); }); //2. add to view panel.LoadHtmlDom(htmldoc, LayoutFarm.Composers.CssDefaults.DefaultStyleSheet); }