Example #1
0
        //-------------------------------------------------------
        internal void RegisterElementById(DomElement element)
        {
            if (registerElementsById == null) this.registerElementsById = new Dictionary<string, DomElement>();

            //replace exisitng if exists *** 
            registerElementsById[element.AttrElementId] = element;
        }
Example #2
0
        public DomElement GetTitleNode(DomElement hostNode)
        {
            //-------------------------------------
            if (titleNode != null) return titleNode;
            //create dom node
            var ownerdoc = hostNode.OwnerDocument;
            this.titleNode = ownerdoc.CreateElement("div");
            titleNode.SetAttribute("style", "display:inline");
            titleNode.AddChild("span", span =>
            {
                if (PageTitle == null)
                {
                    span.AddTextContent("");
                }
                else
                {
                    span.AddTextContent(this.PageTitle);
                }
                span.AttachMouseDownEvent(e =>
                {
                    if (this.OwnerContainer != null)
                    {
                        this.OwnerContainer.ChildNotifyTabMouseDown(this);
                    }
                });
            });
            ////mouse down on title
            //titleNode.AttachMouseDownEvent(e =>
            //{


            //});
            //-------------------------------------
            return titleNode;
        }
 public static DomElement AddChild(this DomElement elem, string elementName, out DomElement elemExit)
 {
     var newchild = elem.OwnerDocument.CreateElement(elementName);
     elem.AddChild(newchild);
     elemExit = newchild;
     return newchild;
 }
Example #4
0
        public DomElement GetPresentationDomNode(DomElement hostNode)
        {
            if (pnode != null) return pnode;
            //-----------------------------------
            var doc = hostNode.OwnerDocument;
            this.pnode = doc.CreateElement("div");
            pnode.AddChild("img", item_icon =>
            {
                menuIcon = item_icon;
                menuIcon.AttachMouseDownEvent(e =>
                {
                    //****
                    this.MaintenanceParentOpenState();
                    if (this.IsOpened)
                    {
                        this.Close();
                    }
                    else
                    {
                        this.Open();
                    }
                    e.StopPropagation();
                });
                menuIcon.AttachMouseUpEvent(e =>
                {
                    this.UnmaintenanceParentOpenState();
                    e.StopPropagation();
                });
                menuIcon.AttachEventOnMouseLostFocus(e =>
                {
                    if (!this.MaintenaceOpenState)
                    {
                        this.CloseRecursiveUp();
                    }
                });
            });
            pnode.AddChild("span", content =>
            {
                if (menuItemText != null)
                {
                    pnode.AddTextContent(this.menuItemText);
                }
            });
            //--------------------------------------------------------
            //create simple menu item box 

            if (childItems != null)
            {
                floatPart = new MenuBox(400, 200);
                int j = childItems.Count;
                for (int i = 0; i < j; ++i)
                {
                    floatPart.AddChildBox(childItems[i]);
                }
            }
            return pnode;
        }
Example #5
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            //TODO: use template engine, 
            //ideas:  AngularJS style ?

            //1. create body node             
            // and content   
            //style 2, lambda and adhoc attach event  
            if (pnode != null) return pnode;
            //---------------------------------------------------
            pnode = htmldoc.CreateElement("div");
            pnode.AddChild("img", img =>
            {
                //init 
                bool is_close = true;
                img.SetAttribute("src", "../../Demo/arrow_close.png");
                img.AttachMouseDownEvent(e =>
                {
                    img.SetAttribute("src", is_close ?
                        "../../Demo/arrow_open.png" :
                        "../../Demo/arrow_close.png");
                    is_close = !is_close;
                    e.StopPropagation();
                });
            });
            //pnode.AddChild("img", img =>
            //{

            //    //change style
            //    bool is_close = true;
            //    img.SetAttribute("src", "../../Demo/arrow_close.png");
            //    //3. attach event to specific span 
            //    img.AttachMouseDownEvent(e =>
            //    {
            //        img.SetAttribute("src", is_close ?
            //            "../../Demo/arrow_open.png" :
            //            "../../Demo/arrow_close.png");

            //        is_close = !is_close;
            //        e.StopPropagation();

            //        this.InvalidateGraphics();
            //    });

            //});
            pnode.AddChild("span", span =>
            {
                span.AddTextContent(this.checkBoxText);
            });
            return pnode;
        }
