static void InitializeWorkbench() { IWorkbench workbench = new MainForm(); workbench.WorkbenchMenu = new DefaultMenu(); // IList<Company> companies = Company.FindRecent(); // foreach (Company c in companies) { // workbench.WorkbenchMenu.PreviousOpenCompaniesMenuItem.DropDownItems.Add(new BToolStripMenuItem(c.Database.ConnectionString)); // } // if (companies.Count > 0) { // companies[companies.Count - 1].Open(); // } WorkbenchSingleton.Attach(workbench); WorkbenchSingleton.MainForm.Text = ApplicationUtility.ProductNameAndVersion + " - " + CompanySingleton.Instance.Name; // workbench.Login += delegate { // workbench.FreezeControlForLogin(); // ILoginController login = new LoginController( // new LoginForm(CompanySingleton.Instance), // new NHibernateUserDao() // ); // if (WorkbenchSingleton.AddDialog((Form)login.View) == DialogResult.Cancel) { // workbench.Close(); // } else { // workbench.UnFreezeControlForLogin(); // new ShowHomePage().Run(); // } // }; }
private static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); WorkbenchSingleton.Attach(new MainForm()); Application.Run(WorkbenchSingleton.MainForm); }