/// <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(IDefault page)
        {
            FormStyler.AtFormCreated = FormStyler.LikeVisualStudioMetro;
            FormStyler.AtFormCreated = FormStyler.LikeWindows3;
            content.label2.Text = "Open this application from " + Native.Document.location.href;


            content.WhenClickedGoFullscreen +=
              (b, f) =>
              {
                  var c = global::ScriptCoreLib.JavaScript.Windows.Forms.Extensions.GetHTMLTargetContainer(f);

                  b.Click +=
                      delegate
                      {
                          c.requestFullscreen();
                      };
              };

            var once = false;

            content.NewForm +=
                f =>
                {
                    if (once)
                        return;

                    once = true;
                    //f.DisableFormClosingHandler = true;

                    global::CSSMinimizeFormToSidebar.ApplicationExtension.InitializeSidebarBehaviour(
                        f
                    );
                };


            //content.WhenClickedGoFullscreen +=
            //  (b, f) =>
            //  {
            //      var c = global::ScriptCoreLib.JavaScript.Windows.Forms.Extensions.GetHTMLTargetContainer(f);

            //      b.Click +=
            //          delegate
            //          {
            //              c.requestFullscreen();
            //          };
            //  };


            //content.AttachControlTo(Native.Document.body);

            content.AttachControlTo(page.Content);
            content.AutoSizeControlTo(page.ContentSize);
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
        /// <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(IDefault  page = null)
        {
            #region scripts -> InitializeContent
            new[]
            {
                new global::WebGLPlanetGenerator.Design.sylvester().Content,
                new global::WebGLPlanetGenerator.Design.glUtils().Content,
                new global::WebGLPlanetGenerator.Design.particle_terrain().Content,
                new global::WebGLPlanetGenerator.Design.planet().Content,
            }.ForEach(
                 (SourceScriptElement, i, MoveNext) =>
                 {
                     SourceScriptElement.AttachToDocument().onload +=
                         delegate
                         {
                             MoveNext();
                         };
                 }
             )(
                 delegate
                 {
                     InitializeContent(page);
                 }
             );
            #endregion

     
        }
示例#3
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(IDefault page)
        {
            XInteractiveInt32Form.service.File_ReadLine  = service.File_ReadLine;
            XInteractiveInt32Form.service.File_WriteLine = service.File_WriteLine;

            new ButterFlyWithInteractiveInt32Offset.Library.Butterfly(page.PageContainer);
        }
        /// <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(IDefault page)
        {
            int w = 512;
            int h = 512;

            page.Content.Clear();

            this.c = new IHTMLCanvas();
            c.style.border = "1px solid red";
            c.width = w;
            c.height = h;

            c.AttachTo(page.Content);

            //this.gl = (ScriptCoreLib.JavaScript.WebGL.WebGLRenderingContext)new IFunction("c", "return c.getContext('experimental-webgl', {depth : false } );").apply(null, c);

            //   gl = c.getContext("experimental-webgl", {depth : false } );
            this.gl = (WebGLRenderingContext)c.getContext("experimental-webgl");

            if (gl != null)
            {
                gl.viewport(0, 0, w, h);

                Initialize();
            }
        }
        /// <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(IDefault  page)
        {
            @"jsc".ToDocumentTitle();

            page.AnimateHomePage();

            new ApplicationWebService().WebMethod2(
                new XElement(@"Document",
                    new object[] {
						new XElement(@"Data", 
							new object[] {
								@"Hello world"
							}
						),
						new XElement(@"Client", 
							new object[] {
								@"Unchanged text"
							}
						)
					}
                ),
                delegate(XElement doc)
                {
                    doc.Element(@"Data").Value.ToDocumentTitle();
                }
            );
        }
        /// <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(IDefault page = null)
        {
            #region await then do InitializeContent
            new[]
            {
                new Data.macbook().Content,
            }.ForEach(
                (SourceScriptElement, i, MoveNext) =>
                {
                    SourceScriptElement.AttachToDocument().onload +=
                        delegate
                        {
                            MoveNext();
                        };
                }
            )(
                delegate
                {
                    InitializeContent(page);
                }
            );
            #endregion



            style.Content.AttachToHead();
        }
        //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(IDefault page)
        {
            #region TheServer
            dynamic self = Native.self;
            dynamic self_chrome = self.chrome;
            object self_chrome_socket = self_chrome.socket;

            if (self_chrome_socket != null)
            {
                chrome.Notification.DefaultTitle = "SinePlasmaApplet";
                ChromeTCPServer.TheServer.Invoke(
                    DefaultSource.Text
                );


                return;
            }
            #endregion

            // Initialize ApplicationApplet
            new ApplicationApplet().AttachAppletToDocument();
            //@"Hello world".ToDocumentTitle();
            //// Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);
        }
        /// <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(IDefault page)
        {
            HoverManager m = new HoverManager();

            StreamLoremIpsum(Native.Document.body);

            new HoverElement("this is a hover text 1", m).AttachTo(Native.Document.body);

            StreamLoremIpsum(Native.Document.body);

            new HoverElement("this is a hover text 2", m).AttachTo(Native.Document.body);

            StreamLoremIpsum(Native.Document.body);

            new HoverElement("this is a hover text 3", m).AttachTo(Native.Document.body);

            StreamLoremIpsum(Native.Document.body);




            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
        /// <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(IDefault page)
        {
            new IHTMLButton { innerText = "Log in!" }.AttachToDocument().onclick +=
                delegate
                {
                    new Cookie("Password").Value = "mypassword";

                    Native.window.open("/Other", "_self");

                };

            new IHTMLButton { innerText = "Log Out!" }.AttachToDocument().onclick +=
             delegate
             {
                 new Cookie("Password").Value = "";

                 Native.window.open("/Other", "_self");

             };

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
示例#10
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(IDefault page = null)
 {
     #region scripts -> InitializeContent
     new[]
     {
         new global::WebGLPlanetGenerator.Design.sylvester().Content,
         new global::WebGLPlanetGenerator.Design.glUtils().Content,
         new global::WebGLPlanetGenerator.Design.particle_terrain().Content,
         new global::WebGLPlanetGenerator.Design.planet().Content,
     }.ForEach(
         (SourceScriptElement, i, MoveNext) =>
     {
         SourceScriptElement.AttachToDocument().onload +=
             delegate
         {
             MoveNext();
         };
     }
         )(
         delegate
     {
         InitializeContent(page);
     }
         );
     #endregion
 }
示例#11
0
        public void Init(IDefault view, bool postBack)
        {
            _view = view;
            _view.TotalItem = Alert.CountAlertsByAccountID(_accountBeingViewed.AccountID);
            ShowDisplay();

        }
示例#12
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(IDefault page)
        {
            var s = new ApplicationSprite();
            var e = s.ToHTMLElement();

            s.AttachSpriteTo(page.PageContainer);

            Action Update =
                delegate
            {
                var w = page.SizeShadow.scrollWidth;
                var h = page.SizeShadow.scrollHeight;


                e.style.SetSize(w, h);
            };


            Native.window.onresize +=
                delegate
            {
                Update();
            };

            Update();
        }
示例#13
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(IDefault page)
        {
            #region TheServer
            dynamic self               = Native.self;
            dynamic self_chrome        = self.chrome;
            object  self_chrome_socket = self_chrome.socket;

            if (self_chrome_socket != null)
            {
                chrome.Notification.DefaultTitle = "SinePlasmaApplet";
                ChromeTCPServer.TheServer.Invoke(
                    DefaultSource.Text
                    );


                return;
            }
            #endregion

            // Initialize ApplicationApplet
            new ApplicationApplet().AttachAppletToDocument();
            //@"Hello world".ToDocumentTitle();
            //// Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);
        }
示例#14
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(IDefault page)
        {
            new gong().AttachToDocument().play();
            new ThreeDStuff.js.Tycoon4();


        }
示例#15
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(IDefault page)
        {
            //20150213
            // the effect no longer works?

            new NatureBoy.js.Class6().Initialize();
        }
示例#16
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(IDefault page)
        {
            new IHTMLButton {
                innerText = "Log in!"
            }.AttachToDocument().onclick +=
                delegate
            {
                new Cookie("Password").Value = "mypassword";

                Native.window.open("/Other", "_self");
            };

            new IHTMLButton {
                innerText = "Log Out!"
            }.AttachToDocument().onclick +=
                delegate
            {
                new Cookie("Password").Value = "";

                Native.window.open("/Other", "_self");
            };

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
示例#17
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(IDefault page = null)
        {
            #region await then do InitializeContent
            new[]
            {
                new Data.macbook().Content,
            }.ForEach(
                (SourceScriptElement, i, MoveNext) =>
            {
                SourceScriptElement.AttachToDocument().onload +=
                    delegate
                {
                    MoveNext();
                };
            }
                )(
                delegate
            {
                InitializeContent(page);
            }
                );
            #endregion



            style.Content.AttachToHead();
        }
示例#18
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(IDefault  page)
        {
            content.AttachToContainer(page.Content);
            content.AutoSizeTo(page.ContentSize);


            Native.window.ondeviceorientation +=
                (e) =>
                {
                    // x 0..1
                    // is
                    // gamma -45 .. 45
 
                    // 0..1
                    // beta -45 .. 45

                    content.Update(
                        Math.Max(0, Math.Min(1, (e.gamma + 45) / 90.0)),
                        Math.Max(0, Math.Min(1, (e.beta + 45) / 90.0))
                    );

                    //content.s.Text = new { e.alpha, e.gamma, e.beta }.ToString();
                };

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
示例#19
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(IDefault page = null)
        {
            // view-source:http://www.rozengain.com/files/webgl/tunnel/
            // http://www.rozengain.com/blog/2010/08/10/using-webgl-glsl-shaders-to-create-a-tunnel-effect/

            #region __sylvester -> __glUtils -> InitializeContent
            new WebGLTunnel.References.__sylvester().Content.With(
                source =>
            {
                source.onload +=
                    delegate
                {
                    new WebGLTunnel.References.__glUtils().Content.With(
                        source2 =>
                    {
                        source2.onload +=
                            delegate
                        {
                            InitializeContent(page);
                        };
                    }
                        ).AttachToDocument();
                };
            }
                ).AttachToDocument();
            #endregion


            //@"Hello world".ToDocumentTitle();
            //// Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);
        }
示例#20
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(IDefault page)
        {
            content.AttachToContainer(page.Content);
            content.AutoSizeTo(page.ContentSize);


            Native.window.ondeviceorientation +=
                (e) =>
            {
                // x 0..1
                // is
                // gamma -45 .. 45

                // 0..1
                // beta -45 .. 45

                content.Update(
                    Math.Max(0, Math.Min(1, (e.gamma + 45) / 90.0)),
                    Math.Max(0, Math.Min(1, (e.beta + 45) / 90.0))
                    );

                //content.s.Text = new { e.alpha, e.gamma, e.beta }.ToString();
            };

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
示例#21
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(IDefault page)
        {

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

            // reference:
            // http://apike.ca/prog_svg_basic.html
            // http://apike.ca/prog_svg_shapes.html
            // http://www.milescript.org/graphicsdemo.html
            // http://canarlake.org/index.cgi?theme=svg
            // http://srufaculty.sru.edu/david.dailey/svg/SVGAnimations.htm
            // http://srufaculty.sru.edu/david.dailey/svg/svg_questions.htm
            // http://www.w3.org/TR/2000/CR-SVG-20001102/masking.html#ObjectAndGroupOpacityProperties
            // http://jmvidal.cse.sc.edu/talks/canvassvg/gradient.xml?style=White
            // http://www.treebuilder.de/default.asp?file=163540.xml
            // http://www.ibm.com/developerworks/library/x-svgint/
            // http://starkravingfinkle.org/projects/richdraw/richdraw_demo.htm
            // http://www.dynamicdrive.com/dynamicindex11/editor.htm
            // http://draw.labs.autodesk.com/ADDraw/draw.html
            // http://yeonisalive.net/javascript/MindWeb001.php
            "h2".AttachToDocument().innerText = "svg + vml example";

            if (!ISVGElementBase.Settings.IsSupported)
                Native.window.alert("svg not supported in this browser!");


            Test1();
            Test2();

        }
示例#22
0
 public ServicePresenter(IDefault IDefault)
 {
     if (IDefault != null)
     {
         objIDefault = IDefault;
     }
 }
示例#23
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(IDefault page)
        {
            @"jsc".ToDocumentTitle();

            page.AnimateHomePage();

            new ApplicationWebService().WebMethod2(
                new XElement(@"Document",
                             new object[] {
                new XElement(@"Data",
                             new object[] {
                    @"Hello world"
                }
                             ),
                new XElement(@"Client",
                             new object[] {
                    @"Unchanged text"
                }
                             )
            }
                             ),
                delegate(XElement doc)
            {
                doc.Element(@"Data").Value.ToDocumentTitle();
            }
                );
        }
示例#24
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(IDefault page)
        {
        
            // see also: http://neocotic.com/qr.js/

            Action<string> Add =
                e =>
                {
                    var p = new IHTMLDiv().AttachToDocument();

                    p.style.margin = "4em";

                    new IHTMLAnchor
                    {
                        href = e,
                        innerText = e
                    }.AttachTo(p);

                    new IHTMLBreak().AttachTo(p);

                    e.ToQRCode().AttachTo(p);
                };


            Add("" + Native.document.location);
            Add("http://www.jsc-solutions.net");


        }
示例#25
0
        // gearVR browser?

        // would a service worker be of use
        // to download
        // unpack and cache all assets?



        /// <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(IDefault page)
        {
            // Error	3	The type or namespace name 'DiagnosticsConsole' could not be found in the global namespace (are you missing an assembly reference?)	X:\jsc.svn\examples\javascript\ImpAdventures\ImpAdventures\Application.cs	32	21	ImpAdventures
            //global::DiagnosticsConsole.ApplicationContent.BindKeyboardToDiagnosticsConsole();

            new Class4();
        }
示例#26
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(IDefault page)
        {
            HoverManager m = new HoverManager();

            StreamLoremIpsum(Native.Document.body);

            new HoverElement("this is a hover text 1", m).AttachTo(Native.Document.body);

            StreamLoremIpsum(Native.Document.body);

            new HoverElement("this is a hover text 2", m).AttachTo(Native.Document.body);

            StreamLoremIpsum(Native.Document.body);

            new HoverElement("this is a hover text 3", m).AttachTo(Native.Document.body);

            StreamLoremIpsum(Native.Document.body);



            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
示例#27
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(IDefault page)
        {
            // http://blog.teamtreehouse.com/accessing-the-device-camera-with-getusermedia
            // http://stackoverflow.com/questions/11539689/why-localstreams-contains-localmediastream-and-remotestreams-contains-mediastrea
            // https://developer.mozilla.org/en-US/docs/Web/API/Navigator.getUserMedia
            // http://neave.github.io/face-detection/


            var navigator = (NavigatorUserMedia)(object)Native.window.navigator;

            var successCallback =
                new Action <LocalMediaStream>(
                    localMediaStream =>
            {
                Console.WriteLine("got video");

                //var src = (string)new IFunction("return window.URL.createObjectURL(this);").apply(localMediaStream);

                var v = new IHTMLVideo {
                    src = localMediaStream.ToObjectURL()
                }.AttachToDocument();

                v.play();
            }
                    );

            var errorCallback =
                new Action <NavigatorUserMediaError>(
                    e =>
            {
                // restart on error? :P
                Native.window.alert("no video: " + new { e.code });
            }
                    );

            //var a = 1;

            //var c = new MediaStreamConstraints { video = a == 1, audio = a == 0 };

            //var o = new IFunction("return {video: true};").apply(null);


            navigator.webkitGetUserMedia(
                new { video = true, audio = false },
                successCallback: IFunction.OfDelegate(
                    successCallback
                    ),
                errorCallback: IFunction.OfDelegate(
                    errorCallback
                    )
                );

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
示例#28
0
        //public readonly DefaultStyle style = new DefaultStyle();

        /// <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(IDefault page = null)
        {
            InitializeContent();

            //style.Content.AttachToHead();
            @"Plasma".ToDocumentTitle();

        }
示例#29
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(IDefault page = null)
        {

            InitializeContent();

            style.Content.AttachToHead();

        }
示例#30
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(IDefault page)
        {
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.getExternalStoragePublicDirectory(
                "",
                root =>
            {
                Action <string, IHTMLElement> listFiles = null;

                listFiles =
                    (xroot, xcontainer) =>
                {
                    if (!xroot.EndsWith("/"))
                    {
                        xroot += "/";
                    }

                    new IHTMLPre {
                        innerText = xroot
                    }.AttachTo(xcontainer);

                    service.listFiles(xroot,
                                      f =>
                    {
                        var ch = new IHTMLDiv();

                        ch.style.marginLeft = "1em";


                        new IHTMLButton {
                            innerText = f
                        }.AttachTo(xcontainer).With(
                            btn =>
                        {
                            btn.style.display = IStyle.DisplayEnum.block;

                            btn.onclick +=
                                delegate
                            {
                                if (f.EndsWith("/"))
                                {
                                    listFiles(xroot + f, ch);
                                }
                            };
                        }
                            );

                        ch.AttachTo(xcontainer);
                    }
                                      );
                };


                listFiles(root, Native.Document.body);
            }
                );
        }
示例#31
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(IDefault page)
        {
            //20150213
            // the effect no longer works?

            new NatureBoy.js.Class6().Initialize();

           
        }
示例#32
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(IDefault page)
        {
            // http://blog.teamtreehouse.com/accessing-the-device-camera-with-getusermedia
            // http://stackoverflow.com/questions/11539689/why-localstreams-contains-localmediastream-and-remotestreams-contains-mediastrea
            // https://developer.mozilla.org/en-US/docs/Web/API/Navigator.getUserMedia
            // http://neave.github.io/face-detection/


            var navigator = (NavigatorUserMedia)(object)Native.window.navigator;

            var successCallback =
                new Action<LocalMediaStream>(
                    localMediaStream =>
                    {
                        Console.WriteLine("got video");

                        //var src = (string)new IFunction("return window.URL.createObjectURL(this);").apply(localMediaStream);

                        var v = new IHTMLVideo { src = localMediaStream.ToObjectURL() }.AttachToDocument();

                        v.play();
                    }
                );

            var errorCallback =
                new Action<NavigatorUserMediaError>(
                    e =>
                    {
                        // restart on error? :P
                        Native.window.alert("no video: " + new { e.code });
                    }
                );

            //var a = 1;

            //var c = new MediaStreamConstraints { video = a == 1, audio = a == 0 };

            //var o = new IFunction("return {video: true};").apply(null);


            navigator.webkitGetUserMedia(
                new { video = true, audio = false },
                successCallback: IFunction.OfDelegate(
                    successCallback
                ),
                errorCallback: IFunction.OfDelegate(
                    errorCallback
                )
            );

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
示例#33
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(IDefault  page)
 {
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => value.ToDocumentTitle()
     );
 }
示例#34
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(IDefault page)
        {
            XInteractiveInt32Form.service.File_ReadLine = service.File_ReadLine;
            XInteractiveInt32Form.service.File_WriteLine = service.File_WriteLine;

            new ButterFlyWithInteractiveInt32Offset.Library.Butterfly(page.PageContainer);



        }
示例#35
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(IDefault  page)
 {
     content.AttachToContainer(page.Content).AutoSizeTo(page.ContentSize);
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => value.ToDocumentTitle()
     );
 }
示例#36
0
        // gearVR browser?

        // would a service worker be of use
        // to download
        // unpack and cache all assets?




        /// <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(IDefault page)
        {

            // Error	3	The type or namespace name 'DiagnosticsConsole' could not be found in the global namespace (are you missing an assembly reference?)	X:\jsc.svn\examples\javascript\ImpAdventures\ImpAdventures\Application.cs	32	21	ImpAdventures
            //global::DiagnosticsConsole.ApplicationContent.BindKeyboardToDiagnosticsConsole();

            new Class4();


        }
示例#37
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(IDefault page)
 {
     content.AttachToContainer(page.Content).AutoSizeTo(page.ContentSize);
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => value.ToDocumentTitle()
         );
 }
 public static SurrogateForIDefault Convert(IDefault value)
 {
     if (value == null)
     {
         return(null);
     }
     return(new SurrogateForIDefault {
         Target = ((DefaultRef)value).Target
     });
 }
示例#39
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(IDefault page)
        {
            new SubSquare.source.js.Controls.SubSquareControl();

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
示例#40
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(IDefault page)
        {
            //impl:type: ScriptCoreLib.JavaScript.BCLImplementation.System.Drawing.__Image 8ebb56a7-9ca1-3c92-908a-696d9c757606  - System.Drawing.Image 451dbf16-b46b-3b4f-993c-efd8b01553a0
            //script: error JSC1000: No implementation found for this native method, please implement [System.Drawing.Image.Dispose()]
            //script: warning JSC1000: Did you reference ScriptCoreLib via IAssemblyReferenceToken?
            //script: error JSC1000: error at MandelbrotFormsControl.Library.MandelbrotComponent+<>c__DisplayClass6.<MandelbrotComponent_Load>b__0,

            content.AttachControlToDocument();


        }
示例#41
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(IDefault page)
 {
     sprite.AutoSizeSpriteTo(page.ContentSize);
     sprite.AttachSpriteTo(page.Content);
     //@"Hello world".ToDocumentTitle();
     //// Send data from JavaScript to the server tier
     //service.WebMethod2(
     //    @"A string from JavaScript.",
     //    value => value.ToDocumentTitle()
     //);
 }
示例#42
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(IDefault page)
        {
            new TextScreenSaver.js.TextScreenSaver();

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
示例#43
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(IDefault page)
 {
     // Initialize ApplicationSprite
     sprite.AttachSpriteTo(page.Content);
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => value.ToDocumentTitle()
         );
 }
示例#44
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(IDefault page)
        {
            new SimpleFilmstrip.js.SimpleFilmstrip();

            //@"Hello world".ToDocumentTitle();
            //// Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);
        }
示例#45
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(IDefault  page)
        {
            new SimpleFilmstrip.js.SimpleFilmstrip();

            //@"Hello world".ToDocumentTitle();
            //// Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);
        }
示例#46
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(IDefault page)
 {
     // Initialize ApplicationSprite
     sprite.AttachSpriteTo(page.Content);
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => value.ToDocumentTitle()
     );
 }
示例#47
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(IDefault page)
        {
            new HulaGirl.source.js.Controls.HulaGirl(page.Content);

            //@"Hello world".ToDocumentTitle();
            //// Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);
        }
示例#48
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(IDefault page)
        {
            new SubSquare.source.js.Controls.SubSquareControl();

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
示例#49
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(IDefault page)
 {
     sprite.AutoSizeSpriteTo(page.ContentSize);
     sprite.AttachSpriteTo(page.Content);
     //@"Hello world".ToDocumentTitle();
     //// Send data from JavaScript to the server tier
     //service.WebMethod2(
     //    @"A string from JavaScript.",
     //    value => value.ToDocumentTitle()
     //);
 }
示例#50
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(IDefault page)
        {
            // jsc, can we switch avalon renderer to threejs or starling?
            content.AttachToContainer(Native.document.body);

            Native.window.onresize +=
                delegate
            {
                content.Width  = Native.window.Width;
                content.Height = Native.window.Height;
            };
        }
示例#51
0
        public void Init(IDefault view)
        {
            _view = view;
            if (_userSession.CurrentUser != null)
            {
                _view.LoadMessages(Messages.GetMessageByAccountID(_userSession.CurrentUser.AccountID,
                    _webContext.PageNumber, (MessageFolders)_webContext.MessagesFolderID));

                _view.DisplayPageNavigation(Messages.GetPageCount((MessageFolders) _webContext.FolderID,
                    _userSession.CurrentUser.AccountID),(MessageFolders)_webContext.MessagesFolderID,_webContext.PageNumber);
            }
        }
示例#52
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(IDefault page)
        {
            // jsc, can we switch avalon renderer to threejs or starling?
            content.AttachToContainer(Native.document.body);

            Native.window.onresize +=
                delegate
                {
                    content.Width = Native.window.Width;
                    content.Height = Native.window.Height;
                };
        }
示例#53
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(IDefault page)
 {
     // Initialize ApplicationApplet
     new ApplicationApplet().AttachAppletTo(page.Content);
     style.Content.AttachToHead();
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => value.ToDocumentTitle()
         );
 }
示例#54
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(IDefault page)
        {
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.getExternalStoragePublicDirectory(
                "",
                root =>
                {
                    Action<string, IHTMLElement> listFiles = null;

                    listFiles =
                        (xroot, xcontainer) =>
                        {
                            if (!xroot.EndsWith("/"))
                                xroot += "/";

                            new IHTMLPre { innerText = xroot }.AttachTo(xcontainer);

                            service.listFiles(xroot,
                                f =>
                                {
                                    var ch = new IHTMLDiv();

                                    ch.style.marginLeft = "1em";


                                    new IHTMLButton { innerText = f }.AttachTo(xcontainer).With(
                                        btn =>
                                        {
                                            btn.style.display = IStyle.DisplayEnum.block;

                                            btn.onclick +=
                                                delegate
                                                {
                                                    if (f.EndsWith("/"))
                                                    {
                                                        listFiles(xroot + f, ch);
                                                    }
                                                };
                                        }
                                    );

                                    ch.AttachTo(xcontainer);

                                }
                            );
                        };


                    listFiles(root, Native.Document.body);
                }
            );
        }
示例#55
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(IDefault page)
        {
            // has it ever been a chrome app?
            // we do have a version for android
            // X:\jsc.svn\examples\javascript\android\com.abstractatech.consoleworm\com.abstractatech.consoleworm\Application.cs
            // code duplicates!
            // "X:\jsc.svn\examples\javascript\android\com.abstractatech.gamification.craft\com.abstractatech.gamification.craft.sln"

#if FCHROME
            #region AtFormCreated
            FormStyler.AtFormCreated =
                s =>
            {
                s.Context.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

                var x = new ChromeTCPServerWithFrameNone.HTML.Pages.AppWindowDrag().AttachTo(s.Context.GetHTMLTarget());
            };
            #endregion



            #region ChromeTCPServer
            dynamic self               = Native.self;
            dynamic self_chrome        = self.chrome;
            object  self_chrome_socket = self_chrome.socket;

            if (self_chrome_socket != null)
            {
                chrome.Notification.DefaultTitle   = "ConsoleWorm";
                chrome.Notification.DefaultIconUrl = new HTML.Images.FromAssets.Preview().src;

                ChromeTCPServer.TheServerWithStyledForm.Invoke(
                    DefaultSource.Text,
                    AtFormCreated: FormStyler.AtFormCreated
                    );

                return;
            }
            #endregion
#endif



            new ConsoleWorm.js.Game();

            //@"Console Worm".ToDocumentTitle();
            //// Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"Console Multi Worm",
            //    value => value.ToDocumentTitle()
            //);
        }
示例#56
0
        // https://sites.google.com/a/jsc-solutions.net/work/knowledge-base/15-dualvr/20150724
        // port from: Z:\jsc.svn\javascript\Games\SpaceInvaders\source\js\Controls\SpaceInvaders.cs

        //public readonly DefaultStyle style = new DefaultStyle();

        /// <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(IDefault page)
        {
            new SpaceInvadersTemplate.Library.Controls.SpaceInvaders();

            //style.Content.AttachToHead();



            // ! jsc can reorder statements
            // what if title and dom changes could be lifted back to server ahead of time?

            //@"Space Invaders".ToDocumentTitle();
        }
示例#57
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(IDefault page)
        {
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);


            AddAnimation(100, 200);
            AddAnimation(300, 300);
            AddAnimation(600, 250);
            AddAnimation(900, 350);
        }
示例#58
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(IDefault page)
        {
            // windows forms styles
            // classic
            // aero
            // metro

            new js.SimpleRollover();

            //@"Hello world".ToDocumentTitle();
            //// Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"A string from JavaScript.",
            //    value => value.ToDocumentTitle()
            //);
        }
示例#59
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(IDefault page)
        {
            var a = new AirforceExample.Application();

            a.AttachSpriteTo(page.Content);

            //var e = a.ToHTMLElement();


            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
示例#60
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(IDefault page)
        {
            var q = new[] { "foo", "bar" };

            Foo(q).WithEach(
                k => new IHTMLDiv {
                innerText = k
            }.AttachTo(page.Content)
                );

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