public MainForm(Thread demonThread, Demon demon) { InitializeComponent(); this.demonThread = demonThread; this.demon = demon; System.Console.WriteLine("MainForm constructor " + demonThread.ManagedThreadId); }
static void Main() { IRepository rep = Repository.Instance; rep.WriteLine(); Demon demon = new Demon(); Thread demonThread = new Thread(() => demon.start()); //demonThread.Start(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm(demonThread, demon)); }