本文整理匯總了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;
}