Example #6
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (pnode != null) return pnode;
            //create primary presentation node

            pnode = htmldoc.CreateElement("div");
            pnode.SetAttribute("style", "font:10pt tahoma");
            int j = treeNodes.Count;
            for (int i = 0; i < j; ++i)
            {
                pnode.AddChild(treeNodes[i].GetPrimaryPresentationNode(pnode));
            }
            return pnode;
        }
Example #7
0
 CssBox CreateCustomCssBox(CssBox parent,
                           LayoutFarm.WebDom.DomElement tag,
                           LayoutFarm.Css.BoxSpec boxspec)
 {
     for (int i = generators.Count - 1; i >= 0; --i)
     {
         var newbox = generators[i].CreateCssBox(tag, parent, boxspec, this);
         if (newbox != null)
         {
             return(newbox);
         }
     }
     return(null);
 }
Example #8
0
 void SetupNodeIconBehaviour(DomElement uiNodeIcon)
 {
     uiNodeIcon.AttachMouseDownEvent(e =>
     {
         if (this.IsOpen)
         {
             //then close
             this.Collapse();
         }
         else
         {
             this.Expand();
         }
     });
 }
Example #9
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (presentationNode != null)
            {
                return presentationNode;
            }
            //-------------------
            presentationNode = htmldoc.CreateElement("div");
            presentationNode.AddChild("div", div =>
            {
                div.SetAttribute("style", "font:10pt tahoma;");
                div.AddChild("img", img =>
                {
                    //init 
                    img.SetAttribute("src", "../../Demo/arrow_close.png");
                    img.AttachMouseDownEvent(e =>
                    {
                        //img.SetAttribute("src", this.IsOpen ?
                        //    "../../Demo/arrow_open.png" :
                        //    "../../Demo/arrow_close.png");
                        ////------------------------------

                        if (this.IsOpen)
                        {
                            img.SetAttribute("src", "../../Demo/arrow_close.png");
                            this.CloseHinge();
                        }
                        else
                        {
                            img.SetAttribute("src", "../../Demo/arrow_open.png");
                            this.OpenHinge();
                        }

                        //----------------------------- 
                        e.StopPropagation();
                    });
                });
            });
            //-------------------

            this.floatPartDomElement = this.CreateFloatPartDom(htmldoc);
            return presentationNode;
        }
Example #10
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (pnode != null) return pnode;
            //----------------------------------
            pnode = htmldoc.CreateElement("div");
            pnode.SetAttribute("style", "display:inline-block;width:" + Width + "px;height:" + this.Height + "px;");
            pnode.AddChild("div", div2 =>
            {
                //init
                div2.SetAttribute("style", "padding:5px;background-color:#dddddd;");
                div2.AddChild("span", span =>
                {
                    span.AddTextContent(this.buttonText);
                });
                //------------------------------

                div2.AttachMouseDownEvent(e =>
                {
#if DEBUG
                    div2.dbugMark = 1;
#endif
                    // div2.SetAttribute("style", "padding:5px;background-color:#aaaaaa;");
                    EaseScriptElement ee = new EaseScriptElement(div2);
                    ee.ChangeBackgroundColor(Color.FromArgb(0xaa, 0xaa, 0xaa));
                    //div2.SetAttribute("style", "padding:5px;background-color:#aaaaaa;");
                    e.StopPropagation();
                });
                div2.AttachMouseUpEvent(e =>
                {
#if DEBUG
                    div2.dbugMark = 2;
#endif
                    //div2.SetAttribute("style", "padding:5px;background-color:#dddddd;");

                    EaseScriptElement ee = new EaseScriptElement(div2);
                    ee.ChangeBackgroundColor(Color.FromArgb(0xdd, 0xdd, 0xdd));
                    e.StopPropagation();
                });
            });
            return pnode;
        }
        public override LayoutFarm.HtmlBoxes.CssBox CreateCssBox(
            DomElement domE,
            LayoutFarm.HtmlBoxes.CssBox parentBox,
            BoxSpec spec,
            HtmlHost host)
        {
            switch (domE.Name)
            {
                case "input":
                    {
                        var inputBox = CreateInputBox(domE, parentBox, spec, myHost.RootGfx, host);
                        if (inputBox != null)
                        {
                            return inputBox;
                        }
                    }
                    break;
                case "canvas":
                    {
                        //test only
                        //TODO: review here
                        var canvas = new LayoutFarm.CustomWidgets.MiniAggCanvasBox(400, 400);
                        var wrapperBox = CreateWrapper(
                             canvas,
                             canvas.GetPrimaryRenderElement(myHost.RootGfx),
                             spec, true);
                        parentBox.AppendChild(wrapperBox);
                        return wrapperBox;
                    }
            }

            //default unknown
            var simpleBox = new LayoutFarm.CustomWidgets.SimpleBox(100, 20);
            simpleBox.BackColor = PixelFarm.Drawing.Color.LightGray;
            var wrapperBox2 = CreateWrapper(
                               simpleBox,
                               simpleBox.GetPrimaryRenderElement(myHost.RootGfx),
                               spec, false);
            parentBox.AppendChild(wrapperBox2);
            return wrapperBox2;
        }
