Ejemplo n.º 1
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(IDefaultPage page)
        {
            //            http://www.adobe.com/devnet/flash/articles/multitouch_gestures.html
            //These samples demonstrate the use of multi-touch and gesture APIs.

            // Initialize MySprite1
            new MySprite1().AttachSpriteTo(page.Content);
            @"Hello world".ToDocumentTitle();
            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();
                }
            );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            page.Send.onclick +=
                delegate
                {
                    service.AddItem(
                      page.Key.value,
                      page.Content.value,
                      value => value.ToDocumentTitle()
                    );
                };

            page.Enumerate.onclick +=
                delegate
                {
                    page.output.Clear();

                    service.EnumerateItems(
                        "",
                        (Key, Content) =>
                        {
                            page.output.Add(
                                new IHTMLDiv { innerText = new { Key, Content }.ToString() }
                            );
                        }
                    );
                };

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier

        }
Ejemplo n.º 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(IDefaultPage page)
        {
            // Initialize ApplicationSprite
            sprite.AttachSpriteToDocument();

            page.PageContainer.AsXElement().With(
                PageContainerBefore =>
            {
                sprite.Foo(PageContainerBefore,
                           PageContainerBeforeAfter =>
                {
                    page.ViewXMLSource.innerText = PageContainerBeforeAfter.ToString();
                    page.Placeholder.innerHTML   = PageContainerBeforeAfter.ToString();
                }
                           );
            }
                );

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
Ejemplo n.º 4
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(IDefaultPage 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()
                );
        }
Ejemplo n.º 5
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(IDefaultPage page)
        {
            page.Send.onclick +=
                delegate
            {
                service.AddItem(
                    page.Key.value,
                    page.Content.value,
                    value => value.ToDocumentTitle()
                    );
            };

            //page.Enumerate.onclick +=
            //    delegate
            //    {
            //        page.output.Clear();

            //        service.EnumerateItems(
            //            "",
            //            (Key, Content) =>
            //            {
            //                page.output.Add(
            //                    new IHTMLDiv { innerText = new { Key, Content }.ToString() }
            //                );
            //            }
            //        );
            //    };

            @"Hello world".ToDocumentTitle();
        }
Ejemplo n.º 6
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(IDefaultPage page)
        {
            // Update document title
            // http://do.jsc-solutions.net/Update-document-title

            @"Hello world".ToDocumentTitle();
            // Send xml to server
            // http://do.jsc-solutions.net/Send-xml-to-server

            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)
                {
                    // Show server message as document title
                    // http://do.jsc-solutions.net/Show-server-message-as-document-title

                    doc.Element(@"Data").Value.ToDocumentTitle();
                }
            );
        }
Ejemplo n.º 7
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(IDefaultPage page)
        {
            // Initialize MySprite1
            var s = new MySprite1();

            s.AttachSpriteTo(page.Content);


            // Send data from JavaScript to the server tier
            service.WebMethod2(
                "",
                list =>
            {
                var ChannelContainer = page.Content;

                Action <string> ChannelSelected =
                    channel =>
                {
                    page.Header.innerHTML = "JustinTV - " + channel;
                    s.api_play_live(channel);
                };

                Foo.ListElements(list, ChannelContainer, ChannelSelected);
            }
                );
        }
Ejemplo n.º 8
0
        static void InitializeContnt(IDefaultPage page)
        {
            Action<dynamic> stream =
                x =>
                {
                    object time = x.time;
                    object i = x.i;

                    Native.document.title = new { time, i }.ToString();
                    Console.WriteLine(new { time, i }.ToString());
                    page.Content.innerText = new { time, i }.ToString();
                };

            dynamic window = Native.window;

            window.stream = stream;

            var stop = new IHTMLButton("Stop").AttachToDocument();

            var iframe = new IHTMLIFrame { src = "/stream" }.AttachToDocument();
            iframe.Hide();

            page.Start.disabled = true;

            stop.onclick +=
                delegate
                {
                    stop.Orphanize();
                    page.Start.disabled = false;
                    iframe.Orphanize();
                };

            Native.document.body.style.cursor = IStyle.CursorEnum.@default;
        }
