Guest User

Untitled

a guest
Jan 21st, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.AspNetCore.Hosting;
  3. using Microsoft.Extensions.DependencyInjection;
  4. using ElectronNET.API;
  5. using ElectronNET.API.Entities;
  6. using Microsoft.Extensions.Hosting;
  7.  
  8. namespace TestApp
  9. {
  10. public class Startup
  11. {
  12. public void ConfigureServices(IServiceCollection services)
  13. {
  14. services.AddMvc();
  15. }
  16.  
  17. public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
  18. {
  19. if (env.IsDevelopment())
  20. {
  21. app.UseDeveloperExceptionPage();
  22. }
  23.  
  24. app.UseRouting();
  25.  
  26. app.UseStaticFiles();
  27.  
  28. app.UseEndpoints(endpoints =>
  29. {
  30. endpoints.MapDefaultControllerRoute();
  31. });
  32.  
  33. Bootstrap();
  34. }
  35.  
  36. public async void Bootstrap()
  37. {
  38. var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
  39. {
  40. Height = 490,
  41. Width = 670,
  42. Center = true,
  43. UseContentSize = true,
  44. Show = true,
  45. Transparent = false,
  46. Frame = true,
  47. Resizable = false
  48. });
  49.  
  50. browserWindow.OnReadyToShow += () => browserWindow.Show();
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment