static void Main() { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); Console.WriteLine("HELLO"); }
static void Main() { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new fPrincipale()); }
static void Main() { var salas = new SalaRepository().Obtener(); Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new UI.EditarSala(new Logic.SalaLogic(salas.First()))); }
static void Main() { #if NETCOREAPP Application.SetHighDpiMode(HighDpiMode.PerMonitorV2); #endif Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
static void Main() { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Form1 form1 = new Form1(); Application.Run(form1); form1.repaint(); }
static void Main() { ///Added Database Database databaseObject = new Database(); Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
static void Main() { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var services = new ServiceCollection(); RegisterServie(services); //zbudowanie dostawcy using (ServiceProvider serviceProvider = services.BuildServiceProvider()) { var form1 = serviceProvider.GetRequiredService <Form1>(); Application.Run(form1); } }
static void Main() { var builder = new HostBuilder() .ConfigureServices((hostContext, services) => { services.AddSingleton <Main>(); services.AddLogging(configure => configure.AddConsole()); // Register the services.RegisterContextInjection(options => options.UseSqlServer( // This is simply the connection stirng connecitonstring, // We add a migration assembly only if the EF core DbContext is in another project actions => actions.MigrationsAssembly("My.Other.Project.Assembly") )); // Register the repositories services.RegisterRepositoryInjections(); }); var host = builder.Build(); Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); using (var serviceScope = host.Services.CreateScope()) { try { var main = serviceScope.ServiceProvider.GetRequiredService <Main>(); Application.Run(main); } catch (Exception e) { Console.WriteLine("Error has occured: " + e.Message); } } }
static void Main() { // Reflection trick does not helps too much. #if NET472 var field = typeof(Control.ControlAccessibleObject) .GetField("s_oleAccAvailable", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); field.SetValue(null, IntPtr.Zero); #else Application.SetHighDpiMode(HighDpiMode.SystemAware); var field = typeof(Control.ControlAccessibleObject) .GetField("s_oleAccAvailable", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); //field.SetValue(null, IntPtr.Zero); #endif ComWrappers.RegisterForMarshalling(WinFormsComInterop.WinFormsComWrappers.Instance); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }