예제 #1
0
파일: Program.cs 프로젝트: anoozz/nbooks
        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();
//				}
//			};
        }
예제 #2
0
파일: Program.cs 프로젝트: anoozz/nbooks
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            WorkbenchSingleton.Attach(new MainForm());
            Application.Run(WorkbenchSingleton.MainForm);
        }