/// <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)
        {
			// X:\jsc.svn\examples\javascript\chrome\ChromeMcKrackenFirstRoom\ChromeMcKrackenFirstRoom\Application.cs



			// why does it activate in float mode?
			// shake should make it go away?
			//global::DiagnosticsConsole.ApplicationContent.BindKeyboardToDiagnosticsConsole();


			var music = new HTML.Audio.FromAssets.zak().AttachToDocument();
            music.loop = true;
            //music.load();

            music.play();

            new Timer(
                delegate
                {
                    #region clocksound
                    var clocksound = default(_548202_SOUNDDOGS__cl);

                    Action loop = null;

                    loop = delegate
                    {
                        var volume = 0.0;
                        if (clocksound != null)
                            volume = clocksound.volume;

                        clocksound = new _548202_SOUNDDOGS__cl { volume = volume }.AttachToDocument();

                        clocksound.onended +=
                            delegate
                            {
                                Console.WriteLine(" music.onended ");
                                clocksound.Orphanize();

                                loop();
                            };

                        clocksound.play();

                    };

                    loop();
                    #endregion

                    new Timer(
                        t =>
                        {
                            if (t.Counter > 800)
                                return;

                            music.volume = 1 - (t.Counter / 1000.0);
                            if (t.Counter > 200)
                            {
                                clocksound.volume = (t.Counter - 200) / (1000.0 - 200);
                            }

                            if (t.Counter == 800)
                                t.Stop();
                        }
                    ).StartInterval(20);
                }
            ).StartTimeout(2000);


            new NatureBoy.js.Class5().Control.style.SetLocation(0, 0);


            @"Mr. McKracken".ToDocumentTitle();
            //// Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);
        }
示例#2
0
        /// <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)
        {
            // X:\jsc.svn\examples\javascript\chrome\ChromeMcKrackenFirstRoom\ChromeMcKrackenFirstRoom\Application.cs



            // why does it activate in float mode?
            // shake should make it go away?
            //global::DiagnosticsConsole.ApplicationContent.BindKeyboardToDiagnosticsConsole();


            var music = new HTML.Audio.FromAssets.zak().AttachToDocument();

            music.loop = true;
            //music.load();

            music.play();

            new Timer(
                delegate
            {
                #region clocksound
                var clocksound = default(_548202_SOUNDDOGS__cl);

                Action loop = null;

                loop = delegate
                {
                    var volume = 0.0;
                    if (clocksound != null)
                    {
                        volume = clocksound.volume;
                    }

                    clocksound = new _548202_SOUNDDOGS__cl {
                        volume = volume
                    }.AttachToDocument();

                    clocksound.onended +=
                        delegate
                    {
                        Console.WriteLine(" music.onended ");
                        clocksound.Orphanize();

                        loop();
                    };

                    clocksound.play();
                };

                loop();
                #endregion

                new Timer(
                    t =>
                {
                    if (t.Counter > 800)
                    {
                        return;
                    }

                    music.volume = 1 - (t.Counter / 1000.0);
                    if (t.Counter > 200)
                    {
                        clocksound.volume = (t.Counter - 200) / (1000.0 - 200);
                    }

                    if (t.Counter == 800)
                    {
                        t.Stop();
                    }
                }
                    ).StartInterval(20);
            }
                ).StartTimeout(2000);


            new NatureBoy.js.Class5().Control.style.SetLocation(0, 0);


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