本文整理汇总了C#中ScriptCoreLib.JavaScript.DOM.HTML.IHTMLDiv.ToggleVisible方法的典型用法代码示例。如果您正苦于以下问题:C# IHTMLDiv.ToggleVisible方法的具体用法?C# IHTMLDiv.ToggleVisible怎么用?C# IHTMLDiv.ToggleVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptCoreLib.JavaScript.DOM.HTML.IHTMLDiv
的用法示例。
在下文中一共展示了IHTMLDiv.ToggleVisible方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddEvents
private void AddEvents(IHTMLElement htext)
{
var content = new IHTMLDiv().AttachTo(DocumentBody);
content.Hide();
var IsCamelCaseNames = "Use CamelCase on event names ".ToCheckBox().AttachToWithLabel(content);
IHTMLInput NamePrefix = new IHTMLInput(ScriptCoreLib.Shared.HTMLInputTypeEnum.text);
new IHTMLDiv(
new IHTMLLabel("Event name prefix: ", NamePrefix), NamePrefix
).AttachTo(content);
var update = default(Action);
// var a = new IHTMLTextArea().AttachTo(content);
IHTMLButton.Create(
"Example code",
delegate
{
a.value =
@"added
Dispatched when a display object is added to the display list.
addedToStage
Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.
enterFrame
Dispatched when the playhead is entering a new frame.
removed
Dispatched when a display object is about to be removed from the display list.
removedFromStage
Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained.
render
Dispatched when the display list is about to be updated and rendered.";
update();
}
).AttachTo(content);
// too big
// var cookie = new Cookie("ExampleEvents").BindTo(a);
var z = new IHTMLTable().AttachTo(content);
var zb = z.AddBody();
var b = new IHTMLTextArea().AttachTo(content);
htext.onclick +=
delegate
{
content.ToggleVisible();
};
a.style.display = ScriptCoreLib.JavaScript.DOM.IStyle.DisplayEnum.block;
a.style.width = "100%";
a.style.height = "20em";
b.style.display = ScriptCoreLib.JavaScript.DOM.IStyle.DisplayEnum.block;
b.style.width = "100%";
b.style.height = "20em";
b.readOnly = true;
var dict = new
{
EventType = new Dictionary<string, string>(),
EventCodeName = new Dictionary<string, string>(),
};
Action<Action<string>> update_output =
handler =>
{
var w = new StringBuilder();
var w2 = new StringBuilder();
var lines = a.Lines.ToArray();
w.AppendLine("#region Events");
w2.AppendLine("#region Implementation for methods marked with [Script(NotImplementedHere = true)]");
var DeclaringTypeName = DeclaringType.value;
for (int i = 0; i < lines.Length; i += 2)
{
if ((i + 1) < lines.Length)
{
var Summary = lines[i + 1].Trim();
var EventName = lines[i].Trim();
if (EventName.IndexOf(":") > -1)
EventName = EventName.Substring(0, EventName.IndexOf(":")).Trim();
if (EventName.ContainsAny("(", "#"))
throw new Exception("Invalid Event Name");
if (!EventName.Contains("AIR-only"))
{
//var ReadOnly = "[read-only]";
//.........这里部分代码省略.........
示例2: AddMethods
private void AddMethods(IHTMLElement htext)
{
var content = new IHTMLDiv().AttachTo(DocumentBody);
content.Hide();
var IsInterface = new IHTMLInput(ScriptCoreLib.Shared.HTMLInputTypeEnum.checkbox);
new IHTMLDiv(
new IHTMLLabel("is an interface: ", IsInterface), IsInterface
).AttachTo(content);
var DelegatesParams = new IHTMLInput(ScriptCoreLib.Shared.HTMLInputTypeEnum.checkbox);
new IHTMLDiv(
new IHTMLLabel("delegates parameters to base constructor: ", DelegatesParams), DelegatesParams
).AttachTo(content);
var update = default(Action);
// var a = new IHTMLTextArea().AttachTo(content);
IHTMLButton.Create(
"Example code",
delegate
{
a.value =
@"addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
";
update();
}
).AttachTo(content);
var b = new IHTMLTextArea().AttachTo(content);
htext.onclick +=
delegate
{
content.ToggleVisible();
};
a.style.display = ScriptCoreLib.JavaScript.DOM.IStyle.DisplayEnum.block;
a.style.width = "100%";
a.style.height = "20em";
b.style.display = ScriptCoreLib.JavaScript.DOM.IStyle.DisplayEnum.block;
b.style.width = "100%";
b.style.height = "20em";
b.readOnly = true;
Action update_output =
delegate
{
var w = new StringBuilder();
var w2 = new StringBuilder();
var lines = a.Lines.ToArray();
w.AppendLine("#region Methods");
w2.AppendLine("#region Constructors");
for (int i = 0; i < lines.Length; i += 3)
{
if ((i + 1) < lines.Length)
{
var StaticKeyword = "[static]";
var Summary = lines[i + 1].Trim();
var MethodSig = lines[i].Trim();
if (!MethodSig.Contains("AIR-only"))
{
var q0 = MethodSig.Split(')');
var q1 = q0[0].Split('(');
var MethodName = FixVariableName(q1[0].Trim());
var MethodParameters = new MethodParametersInfo(q1[1].Trim());
var MethodReturnType = "";
if (q0[1].StartsWith(":"))
MethodReturnType = FixTypeName(q0[1].Substring(1).Trim());
var IsConstructor = string.IsNullOrEmpty(MethodReturnType);
foreach (var v in MethodParameters.Variations)
{
if (IsConstructor)
{
w2.AppendLine("/// <summary>");
w2.AppendLine("/// " + Summary);
w2.AppendLine("/// </summary>");
//.........这里部分代码省略.........
示例3: AddProperties
private void AddProperties(IHTMLElement htext)
{
// todo: interface properties
var content = new IHTMLDiv().AttachTo(DocumentBody);
content.Hide();
var IsField = new IHTMLInput(ScriptCoreLib.Shared.HTMLInputTypeEnum.checkbox);
new IHTMLDiv(
new IHTMLLabel("as fields instead of properties: ", IsField), IsField
).AttachTo(content);
// var a = new IHTMLTextArea().AttachTo(content);
var b = new IHTMLTextArea().AttachTo(content);
htext.onclick +=
delegate
{
content.ToggleVisible();
};
a.style.display = ScriptCoreLib.JavaScript.DOM.IStyle.DisplayEnum.block;
a.style.width = "100%";
a.style.height = "20em";
b.style.display = ScriptCoreLib.JavaScript.DOM.IStyle.DisplayEnum.block;
b.style.width = "100%";
b.style.height = "20em";
b.readOnly = true;
Action update =
delegate
{
try
{
//c.removeChildren();
var w = new StringBuilder();
var lines = a.Lines.ToArray();
if ([email protected])
w.AppendLine("#region Fields");
else
w.AppendLine("#region Properties");
for (int i = 0; i < lines.Length; i += 2)
{
if ((i + 1) < lines.Length)
{
var Summary = lines[i + 1].Trim();
if (!lines[i].Contains("AIR-only"))
{
var ReadOnly = "[read-only]";
w.AppendLine("/// <summary>");
w.AppendLine("/// " + Summary);
w.AppendLine("/// </summary>");
var x0 = lines[i].Split(':');
var x1 = x0[1].Trim().Split('=');
var DefaultValue = "";
if (x1.Length == 2)
DefaultValue = x1[1].Trim();
var TypeName = FixTypeName(x1[0].Trim());
var FieldName = x0[0].Trim();
/*
var Image = (IHTMLImage)img.cloneNode(false);
Image.style.verticalAlign = "middle";
new IHTMLDiv(
Image,
new IHTMLCode(TypeName + " " + FieldName)
).AttachTo(c);
*/
var StaticModifier = Summary.Contains("[static]") ? "static " : "";
if ([email protected])
{
var ReadonlyModifier = Summary.Contains(ReadOnly) ? "readonly " : "";
var DefaultValueExpression = string.IsNullOrEmpty(DefaultValue) ? "" : " = " + DefaultValue;
w.AppendLine("public " + StaticModifier + ReadonlyModifier + TypeName + " " + FieldName + DefaultValueExpression + ";");
}
else
//.........这里部分代码省略.........
示例4: AddProxy
private void AddProxy(IHTMLAnchor htext)
{
var content = new IHTMLDiv().AttachTo(DocumentBody);
// content.Hide();
htext.onclick +=
delegate
{
content.ToggleVisible();
};
var LastUpdate = new IHTMLDiv("Not updated yet").AttachTo(content);
var pre = new IHTMLElement(IHTMLElement.HTMLElementEnum.pre).AttachTo(content);
Action update =
delegate
{
LastUpdate.innerText = "Last update: " + DateTime.Now;
pre.removeChildren();
System.Console.WriteLine("Any.ProxyProvider");
RenderProxyTo(new Any.ProxyProvider(a.value), pre);
};
a.onchange += delegate { update(); };
}
示例5: AddConstants
//.........这里部分代码省略.........
SCROLL : String = ""scroll""
[static] The Event.SCROLL constant defines the value of the type property of a scroll event object.
SELECT : String = ""select""
[static] The Event.SELECT constant defines the value of the type property of a select event object.
SOUND_COMPLETE : String = ""soundComplete""
[static] The Event.SOUND_COMPLETE constant defines the value of the type property of a soundComplete event object.
TAB_CHILDREN_CHANGE : String = ""tabChildrenChange""
[static] The Event.TAB_CHILDREN_CHANGE constant defines the value of the type property of a tabChildrenChange event object.
TAB_ENABLED_CHANGE : String = ""tabEnabledChange""
[static] The Event.TAB_ENABLED_CHANGE constant defines the value of the type property of a tabEnabledChange event object.
TAB_INDEX_CHANGE : String = ""tabIndexChange""
[static] The Event.TAB_INDEX_CHANGE constant defines the value of the type property of a tabIndexChange event object.
UNLOAD : String = ""unload""
[static] The Event.UNLOAD constant defines the value of the type property of an unload event object.
AIR-only USER_IDLE : String = ""userIdle""
[static] The Event.USER_IDLE constant defines the value of the type property of a userIdle event object.
AIR-only USER_PRESENT : String = ""userPresent""
[static] The Event.USER_PRESENT constant defines the value of the type property of a userPresent event object.
";
update();
}
).AttachTo(content);
var z = new IHTMLTable().AttachTo(content);
var zb = z.AddBody();
var b = new IHTMLTextArea().AttachTo(content);
htext.onclick +=
delegate
{
content.ToggleVisible();
};
a.style.display = ScriptCoreLib.JavaScript.DOM.IStyle.DisplayEnum.block;
a.style.width = "100%";
a.style.height = "20em";
b.style.display = ScriptCoreLib.JavaScript.DOM.IStyle.DisplayEnum.block;
b.style.width = "100%";
b.style.height = "20em";
b.readOnly = true;
Action<Action<string>> update_output =
handler =>
{
var w = new StringBuilder();
var w2 = new StringBuilder();
var lines = a.Lines.ToArray();
if ([email protected])
{
w.AppendLine("public enum " + DeclaringType.value);
w.AppendLine("{");
}
else
w.AppendLine("#region Constants");
for (int i = 0; i < lines.Length; i += 2)
示例6: Application
//.........这里部分代码省略.........
var nid = GetNumericNodeId(id).ToString();
if (nodes.Elements().Any(k => k.Attribute("id").Name.LocalName == nid))
{
}
else
{
nodes.Add(
new XElement("node",
new XAttribute("id", nid),
new XAttribute("label", CompanyName)
)
);
}
var btn = new IHTMLButton
{
innerText = id + " " + CompanyName + " " + Price
};
btn.style.display = IStyle.DisplayEnum.block;
if (qid == id)
{
btn.disabled = true;
if (c == null)
{
btn.AttachToDocument();
cc.AttachToDocument();
}
else
{
//btn.AttachTo(c);
cc.AttachTo(c);
}
if (done != null)
done();
}
else
{
edges.Add(
new XElement("edge",
new XAttribute("source", nqid),
new XAttribute("target", nid)
)
);
btn.AttachTo(cc);
var ccc = new IHTMLDiv();
ccc.AttachTo(cc);
int cx = 0;
ccc.ToggleVisible();
btn.WhenClicked(
async delegate
{
if (cx == 0)
{
btn.style.color = JSColor.Red;
await AddRelatedCompanies(ccc, id,
delegate
{
btn.style.color = JSColor.Blue;
}
);
}
cx++;
ccc.ToggleVisible();
}
);
}
}
};
return service.GetRelatedCompanies();
};
#endregion
AddRelatedCompanies(null, "NASDAQ:FB", null);
AddRelatedCompanies(null, "NASDAQ:GOOG", null);
}