本文整理汇总了C#中ScriptCoreLib.JavaScript.DOM.HTML.IHTMLDiv.insertPreviousSibling方法的典型用法代码示例。如果您正苦于以下问题:C# IHTMLDiv.insertPreviousSibling方法的具体用法?C# IHTMLDiv.insertPreviousSibling怎么用?C# IHTMLDiv.insertPreviousSibling使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptCoreLib.JavaScript.DOM.HTML.IHTMLDiv
的用法示例。
在下文中一共展示了IHTMLDiv.insertPreviousSibling方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddNamespace
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;
}