当前位置: 首页>>代码示例>>C#>>正文


C# Action.ToFunction方法代码示例

本文整理汇总了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());
		}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:10,代码来源:NonobaExtensions.cs

示例2: addMessageHandler

        public static void addMessageHandler(this Connection c, string m, Action<Message, uint> y)
        {
            c.addMessageHandler(m, y.ToFunction());

        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:5,代码来源:ApplicationSprite.cs

示例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
//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:ApplicationSprite.cs


注:本文中的System.Action.ToFunction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。