/// <summary> /// Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void UC_RoleMenusManager_Load(object sender, EventArgs e) { _menuTypeBll = new MenuTypeBll(); _menusBll = new MenusBll(); _roleMenusBll = new RoleMenusBll(); _rolesBll = new RolesBll(); _dicDataGridView = new Dictionary <int, Menus>(); //初始化 Init_TreeViewRoles(); //初始化 Init_TreeViewMenus(1); treeView_Roles.Focus(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Frm_Login_Load(object sender, EventArgs e) { _usersBll = new UsersBll(); _userRolesBll = new UserRolesBll(); _roleMenusBll = new RoleMenusBll(); #region 全局捕获异常 try { //处理UI线程异常 Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(CommonClass.Application_ThreadException); //处理非UI线程异常 AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CommonClass.CurrentDomain_UnhandledException); //设置应用程序处理异常方式:ThreadException处理,处理未捕获的异常 Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); } catch { //Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); //只要在线程上创建了任何控件,则线程异常模式将不能再有任何更改。 } #endregion }