Пример #1
0
        //public readonly ApplicationWebService service = new ApplicationWebService();


        /// <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)
        {



            //sprite.set_Login(HerokuFacebookLoginAppLoginExperience.Login);

            Action<string, string[]> embed_CallFunction = delegate { };


            #region __Login
            Action __Login = delegate
            {
                HerokuFacebookLoginAppLoginExperience.Login(
                    (string id, string name, string third_party_id) =>
                    {
                        embed_CallFunction("__Login_yield", new[] { id, name, third_party_id });
                    }
                );
            };

            IFunction.OfDelegate(__Login).Export("__Login");
            #endregion

            if (page.__marker_HerokuFacebookLoginActionScript == null)
            {
                // find me

                return;
            }

            ApplicationSprite sprite = new ApplicationSprite();

            sprite.AutoSizeSpriteTo(page.ContentSize);
            sprite.AttachSpriteTo(page.Content);

            embed_CallFunction =
                (method, args) =>
                {
                    var embed = (IHTMLEmbedFlash)sprite.ToHTMLElement();

                    embed.CallFunction(method, args);
                };

            //@"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);
        }
Пример #2
0
        //public readonly ApplicationWebService service = new ApplicationWebService();


        /// <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)
        {
            //sprite.set_Login(HerokuFacebookLoginAppLoginExperience.Login);

            Action <string, string[]> embed_CallFunction = delegate { };


            #region __Login
            Action __Login = delegate
            {
                HerokuFacebookLoginAppLoginExperience.Login(
                    (string id, string name, string third_party_id) =>
                {
                    embed_CallFunction("__Login_yield", new[] { id, name, third_party_id });
                }
                    );
            };

            IFunction.OfDelegate(__Login).Export("__Login");
            #endregion

            if (page.__marker_HerokuFacebookLoginActionScript == null)
            {
                // find me

                return;
            }

            ApplicationSprite sprite = new ApplicationSprite();

            sprite.AutoSizeSpriteTo(page.ContentSize);
            sprite.AttachSpriteTo(page.Content);

            embed_CallFunction =
                (method, args) =>
            {
                var embed = (IHTMLEmbedFlash)sprite.ToHTMLElement();

                embed.CallFunction(method, args);
            };

            //@"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);
        }