Пример #1
0
        public MainForm(Thread demonThread, Demon demon)
        {
            InitializeComponent();
            this.demonThread = demonThread;
            this.demon = demon;

            System.Console.WriteLine("MainForm constructor " + demonThread.ManagedThreadId);
        }
Пример #2
0
        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));
        }