Example #12
0
        public DomElement GetPageBody(DomElement hostNode)
        {
            if (contentNode != null) return contentNode;
            var ownerdoc = hostNode.OwnerDocument;
            contentNode = ownerdoc.CreateElement("div");
            if (this.contentUI != null)
            {
                //add content ui to the body of page
                //creat html wrapper for this ...        

                throw new NotImplementedException();
                //reimpl here again
                //HtmlDocument htmldoc = (HtmlDocument)ownerdoc;
                //var wrapperElement = htmldoc.CreateWrapperElement("x",(RootGraphic rootgfx, out RenderElement renderE, out object controller) =>
                //{   
                //    renderE = contentUI.GetPrimaryRenderElement(rootgfx);
                //    controller = contentUI;

                //});
                //contentNode.AddChild(wrapperElement);

            }
            return contentNode;
        }
        //public CssBox BuildCssRenderTree(
        //   HtmlElement hostElement,
        //   HtmlElement domElement,
        //   RenderElement containerElement)
        //{
        //    var rootgfx = containerElement.Root;
        //    IFonts ifonts = rootgfx.SampleIFonts;
        //    HtmlDocument htmldoc = domElement.OwnerDocument as HtmlDocument;
        //    HtmlElement startAtHtmlElement = (HtmlElement)domElement;

        //    htmldoc.SetDocumentState(DocumentState.Building);
        //    TopDownActiveCssTemplate activeTemplate = new TopDownActiveCssTemplate(htmldoc.CssActiveSheet);
        //    PrepareStylesAndContentOfChildNodes(startAtHtmlElement, activeTemplate);

        //    //1.css box for doc root: create new if not exist
        //    CssBox docRoot = HtmlElement.InternalGetPrincipalBox((HtmlElement)htmldoc.RootNode);
        //    if (docRoot == null)
        //    {
        //        docRoot = HtmlHost.CreateBridgeBox(ifonts, containerElement, rootgfx);
        //        ((HtmlElement)htmldoc.RootNode).SetPrincipalBox(docRoot);
        //    }

        //    //----------------------------------------------------------------  
        //    CssBox bridgeBox = HtmlHost.CreateBridgeBox(ifonts, containerElement, rootgfx);
        //    docRoot.AppendChild(bridgeBox);
        //    domElement.SetPrincipalBox(bridgeBox);
        //    //----------------------------------------------------------------  

        //    this.htmlHost.UpdateChildBoxes(startAtHtmlElement, true);
        //    htmldoc.SetDocumentState(DocumentState.Idle);
        //    //----------------------------------------------------------------  
        //    //SetTextSelectionStyle(htmlCont, cssData);
        //    return bridgeBox;
        //}


        //----------------------------------------------------------------
        public void RefreshCssTree(DomElement startAt)
        {
            HtmlElement startAtElement = (HtmlElement)startAt;
            startAtElement.OwnerDocument.SetDocumentState(DocumentState.Building);
            //----------------------------------------------------------------     
            //clear active template

            TopDownActiveCssTemplate activeTemplate = new TopDownActiveCssTemplate(((HtmlDocument)startAtElement.OwnerDocument).CssActiveSheet);
            PrepareStylesAndContentOfChildNodes(startAtElement, activeTemplate);
            CssBox existingCssBox = HtmlElement.InternalGetPrincipalBox(startAtElement);
            if (existingCssBox != null)
            {
                existingCssBox.Clear();
            }
            //----------------------------------------------------------------  


            this.htmlHost.UpdateChildBoxes(startAtElement, false);
            startAtElement.OwnerDocument.SetDocumentState(DocumentState.Idle);
            //----------------------------------------------------------------   
        }
        LayoutFarm.HtmlBoxes.CssBox CreateInputBox(DomElement domE,
            LayoutFarm.HtmlBoxes.CssBox parentBox,
            BoxSpec spec,
            LayoutFarm.RootGraphic rootgfx, HtmlHost host)
        {
            var typeAttr = domE.FindAttribute("type");
            if (typeAttr != null)
            {
                switch (typeAttr.Value)
                {
                    case "text":
                        {
                            // user can specific width of textbox 
                            //var textbox = new LayoutFarm.CustomWidgets.TextBox(100, 17, false);
                            var textbox = new LayoutFarm.CustomWidgets.TextBoxContainer(100, 20, false);
                            var wrapperBox = CreateWrapper(
                                 textbox,
                                 textbox.GetPrimaryRenderElement(rootgfx),
                                 spec, true);
                            //place holder support
                            var placeHolderAttr = domE.FindAttribute("placeholder");
                            if (placeHolderAttr != null)
                            {
                                textbox.PlaceHolderText = placeHolderAttr.Value;
                            }
                            parentBox.AppendChild(wrapperBox);
                            return wrapperBox;
                        }
                    case "button":
                        {
                            //use subdom? technique
                            //todo: review the technique here
                            var button = new HtmlWidgets.Button(60, 30);
                            var ihtmlElement = domE as LayoutFarm.WebDom.IHtmlElement;
                            if (ihtmlElement != null)
                            {
                                button.Text = ihtmlElement.innerHTML;
                            }
                            else
                            {
                                button.Text = "";
                            }
                            button.Text = "testButton";
                            DomElement buttonDom = button.GetPresentationDomNode((HtmlDocument)domE.OwnerDocument);
                            CssBox buttonCssBox = host.CreateBox2(parentBox, (WebDom.Impl.HtmlElement)buttonDom, true); // CreateCssBox(buttonDom, parentBox, spec, host);
                            //var ui = button.GetPrimaryUIElement(this.myHost);

                            //var wrapperBox = CreateWrapper(
                            //    button,
                            //    ui.GetPrimaryRenderElement(rootgfx),
                            //    spec, true);
                            //parentBox.AppendChild(wrapperBox);
                            //return wrapperBox;

                            parentBox.AppendChild(buttonCssBox);
                            return buttonCssBox;
                        }
                    case "textbox":
                        {
                            var textbox = new LayoutFarm.CustomWidgets.TextBox(100, 17, false);
                            CssBox wrapperBox = CreateWrapper(
                                 textbox,
                                 textbox.GetPrimaryRenderElement(rootgfx),
                                 spec, true);
                            parentBox.AppendChild(wrapperBox);
                            return wrapperBox;
                        }
                    case "radio":
                        {
                            //tempfix -> just copy the Button code,
                            //TODO: review here, use proper radio button 
                            var box = new LayoutFarm.CustomWidgets.SimpleBox(20, 20);
                            CssBox wrapperBox = CreateWrapper(
                                 box,
                                 box.GetPrimaryRenderElement(rootgfx),
                                 spec, true);
                            parentBox.AppendChild(wrapperBox);
                            return wrapperBox;
                        }
                        break;
                }
            }
            return null;
        }
