本文整理汇总了C#中System.Action.ToFunction方法的典型用法代码示例。如果您正苦于以下问题:C# Action.ToFunction方法的具体用法?C# Action.ToFunction怎么用?C# Action.ToFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Action
的用法示例。
在下文中一共展示了Action.ToFunction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowShop
/// <summary>
/// Opens the purchase process for the item defined in the request.
/// </summary>
/// <param name="stage">You must pass your stage object to the API for it to work.</param>
/// <param name="item">The item's string identifier, you configure this in the shop admin, under edit game.</param>
/// <param name="callback">Authenticating is done asynchronously, so a callback method is used to get the result state.</param>
public static void ShowShop(Stage stage, string item, Action<string, bool> callback)
{
NonobaAPI.ShowShop(stage, item, callback.ToFunction());
}
示例2: addMessageHandler
public static void addMessageHandler(this Connection c, string m, Action<Message, uint> y)
{
c.addMessageHandler(m, y.ToFunction());
}
示例3: Initialize
public static void Initialize(Action<string> yield_to_sprite)
{
#region export callback
ExternalExtensions.TryAddCallback("WhenReady", yield_to_sprite.ToFunction());
#endregion
#region Initialize JavaScript
//TypeError: Cannot call method 'apply' of undefined
//ExternalInterface.call("setTimeout", "window.function2 = function (e) { document.title = 'length: ' + e.length; document.getElementById('foo').value = e; return 0; };", 0);
ExternalInterface.call("setTimeout",
@"window.function2 = function (e)
{
console.log('length: ' + e.length);
// debugger;
var f = null;
//try
//{
f = eval(e);
console.log('done!');
//}
//catch (err)
//{
// console.log('error! ' + err);
// console.log('typeof f: ' + typeof f);
// console.log('f: ' + f);
//}
return 0;
};", 0);
//ExternalInterface.call("setTimeout", "window.function1 = function (e) { alert(e.length); };", 0);
//ExternalInterface.call("setTimeout", "document.title = 'flashed';", 0);
var source = KnownEmbeddedResources.Default["assets/FlashBootstrapsSecondaryApplication/view-source"].ToStringAsset();
//content.t.Text = new { source.Length }.ToString();
//ExternalInterface.call("setTimeout", "document.title = 'source';", 0);
//ExternalInterface.call("function2", "hi").ToString();
//ExternalInterface.call("function2", "<\\&>\n\r\t<A//>").ToString();
1.AtDelay(
delegate
{
// Uncaught SyntaxError: Unexpected token ILLEGAL
//var x = 1024 * 31 + 1;
//var x = 1024 * 30 + 1 + 256;
//var x = 1024 * 30 + 1 + 256 + 64 + 48 + 5;
//for (d = 0; (d < AQQABtNdQz66ZYUODttTfw(c)); d++)
//{
// e = EwQABtNdQz66ZYUODttTfw(c, d);
// f = CQQABtNdQz66ZYUODttTfw(c, d);
// i = !(EAQABtNdQz66ZYUODttTfw('\"\'\u005c\u0008\u000c\u000a\u000d\u0009', e) > -1);
// YUODttTfw('\""\ }
// tTfw('\""\u005c }
var q = source; //.Substring(x, 16);
//q = q.Replace("\\'", "X");
//q = q.Replace("\\\"", "\\x22");
q = q.Replace("\\", "\\\\");
//q = q.Replace("'", "X");
// { x = 31041, Length = 1118850, q = 66ZYUODttTfw(c, d);
//i = !(EAQABtNdQz66Z }
// { x = 31089, Length = 1118850, q = YUODttTfw('\"\'\ }
//content.t.Text = new { x, source.Length, q }.ToString();
try
{
ExternalInterface.call("function2", q);
}
catch (Exception ex)
{
//content.t.Text = "error? " + new { ex.Message, ex.StackTrace };
}
}
);
//ExternalInterface.call("function1",
// // too much
//.........这里部分代码省略.........