Ejemplo n.º 9
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(IDefaultPage page)
        {
            // Initialize MySprite1
            var s = new MySprite1();

            s.AttachSpriteTo(page.Content);


            // Send data from JavaScript to the server tier
            service.WebMethod2(
                "",
                list =>
                {
                    var ChannelContainer = page.Content;

                    Action<string> ChannelSelected =
                        channel =>
                        {
                            page.Header.innerHTML = "JustinTV - " + channel;
                            s.api_play_live(channel);
                        };

                    Foo.ListElements(list, ChannelContainer, ChannelSelected);
                }
            );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            page.PageContainer.AsXElement().Elements().WithEach(
                e =>
                {
                    e.Elements().WithEach(
                        span =>
                        {
                            // what about xmlns like facebook?
                            span.Add(new XElement("code", " (" + span.Name.LocalName + ")"));
                        }
                    );

                    e.Add(new XElement("code", " (element of PageContainer)"));
                }
            );

            page.PageContainer.AsXElement().Elements().Elements("span").WithEach(
                span =>
                {
                    span.Add(
                        new XAttribute("style", "color: red;")
                    );

                }
            );

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
Ejemplo n.º 11
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(IDefaultPage page)
        {
            // Initialize MySprite1

            var s = new MySprite1();

            s.AtMessage            +=
                x => page.Log.value = x + Environment.NewLine + page.Log.value;

            s.AttachSpriteTo(page.Content);

            new Timer(
                t =>
            {
                s.PostMessage("timer: " + t.Counter);
            }
                , 500, 15000
                );

            page.Send.onclick +=
                delegate
            {
                s.PostMessage("entry:" + page.Entry.value);
            };

            @"Hello world".ToDocumentTitle();
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            // Update document title
            // http://do.jsc-solutions.net/Update-document-title

            @"Hello world".ToDocumentTitle();

            #region phase 2
            var bg = new IHTMLDiv().AttachTo(page.Header);

            bg.style.SetSize(800, 600);
            bg.style.position = IStyle.PositionEnum.relative;

            var c = new IHTMLDiv().AttachTo(bg);

            c.style.left     = "4px";
            c.style.right    = "4px";
            c.style.bottom   = "4px";
            c.style.top      = "4px";
            c.style.position = IStyle.PositionEnum.absolute;

            new TwentyTenWorkspace().ToBackground(
                bg.style
                );


            var dv = new SolutionDocumentViewer
            {
                "Default.htm",
                "Application.cs",
                "ApplicationWebService.cs",
                "XX XXX XX XXX XX XXX XXX XXx XXX XXX",
            };

            dv.Add(
                new SolutionDocumentViewerTab
            {
                Text = "Program.cs"
            }.With(
                    k =>
            {
                k.Activated +=
                    delegate
                {
                    dv.Content.innerHTML = "hello world";
                };
            }
                    )
                );

            dv.Container.AttachTo(c);
            dv.Last().Activate();


            #endregion

            new TwentyTenWorkspace().ToBackground(
                page.Background.style
                );
        }
Ejemplo n.º 13
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(IDefaultPage page)
        {
            //            http://www.adobe.com/devnet/flash/articles/multitouch_gestures.html
            //These samples demonstrate the use of multi-touch and gesture APIs.

            // Initialize MySprite1
            new MySprite1().AttachSpriteTo(page.Content);
            @"Hello world".ToDocumentTitle();
            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();
            }
                );
        }
