Demo-C/Tech/Program.cs

33 lines
999 B
C#
Raw Permalink Normal View History

2023-01-11 02:28:05 +08:00
using System;
using System.Runtime.InteropServices;
2023-01-11 02:28:05 +08:00
using System.Windows.Forms;
2023-02-01 10:16:10 +08:00
using Tech_Demo.Presenter;
using Tech_Demo.View.Impl;
2023-01-11 02:28:05 +08:00
2023-01-15 01:51:22 +08:00
namespace Tech_Demo
2023-01-11 02:28:05 +08:00
{
static class Program
{
2023-02-01 10:16:10 +08:00
[DllImport("kernel32.dll")]
static extern bool AttachConsole(int dwProcessId);
private const int ATTACH_PARENT_PROCESS = -1;
2023-01-11 02:28:05 +08:00
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
AttachConsole(ATTACH_PARENT_PROCESS);
2023-01-11 02:28:05 +08:00
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
2023-02-01 10:16:10 +08:00
var mainView = new MainView();
mainView.Presenter = new MainPresenter(mainView, null);
Application.Run(mainView);
2023-02-01 16:41:53 +08:00
// var startNew = Task.Factory.StartNew(() => ("Hello Task"), TaskCreationOptions.LongRunning);
// Console.WriteLine(startNew.Result);
2023-01-11 02:28:05 +08:00
}
}
2023-02-01 10:16:10 +08:00
}