public void Configure( IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, FirstTimeSetup firstTimeSetup) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } var loggingSection = Configuration.GetSection("Logging"); loggerFactory.AddConsole(loggingSection); loggerFactory.AddDebug(loggingSection.GetValue <LogLevel>("Default")); app.UseDefaultFiles(); app.UseStaticFiles(); app.UseSwagger(); // Json endpoint (required for UI) app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", ApiTitle); }); app.UseIdentityServer(); app.UseAuthentication(); app.UseMvc(); firstTimeSetup.Run().Wait(); }
private void Application_Startup(object sender, StartupEventArgs e) { PreferencesHelper.LoadPrefs("preferences.xml"); var ffmpegNotFound = string.IsNullOrWhiteSpace(PreferencesHelper.ffmpegPath); var ffprobeNotFound = string.IsNullOrWhiteSpace(PreferencesHelper.ffprobePath); var ffplayNotFound = string.IsNullOrWhiteSpace(PreferencesHelper.ffplayPath); if (ffmpegNotFound || ffprobeNotFound || ffplayNotFound) { FirstTimeSetup.AutoSetupFFMpeg(); } }
private void StartTutorial() { TutorialPage tutPage = new TutorialPage(); tutPage.Complete += new EventHandler((o, e) => { FirstTimeSetup fts = new FirstTimeSetup(); fts.OnSetupComplete += new EventHandler((o2, e2) => { //setup is complete, save that in the app config m_config.IsSetUp = true; //attempt to load the keys and run the normal app start code m_ln.LoadKeys(); this.OnStart(); }); this.MainPage = new NavigationPage(fts) { Title = "Locknote First Time Setup" }; }); //check to see if notebooks exist already if (Directory.Exists(NoteManager.GetNotebookDir())) { Prompt p = new Prompt() { PromptTitle = "Found notebooks. Running first time set up will delete these notebooks. Would you like to continue anyway?", NegativeButtonText = "No", PositiveButtonText = "Yes" }; p.OnPromptSaved += new Prompt.PromptClosedEventListener(() => { MainPage = tutPage; }); p.Show(); } else { MainPage = tutPage; } }
private void Autodetect_FFMpeg(object sender, RoutedEventArgs e) { FirstTimeSetup.AutoSetupFFMpeg(); FFMpeg_Location.Text = PreferencesHelper.ffmpegPath; }