Ejemplo n.º 14
0
        //public readonly ApplicationCanvas canvas = new ApplicationCanvas();


        /// <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(IDefaultPage page)
        {
            content.AttachControlTo(page.Content);
            content.AutoSizeControlTo(page.ContentSize);

            //canvas.TriggerOnClick = false;
            //canvas.Background = Brushes.Transparent;

  

            //canvas.AnimationCompleted +=
            //    delegate
            //    {
            //        ScriptCoreLib.JavaScript.Extensions.AvalonExtensions.ToHTMLElement(
            //            canvas
            //        ).Orphanize();
            //    };

            //canvas.AttachToContainer(page.Content);
            //canvas.AutoSizeTo(page.ContentSize);

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            new __glMatrix().Content.With(
               source =>
               {
                   source.onload +=
                       delegate
                       {
                           //new IFunction("alert(CanvasMatrix4);").apply(null);

                           InitializeContent(page);
                       };

                   source.AttachToDocument();
               }
           );


            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            page.Send.onclick +=
                  delegate
                  {
                      service.AddItem(
                        page.Key.value,
                        page.Content.value,
                        value => value.ToDocumentTitle()
                      );
                  };

            //page.Enumerate.onclick +=
            //    delegate
            //    {
            //        page.output.Clear();

            //        service.EnumerateItems(
            //            "",
            //            (Key, Content) =>
            //            {
            //                page.output.Add(
            //                    new IHTMLDiv { innerText = new { Key, Content }.ToString() }
            //                );
            //            }
            //        );
            //    };

            @"Hello world".ToDocumentTitle();
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            var m = new MemoryStream();

            m.WriteByte((byte)'H');
            m.WriteByte((byte)'E');
            m.WriteByte((byte)'L');
            m.WriteByte((byte)'L');
            m.WriteByte((byte)'O');

            var a = m.ToArray();

            //Native.API.var_dump(a);

            var w = new StringBuilder();

            foreach (var item in a)
            {
                w.Append(item.ToString("x2"));
            }

            w.Append(", " + Convert.ToBase64String(a));

            // {48454c4c4f, SEVMTE8=}
            var e = w.ToString();

            new IHTMLPre { innerText = e }.AttachToDocument();

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            // Update document title
            // http://do.jsc-solutions.net/Update-document-title

            @"Hello world".ToDocumentTitle();
            // Send xml to server
            // http://do.jsc-solutions.net/Send-xml-to-server

            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)
            {
                // Show server message as document title
                // http://do.jsc-solutions.net/Show-server-message-as-document-title

                doc.Element(@"Data").Value.ToDocumentTitle();
            }
                );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            new Design.base64().Content.WhenAvailable(
                 delegate
                 {

                     new Design.sprintf().Content.WhenAvailable(
                          delegate
                          {

                              new Design.jspdf().Content.WhenAvailable(
                                 delegate
                                 {

                                     InitializeContent(page);
                                 }
                              );
                          }
                       );
                 }
              );


            InitializeContent(page);

            style.Content.AttachToHead();
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            // Initialize MySprite1

            var s = new MySprite1();

            s.AtMessage +=
                x => page.Log.value = x + Environment.NewLine + page.Log.value;

            s.AttachSpriteTo(page.Content);

            new Timer(
                t =>
                {
                    s.PostMessage("timer: " + t.Counter);
                }
                , 500, 15000
            );

            page.Send.onclick +=
                delegate
                {
                    s.PostMessage("entry:" + page.Entry.value);
                };

            @"Hello world".ToDocumentTitle();
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            page.UserControl1.ReplaceWith(
                new UserControl1()
            );

            @"Hello world".ToDocumentTitle();
            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();
                }
            );
        }
Ejemplo n.º 22
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(IDefaultPage page)
        {
            page.PageContainer.AsXElement().Elements().WithEach(
                e =>
            {
                e.Elements().WithEach(
                    span =>
                {
                    // what about xmlns like facebook?
                    span.Add(new XElement("code", " (" + span.Name.LocalName + ")"));
                }
                    );

                e.Add(new XElement("code", " (element of PageContainer)"));
            }
                );

            page.PageContainer.AsXElement().Elements().Elements("span").WithEach(
                span =>
            {
                span.Add(
                    new XAttribute("style", "color: red;")
                    );
            }
                );

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            var data = new[]
            {
                new { Text = "foo", i = "a", j = 71},
                new { Text = "goo", i = "d", j = 7},
                new { Text = "boo", i = "b", j = 87},
                new { Text = "noo", i = "c", j = 2}
            };

            data.OrderBy(k => k.i).WithEach(
                k =>
                {
                    new IHTMLPre { innerText = k.ToString() }.AttachToDocument();
                }
            );

            
            data.OrderBy(k => k.j).WithEach(
                k =>
                {
                    new IHTMLPre { innerText = k.ToString() }.AttachToDocument();
                }
            );

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


            // Initialize ApplicationSprite
            sprite.AttachSpriteToDocument();

            page.PageContainer.AsXElement().With(
                 PageContainerBefore =>
                 {
                     sprite.Foo(PageContainerBefore,
                         PageContainerBeforeAfter =>
                         {
                             page.ViewXMLSource.innerText = PageContainerBeforeAfter.ToString();
                             page.Placeholder.innerHTML = PageContainerBeforeAfter.ToString();
                         }
                     );

                 }
             );

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
Ejemplo n.º 25
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(IDefaultPage page)
        {
            page.Send.onclick +=
                delegate
            {
                service.AddItem(
                    page.Key.value,
                    page.Content.value,
                    value => value.ToDocumentTitle()
                    );
            };

            page.Enumerate.onclick +=
                delegate
            {
                page.output.Clear();

                service.EnumerateItems(
                    "",
                    (Key, Content) =>
                {
                    page.output.Add(
                        new IHTMLDiv {
                        innerText = new { Key, Content }.ToString()
                    }
                        );
                }
                    );
            };

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            page.UserControl1.ReplaceWith(
                new UserControl1()
                );

            @"Hello world".ToDocumentTitle();
            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();
            }
                );
        }
