Exemple #1
0
        public static void Start()
        {
            var bridge = new MyGlfwTopWindowBridge.GlfwEventBridge();

            Size primScreenSize = UIPlatform.CurrentPlatform.GetPrimaryMonitorSize();
            var  form           = new GlFwForm(primScreenSize.Width, primScreenSize.Height, "GLES_GLFW", bridge);

            //
            Init(form);
            //------

            AppHost       appHost = new AppHost();
            AppHostConfig config  = new AppHostConfig();

            config.RootGfx = s_myRootGfx;
            config.ScreenW = primScreenSize.Width;
            config.ScreenH = primScreenSize.Height;
            appHost.Setup(config);
            //------
            Box bgBox = new Box(primScreenSize.Width, primScreenSize.Height);

            bgBox.BackColor = Color.White;
            s_myRootGfx.AddChild(bgBox.GetPrimaryRenderElement());
            //------


            //appHost.StartApp(new Demo_BoxEvents3());
            appHost.StartApp(new Demo_ScrollView());
            //appHost.StartApp(new Demo_MultipleLabels());
            //appHost.StartApp(new Demo_MultipleLabels2());
            //---------
        }
Exemple #2
0
            public override void Configure(Container container)
            {
                base.Configure(container, ServiceDefaults.Instance);

                ServiceStack.Logging.LogManager.LogFactory = new DebugLogFactory();

                ServiceStack.Logging.LogManager.LogFactory = new Log4NetFactory(true);



                AppHostConfig.TrimConfig(ServiceDefaults.Instance, this, new HostConfig()
                {
                    HandlerFactoryPath = "Serviceapi"
                });
                AppHostConfig.Instance.IsInWebClient = true;



                //  Plugins.Add(new BearerAuthPlugin(ServiceDefaults.Instance.Authentication));

                Plugins.Add(new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] {
                    new TokenAuthProvider()
                }));

                this.Reconfigure();
            }
Exemple #3
0
        public static void Start()
        {
            //
            Init();
            //------
            Size          primScreenSize = UIPlatform.CurrentPlatform.GetPrimaryMonitorSize();
            AppHost       appHost        = new AppHost();
            AppHostConfig config         = new AppHostConfig();

            config.RootGfx = s_myRootGfx;
            config.ScreenW = primScreenSize.Width;
            config.ScreenH = primScreenSize.Height;
            appHost.Setup(config);
            //------
            Box bgBox = new Box(s_myRootGfx.Width, s_myRootGfx.Height);

            bgBox.BackColor = Color.White;
            s_myRootGfx.AddChild(bgBox.GetPrimaryRenderElement());
            //------


            //appHost.StartApp(new Demo_BoxEvents3());
            appHost.StartApp(new Demo_ScrollView());
            //appHost.StartApp(new Demo_MultipleLabels());
            //appHost.StartApp(new Demo_MultipleLabels2());
            //---------
        }
Exemple #4
0
        public void RunDemo(App app)
        {
            //1. create blank form
            YourImplementation.DemoFormCreatorHelper.CreateReadyForm(
                (InnerViewportKind)lstPlatformSelectors.SelectedItem,
                out _viewroot,
                out _latest_formCanvas);

            AppHost       appHost = new AppHost();
            AppHostConfig config  = new AppHostConfig();

            YourImplementation.UISurfaceViewportSetupHelper.SetUISurfaceViewportControl(config, _viewroot);
            appHost.Setup(config);


            _latest_formCanvas.FormClosed += (s, e) =>
            {
                //when owner form is disposed
                //we should clear our resource?
                app.OnClosing();
                app.OnClosed();
                _latest_formCanvas = null;
                _viewroot          = null;
            };


            //2. create app host
            appHost.StartApp(app);
            //_viewroot.TopDownRecalculateContent();
            _viewroot.PaintToOutputWindow();


            //==================================================
            if (this.chkShowLayoutInspector.Checked)
            {
                YourImplementation.LayoutInspectorUtils.ShowFormLayoutInspector(_viewroot);
            }

            if (this.chkShowFormPrint.Checked)
            {
                ShowFormPrint(_viewroot);
            }
        }