Esempio 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(IApp page)
        {
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201403/20140301
#if FCHROME
            FormStyler.AtFormCreated =
               s =>
               {
                   s.Context.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

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

            #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.DefaultIconUrl = new HTML.Images.FromAssets.Preview().src;
                chrome.Notification.DefaultTitle = "Multitouch";


                ChromeTCPServer.TheServerWithStyledForm.Invoke(
                    AppSource.Text,
                    ApplicationSprite.DefaultWidth,
                    ApplicationSprite.DefaultHeight,
                    FormStyler.AtFormCreated
                );





                return;
            }
            #endregion

#endif

#if FCHROME
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2015/201501/20150110


            #region += Launched chrome.app.window
            // X:\jsc.svn\examples\javascript\chrome\apps\ChromeTCPServerAppWindow\ChromeTCPServerAppWindow\Application.cs
            dynamic self = Native.self;
            dynamic self_chrome = self.chrome;
            object self_chrome_socket = self_chrome.socket;

            if (self_chrome_socket != null)
            {
                //chrome.Notification.DefaultTitle = "Audi Visualization";
                //chrome.Notification.DefaultIconUrl = new x128().src;

                chrome.Notification.DefaultIconUrl = new HTML.Images.FromAssets.Preview().src;
                chrome.Notification.DefaultTitle = "MultitouchFingerTools.FlashLAN";


                ChromeTCPServer.TheServerWithAppWindow.Invoke(
                    AppSource.Text
                    );

                return;
            }
            #endregion
#endif


            var sprite = new ApplicationSprite();
            sprite.AttachSpriteToDocument().With(
                   embed =>
                   {
                       embed.style.SetLocation(0, 0);
                       embed.style.SetSize(Native.window.Width, Native.window.Height);

                       Native.window.onresize +=
                           delegate
                           {
                               embed.style.SetSize(Native.window.Width, Native.window.Height);
                           };
                   }
               );
        }
Esempio 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(IApp page)
        {
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201403/20140301
#if FCHROME
            FormStyler.AtFormCreated =
                s =>
            {
                s.Context.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

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

            #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.DefaultIconUrl = new HTML.Images.FromAssets.Preview().src;
                chrome.Notification.DefaultTitle   = "Multitouch";


                ChromeTCPServer.TheServerWithStyledForm.Invoke(
                    AppSource.Text,
                    ApplicationSprite.DefaultWidth,
                    ApplicationSprite.DefaultHeight,
                    FormStyler.AtFormCreated
                    );



                return;
            }
            #endregion
#endif

#if FCHROME
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2015/201501/20150110


            #region += Launched chrome.app.window
            // X:\jsc.svn\examples\javascript\chrome\apps\ChromeTCPServerAppWindow\ChromeTCPServerAppWindow\Application.cs
            dynamic self               = Native.self;
            dynamic self_chrome        = self.chrome;
            object  self_chrome_socket = self_chrome.socket;

            if (self_chrome_socket != null)
            {
                //chrome.Notification.DefaultTitle = "Audi Visualization";
                //chrome.Notification.DefaultIconUrl = new x128().src;

                chrome.Notification.DefaultIconUrl = new HTML.Images.FromAssets.Preview().src;
                chrome.Notification.DefaultTitle   = "MultitouchFingerTools.FlashLAN";


                ChromeTCPServer.TheServerWithAppWindow.Invoke(
                    AppSource.Text
                    );

                return;
            }
            #endregion
#endif


            var sprite = new ApplicationSprite();
            sprite.AttachSpriteToDocument().With(
                embed =>
            {
                embed.style.SetLocation(0, 0);
                embed.style.SetSize(Native.window.Width, Native.window.Height);

                Native.window.onresize +=
                    delegate
                {
                    embed.style.SetSize(Native.window.Width, Native.window.Height);
                };
            }
                );
        }