Ejemplo n.º 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(IDefaultPage page)
 {
     page.Start.onclick +=
         delegate
     {
         InitializeContnt(page);
     };
 }
Ejemplo n.º 28
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(IDefaultPage page)
 {
     page.Start.onclick +=
         delegate
         {
             InitializeContnt(page);
         };
 }
Ejemplo n.º 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(IDefaultPage 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);
            }
                );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            // Update document title
            // http://do.jsc-solutions.net/Update-document-title



            page.Content = new StudioView(AddSaveButton).Content;
        }
Ejemplo n.º 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(IDefaultPage page)
 {
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => value.ToDocumentTitle()
         );
 }
Ejemplo n.º 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(IDefaultPage page)
 {
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => new IHTMLDiv { innerText = value }.AttachToDocument()
     );
 }
Ejemplo n.º 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(IDefaultPage page)
        {
            style.Content.AttachToHead();
            @"before".ToDocumentTitle();

            Initialize();

            @"after".ToDocumentTitle();
        }
Ejemplo n.º 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(IDefaultPage page)
 {
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => value.ToDocumentTitle()
     );
 }
Ejemplo n.º 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(IDefaultPage 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()
     );
 }
Ejemplo n.º 36
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(IDefaultPage page)
		{
			// Update document title
			// http://do.jsc-solutions.net/Update-document-title



			page.Content = new StudioView(AddSaveButton).Content;

		}
Ejemplo n.º 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(IDefaultPage 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()
         );
 }
Ejemplo n.º 38
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(IDefaultPage page)
        {
            style.Content.AttachToHead();
            @"before".ToDocumentTitle();

            Initialize();

            @"after".ToDocumentTitle();

        }
Ejemplo n.º 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(IDefaultPage 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()
     );
 }
Ejemplo n.º 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(IDefaultPage page)
        {
            new NumberGuessingGame.source.js.Controls.NumberGuessingGame();

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
Ejemplo n.º 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(IDefaultPage page)
 {
     // Initialize ApplicationApplet
     new ApplicationApplet().AttachAppletTo(page.Content);
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => value.ToDocumentTitle()
         );
 }
Ejemplo n.º 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(IDefaultPage page)
 {
     @"Hello world".ToDocumentTitle();
     // Send data from JavaScript to the server tier
     service.WebMethod2(
         @"A string from JavaScript.",
         value => new IHTMLDiv {
         innerText = value
     }.AttachToDocument()
         );
 }
Ejemplo n.º 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(IDefaultPage page)
        {
            new NumberGuessingGame.source.js.Controls.NumberGuessingGame();

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            Native.Window.alert(
                new TestNuGetSupport.Foo.Class1().FooValue
            );

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            FormStyler.AtFormCreated = FormStyler.LikeVisualStudioMetro;

            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()
            );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            var content = new ApplicationCanvas();

            content.AttachToContainer(Native.Document.body);

            Native.Window.onresize +=
                delegate
            {
                content.Width  = Native.Window.Width;
                content.Height = Native.Window.Height;
            };
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );


            { var f = "assets/TestNuGetSupport.FeedServer/TestNuGetSupport.Foo.0.0.0.1.nupkg"; }
            { var f = "assets/TestNuGetSupport.FeedServer/TestNuGetSupport.FooForm.0.0.0.1.nupkg"; }
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            Native.Window.alert(
                new TestNuGetSupport.Foo.Class1().FooValue
                );

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            var content = new ApplicationCanvas();

            content.AttachToContainer(Native.Document.body);

            Native.Window.onresize +=
                delegate
                {
                    content.Width = Native.Window.Width;
                    content.Height = Native.Window.Height;
                };
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );


            { var f = "assets/TestNuGetSupport.FeedServer/TestNuGetSupport.Foo.0.0.0.1.nupkg"; }
            { var f = "assets/TestNuGetSupport.FeedServer/TestNuGetSupport.FooForm.0.0.0.1.nupkg"; }

        }
