本文整理汇总了C#中ScriptCoreLib.Any方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptCoreLib.Any方法的具体用法?C# ScriptCoreLib.Any怎么用?C# ScriptCoreLib.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptCoreLib
的用法示例。
在下文中一共展示了ScriptCoreLib.Any方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application
/// <summary>
/// This is a javascript application.
/// </summary>
/// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
public Application(IApp page)
{
page.clear.WhenClicked(
delegate
{
//page.search.Clear();
page.search.value = "";
}
);
new IHTMLButton { innerText = "Install" }.AttachToDocument().With(
btn =>
{
// http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ffd.html
btn.onclick +=
delegate
{
service.Install("assets/AndroidListApplications/foo.apk");
};
}
);
var items = new
{
div = default(IHTMLDiv),
packageName = "",
name = "",
Remove = default(IHTMLButton),
Launch = default(IHTMLButton)
}.ToEmptyList();
Action queryIntentActivities =
async delegate
{
var a = new List<string>();
// Send data from JavaScript to the server tier
await service.queryIntentActivities(
yield: (packageName, name, icon_base64, label) =>
{
#region yield
a.Add(packageName);
// already have it
if (items.Any(k => k.packageName == packageName))
return;
var div = new IHTMLDiv();
div.style.margin = "1em";
if (Native.Document.body.firstChild == null)
div.AttachToDocument();
else
Native.Document.body.insertBefore(div, Native.Document.body.firstChild);
new IHTMLImage { src = "data:image/png;base64," + icon_base64 }.AttachTo(div);
new IHTMLSpan { innerText = label }.AttachTo(div);
var Remove = new IHTMLButton { innerText = "Remove" }.AttachTo(div).WhenClicked(
btn =>
{
// http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ffd.html
if (!Native.window.confirm("Remove " + name + "?"))
return;
service.Remove(packageName, name);
}
);
//div.appendChild(new { icon_base64.Length }.ToString());
var Launch = new IHTMLButton { innerText = "Launch" }.AttachTo(div).WhenClicked(
btn =>
{
// http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ffd.html
service.Launch(packageName, name);
}
);
var LaunchFloat = new IHTMLButton { innerText = "Launch Float" }.AttachTo(div).WhenClicked(
btn =>
{
service.Launch(packageName, name,
ExtraKey: "Float",
ExtraValue: "Float"
);
}
);
//.........这里部分代码省略.........