Example #15
0
 public void ShowMenu(MenuItem relativeToMenuItem)
 {
     //add to topmost box 
     if (!showing)
     {
         //create presentation node
         if (this.pnode == null)
         {
             this.htmldoc = relativeToMenuItem.OwnerMenuBox.HtmlDoc;
             this.pnode = this.GetPresentationDomNode(htmldoc);
         }
         var relativeMenuItemElement = relativeToMenuItem.CurrentDomElement as IHtmlElement;
         int x, y;
         relativeMenuItemElement.getGlobalLocation(out x, out y);
         var pHtmlNode = pnode as WebDom.Impl.HtmlElement;
         pHtmlNode.SetLocation(x + relativeToMenuItem.OwnerMenuBox.Width, y);
         htmldoc.RootNode.AddChild(pnode);
         showing = true;
     }
 }
Example #16
0
 public static bool EqualNames(DomElement node1, DomElement node2)
 {
     return node1.nodeLocalNameIndex == node2.nodeLocalNameIndex
         && node1.nodePrefixNameIndex == node2.nodePrefixNameIndex;
 }
Example #17
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (pnode != null) return pnode;
            this.htmldoc = htmldoc;
            pnode = htmldoc.CreateElement("div");
            //TODO: review IsLandPart again, this is temp fixed 
            if (!this.IsLandPart)
            {
                pnode.SetAttribute("style", "position:absolute;width:100px;height:200px");
            }

            if (menuItems != null)
            {
                int j = menuItems.Count;
                for (int i = 0; i < j; ++i)
                {
                    pnode.AddChild(menuItems[i].GetPresentationDomNode(pnode));
                }
            }
            return pnode;
        }