Ejemplo n.º 51
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(IDefaultPage page)
        {
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"Android+JS",
                value => 
                {
                    value.ToDocumentTitle();

                    page.Header.innerText = value;
                }
            );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                (t, db) =>
                {
                    t.ToDocumentTitle();

                    new IHTMLPre { innerText = db }.AttachToDocument();
                }
            );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"Android+JS",
                value =>
            {
                value.ToDocumentTitle();

                page.Header.innerText = value;
            }
                );
        }
Ejemplo n.º 54
0
        private static void ShowFiles(IDefaultPage page)
        {
            var p = new Assets.Publish();

            foreach (string key in p.Keys)
            {
                new IHTMLDiv { 
                    new IHTMLOrderedList
                    {
                        new IHTMLListItem { new IHTMLAnchor { href = p[key],  innerText = key } },
                        new IHTMLListItem { new IHTMLAnchor { href = "/publish/" + key,  innerText = key } },
                    }
                }.AttachTo(page.Content);
            }
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            applet.AutoSizeAppletTo(page.ContentSize);
            applet.AttachAppletTo(page.Content);
            @"Hello world".ToDocumentTitle();

            applet.SendStringViaGeneric +=
                e =>
            {
                // Send data from JavaScript to the server tier
                service.WebMethod2(
                    e,
                    value => value.ToDocumentTitle()
                    );
            };
        }
Ejemplo n.º 56
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(IDefaultPage page)
        {
            content.AttachToContainer(page.Content);
            content.AutoSizeTo(page.ContentSize);

            // originally this was written for flash on android

            //Native.Window.ondeviceorientation +=
            //    e =>
            //    {
            //        // still { alpha = 334.01653539221314, beta = -0.9072213706108246, gamma = 2.2069056243739933 }
            //        // anwser { alpha = 302.3353381347018, beta = -3.5312795178828775, gamma = -36.28494624868044 }
            //        //  left { alpha = 319.83587080725647, beta = -22.594597038576925, gamma = 2.9337113900403393 }
            //        // right { alpha = 349.2730401488114, beta = 17.597914094646153, gamma = 1.7935541017490462 }


            //        //az = (p.Y / this.Height);
            //        //ax = -1 * ((p.X / this.Width) - 0.5);

            //        var az = Math.Min(0, Math.Max(e.alpha, -33)) / 33.0;
            //        var ax = 1 * Math.Min(33, Math.Max(e.beta, -33)) / 66.0;

            //        Console.WriteLine(
            //              new
            //              {
            //                  e.alpha,
            //                  e.beta,
            //                  e.gamma,

            //              }.ToString()
            //          );

            //        //content.Accelerate(
            //        //    e.gamma,
            //        //    ax,
            //        //    az
            //        //);
            //    };

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            applet.AutoSizeAppletTo(page.ContentSize);
            applet.AttachAppletTo(page.Content);
            applet.AtClick +=
                s =>
            {
                Native.Window.alert(s);
            };

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            new IHTMLButton {
                innerText = "open Other page"
            }.AttachToDocument().onclick +=
                delegate
            {
                Native.Window.open("/o", "_self");
            };

            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            // http://www.addyosmani.com/resources/googlebox/

            new trans3d().Content.AttachToDocument().onload +=
                delegate
            {
                InitializeContent(page);
            };


            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
                );
        }
Ejemplo n.º 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(IDefaultPage page)
        {
            //new oak().ToBackground(page.PageContainer.style);

            // Initialize MySprite1
            var m = new MySprite1();

            //m.ToTransparentSprite();
            m.ToHTMLElement().With(
                e =>
            {
                e.style.position = IStyle.PositionEnum.absolute;
                e.style.left     = "0";
                e.style.top      = "0";
                e.setAttribute("width", "100%");
                e.setAttribute("height", "100%");
            }
                );

            m.AttachSpriteTo(page.Content);

            @"Hello world".ToDocumentTitle();
            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();
            }
                );
        }