public BootWindow(params Union <string, Control, HTMLElement>[] typos) : base("")
        {
            if (assignedBootWindow == string.Empty)
            {
                assignedBootWindow = CreateWindowHandle().ToString();
            }

            responsiveClass = GetResponsiveClass();

            privateSyle = new HTMLStyleElement();
            this.Body.AppendChild(privateSyle);

            var container = (new BootStyleWidget("container"));                      // fluid

            this.BackColor = Color.White;
            this.Body.AppendChild(container.Content);
            this.BodyStyle.OverflowY = Overflow.Auto;
            this.BodyStyle.OverflowX = Overflow.Hidden;

            prevBody = this.Body;

            this.Body = (HTMLDivElement)container.Content;
            this.BodyStyle.Padding = "0";

            SetCalcSize();

            if (typos != null)
            {
                int length = typos.Length;
                for (int i = 0; i < length; i++)
                {
                    if (typos[i].Is <string>())
                    {
                        this.Body.AppendChild(Document.CreateTextNode((string)typos[i]));
                    }
                    else if (typos[i].Is <Control>())
                    {
                        if (typos[i].Is <Navbar>())
                        {
                            makeChangesForNav((Navbar)typos[i]);
                        }
                        else
                        {
                            this.Body.AppendChild((Control)typos[i]);
                        }
                    }
                    else if (typos[i].Is <HTMLElement>())
                    {
                        if (((HTMLElement)typos[i]).TagName.ToUpper() == "NAV")
                        {
                            makeChangesForNav(BootWidget.CastElement <Navbar>((HTMLElement)typos[i]));
                        }
                        else
                        {
                            this.Body.AppendChild((HTMLElement)typos[i]);
                        }
                    }
                }
            }
        }
예제 #2
0
        public static BootWindow GetWidgetWindow(Node element)
        {
            if (element == null)
            {
                return(null);
            }

            var x = BootWidget.CastElement <BootWidget>(element.As <HTMLElement>());

            if (x == null)
            {
                return(null);
            }

            var bootHandle = x.BootWindowHandle;

            for (int i = 0; i < Form.FormCollections.Count; i++)
            {
                if (Form.FormCollections[i].FormOwner is BootWindow)
                {
                    if (Global.ParseInt(Form.FormCollections[i].FormOwner.As <BootWindow>().GetBootHandle()) == bootHandle)
                    {
                        return(Form.FormCollections[i].FormOwner.As <BootWindow>());
                    }
                }
                for (int j = 0; j < Form.FormCollections[i].VisibleForms.Count; j++)
                {
                    if (Form.FormCollections[i].VisibleForms[j] is BootWindow)
                    {
                        if (Global.ParseInt(Form.FormCollections[i].VisibleForms[j].As <BootWindow>().GetBootHandle()) == bootHandle)
                        {
                            return(Form.FormCollections[i].VisibleForms[j].As <BootWindow>());
                        }
                    }
                }
            }

            return(null);
        }