Example #18
0
 public static bool EqualNames(DomElement node1, DomElement node2)
 {
     return(node1._nodeNameIndex == node2._nodeNameIndex);
 }
Example #19
0
 public DomElement GetPrimaryPresentationNode(DomElement hostNode)
 {
     if (this.pnode != null) return pnode;
     //---------------------------------
     var ownerdoc = hostNode.OwnerDocument;
     pnode = ownerdoc.CreateElement("div");
     //---------------------------------
     //bar part
     pnode.AddChild("div", node_bar =>
     {
         this.nodeBar = node_bar;
         node_bar.AddChild("img", node_icon =>
         {
             this.nodeIcon = node_icon;
             SetupNodeIconBehaviour(node_icon);
         });
         node_bar.AddChild("span", node_span =>
         {
             this.nodeSpan = node_span;
             if (this.nodeString != null)
             {
                 node_span.AddTextContent(this.nodeString);
             }
         });
     });
     //---------------------------------
     //content part
     //indent  
     pnode.AddChild("div", node_body =>
     {
         this.nodeBody = node_body;
         node_body.SetAttribute("style", "padding-left:17px");
         node_body.AddChild("div", node_content =>
         {
             this.nodeContent = node_content;
             if (childNodes != null)
             {
                 nodeContent.SetAttribute("style", "padding-left:0px");
                 int j = childNodes.Count;
                 for (int i = 0; i < j; ++i)
                 {
                     var childnode = childNodes[i].GetPrimaryPresentationNode(nodeContent);
                     node_content.AddChild(childnode);
                 }
             }
         });
     });
     return pnode;
 }
 public abstract CssBox CreateCssBox(LayoutFarm.WebDom.DomElement tag,
                                     CssBox parentBox, BoxSpec spec, HtmlHost host);
Example #21
0
 internal void SetParent(DomElement parentNode)
 {
     _parentNode = parentNode;
 }
