static void Main() { // Detect existing instances string processName = Process.GetCurrentProcess().ProcessName; Process[] instances = Process.GetProcessesByName(processName); if (instances.Length > 1) { return; } // End of detection Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new MainForm()); Application.Run(NinjectFactory.Resolve <MainForm>()); }
public MainForm() { InitializeComponent(); SetUpControlls(); controller = NinjectFactory.Resolve <IController>(this); }