// 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(); }
static MainActivity() { ////////// 启动引擎 AppEngine.Init() .RegisterComponent <IPlatformService, AndroidPlatformService>(LifeCycleEnum.Singleton) .UseOlliixAppConfigurations() .Start(); }
// // 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)); }
private void StartEngine(object sender, RoutedEventArgs e) { engine.Init(); viewModel.DialogRunning = true; SetNewQuestion(); }