Example #22
0
        DomElement GetPrimaryPresentationNode2(DomElement hostNode)
        {
            //implement wth table

            if (this.pnode != null) return pnode;
            //---------------------------------
            var ownerdoc = hostNode.OwnerDocument;
            pnode = ownerdoc.CreateElement("div");
            //---------------------------------
            //bar part
            pnode.AddChild("div", node_bar =>
            {
                this.nodeBar = node_bar;
                node_bar.AddChild("img", node_icon =>
                {
                    this.nodeIcon = node_icon;
                    SetupNodeIconBehaviour(node_icon);
                });
                node_bar.AddChild("span", node_span =>
                {
                    this.nodeSpan = node_span;
                    if (this.nodeString != null)
                    {
                        node_span.AddTextContent(this.nodeString);
                    }
                });
            });
            //---------------------------------
            //content part
            //indent  
            pnode.AddChild("div", node_body =>
            {
                this.nodeBody = node_body;
                //implement with table
                //plan: => implement with inline div***

                node_body.AddChild("table", table =>
                {
                    table.AddChild("tr", tr =>
                    {
                        tr.AddChild("td", td1 =>
                        {
                            //indent
                            td1.SetAttribute("style", "width:20px");
                        });
                        tr.AddChild("td", td1 =>
                        {
                            this.nodeContent = td1;
                            if (childNodes != null)
                            {
                                int j = childNodes.Count;
                                for (int i = 0; i < j; ++i)
                                {
                                    var childnode = childNodes[i].GetPrimaryPresentationNode(nodeContent);
                                    nodeContent.AddChild(childnode);
                                }
                            }
                        });
                    });
                });
                //node_body.SetAttribute("style", "background-color:yellow");
                //node_body.AddChild("div", node_indent =>
                //{
                //    node_indent.SetAttribute("style", "width:32px;display:inline");
                //    node_indent.AddChild("img", img2 => { });

                //});
                //node_body.AddChild("div", node_content =>
                //{
                //    node_content.SetAttribute("style", "display:inline");
                //    //start with blank content
                //    this.nodeContent = node_content;
                //    if (childNodes != null)
                //    {
                //        int j = childNodes.Count;
                //        for (int i = 0; i < j; ++i)
                //        {
                //            var childnode = childNodes[i].GetPrimaryPresentationNode(node_content);
                //            node_content.AddChild(childnode);
                //        }
                //    }

                //});
            });
            //---------------------
            return pnode;
        }
 public EaseScriptElement(DomElement elem)
 {
     this.elem = elem as HtmlElement;
 }
        //internal void oldApplyActiveTemplate(string elemName, string class_value, BoxSpec currentBoxSpec, BoxSpec parentSpec)
        //{

        //    //1. tag name key
        //    int tagNameKey = ustrTable.AddStringIfNotExist(elemName);
        //    //2. class name key
        //    int classNameKey = 0;
        //    if (class_value != null)
        //    {
        //        classNameKey = ustrTable.AddStringIfNotExist(class_value);
        //    } 
        //    var templateKey = new TemplateKey2(tagNameKey, classNameKey);
        //    BoxSpec boxTemplate = SearchUpBoxSpec(templateKey);
        //    if (boxTemplate == null)
        //    {
        //        //create template for specific key  
        //        boxTemplate = new BoxSpec();
        //        //if (boxTemplate.__aa_dbugId == 30)
        //        //{
        //        //} 
        //        //copy current spec to boxTemplate
        //        BoxSpec.CloneAllStyles(boxTemplate, currentBoxSpec); 
        //        //*** 
        //        //----------------------------
        //        //1. tag name
        //        CssRuleSetGroup ruleGroup = activeSheet.GetRuleSetForTagName(elemName);
        //        if (ruleGroup != null)
        //        {
        //            //currentBoxSpec.VersionNumber++;
        //            foreach (WebDom.CssPropertyDeclaration decl in ruleGroup.GetPropertyDeclIter())
        //            {
        //                SpecSetter.AssignPropertyValue(boxTemplate, parentSpec, decl);
        //            }
        //        }
        //        //----------------------------
        //        //2. series of class
        //        if (class_value != null)
        //        {
        //            //currentBoxSpec.VersionNumber++;
        //            string[] classNames = class_value.Split(_whiteSplitter, StringSplitOptions.RemoveEmptyEntries);
        //            int j = classNames.Length;
        //            if (j > 0)
        //            {
        //                for (int i = 0; i < j; ++i)
        //                {

        //                    CssRuleSetGroup ruleSetGroup = activeSheet.GetRuleSetForClassName(classNames[i]);
        //                    if (ruleSetGroup != null)
        //                    {
        //                        foreach (var propDecl in ruleSetGroup.GetPropertyDeclIter())
        //                        {
        //                            SpecSetter.AssignPropertyValue(boxTemplate, parentSpec, propDecl);
        //                        }
        //                        //---------------------------------------------------------
        //                        //find subgroup for more specific conditions
        //                        int subgroupCount = ruleSetGroup.SubGroupCount;
        //                        for (int m = 0; m < subgroupCount; ++m)
        //                        {
        //                            //find if selector condition match with this box
        //                            CssRuleSetGroup ruleSetSubGroup = ruleSetGroup.GetSubGroup(m);
        //                            var selector = ruleSetSubGroup.OriginalSelector;
        //                        }
        //                    }
        //                }
        //            }
        //        } 
        //        if (!currentBoxSpec.DoNotCache)
        //        {
        //            CacheBoxSpec(templateKey, boxTemplate);
        //        }
        //        boxTemplate.Freeze();
        //    }

        //    BoxSpec.CloneAllStyles(currentBoxSpec, boxTemplate);
        //}


        internal void ApplyActiveTemplateForSpecificElementId(DomElement element)
        {
            var ruleset = activeSheet.GetRuleSetForId(element.AttrElementId);
            if (ruleset != null)
            {
                //TODO:  implement this
                throw new NotSupportedException();
            }
        }
Example #25
0
        public override WebDom.DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (pnode != null) return pnode;
            //------------------------------

            pnode = htmldoc.CreateElement("div");
            pnode.SetAttribute("style", "font:10pt tahoma");
            //------------------------------ 
            titleBar = htmldoc.CreateElement("div");
            titleBar.AddTextContent("hello tabPage");
            pnode.AddChild(titleBar);
            //------------------------------ 
            tabTitleList = htmldoc.CreateElement("div");
            pnode.AddChild(tabTitleList);
            //------------------------------ 
            contentNode = htmldoc.CreateElement("div");
            pnode.AddChild(contentNode);
            //------------------------------
            return pnode;
        }
Example #26
0
 public static bool EqualNames(DomElement node1, DomElement node2)
 {
     return(node1.nodeLocalNameIndex == node2.nodeLocalNameIndex &&
            node1.nodePrefixNameIndex == node2.nodePrefixNameIndex);
 }