private static IHTMLDiv AddNamespace(IHTMLDiv parent, IHTMLDiv NextNamespaceOrDefault, string Namespace, Action<string> UpdateLocation) { var div = new IHTMLDiv(); if (NextNamespaceOrDefault == null) div.AttachTo(parent); else NextNamespaceOrDefault.insertPreviousSibling(div); div.style.marginTop = "0.1em"; div.style.fontFamily = ScriptCoreLib.JavaScript.DOM.IStyle.FontFamilyEnum.Verdana; div.style.whiteSpace = ScriptCoreLib.JavaScript.DOM.IStyle.WhiteSpaceEnum.nowrap; var i = new Namespace().AttachTo(div); i.style.verticalAlign = "middle"; i.style.marginRight = "0.5em"; if (Namespace == "") Namespace = "<Module>"; var s = new IHTMLAnchor { innerText = Namespace }.AttachTo(div); s.href = "#"; s.style.textDecoration = "none"; s.style.color = JSColor.System.WindowText; Action onclick = delegate { }; s.onclick += e => { e.PreventDefault(); s.focus(); UpdateLocation(Namespace); onclick(); }; s.onfocus += delegate { s.style.backgroundColor = JSColor.System.Highlight; s.style.color = JSColor.System.HighlightText; }; s.onblur += delegate { s.style.backgroundColor = JSColor.None; s.style.color = JSColor.System.WindowText; }; var children = new IHTMLDiv().AttachTo(div); children.style.paddingLeft = "1em"; children.Hide(); var NextClickHide = default(Action); var NextClickShow = default(Action); NextClickHide = delegate { children.Hide(); onclick = NextClickShow; }; NextClickShow = delegate { children.Show(); onclick = NextClickHide; }; onclick = NextClickShow; return children; }