Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            appEngine = new AppEngine(loggerFactory);

            appEngine.Plugins.OrderBy(x => x.Priority).ToList().ForEach(x =>
            {
                x.Setup(Configuration);
            });

            services.AddMvc();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "Web API", Version = "v1"
                });
                //x.IncludeXmlComments(AppContext.BaseDirectory + "YourProject.Api.xml");
                c.IgnoreObsoleteProperties();
                c.IgnoreObsoleteActions();
                c.DescribeAllEnumsAsStrings();
            });

            //Invoke appEngine

            appEngine.Plugins.OrderBy(x => x.Priority).ToList().ForEach(x =>
            {
                x.ConfigureServices(services);
            });

            appEngine.Init();
        }
Ejemplo n.º 2
0
 static MainActivity()
 {
     ////////// 启动引擎
     AppEngine.Init()
     .RegisterComponent <IPlatformService, AndroidPlatformService>(LifeCycleEnum.Singleton)
     .UseOlliixAppConfigurations()
     .Start();
 }
Ejemplo n.º 3
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            ////////// 启动引擎
            AppEngine.Init()
            .RegisterComponent <IPlatformService, iOSPlatformService>(LifeCycleEnum.Singleton)
            .UseOlliixAppConfigurations()
            .Start();

            ////////// 初始化浏览器
            FormsWebViewRenderer.Initialize();
            FormsWebViewRenderer.OnControlChanged += FormsWebViewRenderer_OnControlChanged;

            ////////// 初始化扫描器
            ZXing.Net.Mobile.Forms.iOS.Platform.Init();

            // 强制竖屏

            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 4
0
 private void StartEngine(object sender, RoutedEventArgs e)
 {
     engine.Init();
     viewModel.DialogRunning = true;
     SetNewQuestion();
 }