/// <summary> /// Open window form /// </summary> /// <param name="frm">XtraForm</param> public static void OpenWindowForm(DevExpress.XtraEditors.XtraForm frm) { frm.FormBorderStyle = FormBorderStyle.FixedToolWindow; frm.StartPosition = FormStartPosition.CenterScreen; frm.WindowState = FormWindowState.Normal; frm.ShowDialog(); }
public static void ShowWindow(DevExpress.XtraEditors.XtraForm mainForm, DevExpress.XtraEditors.XtraForm form, bool isWait, IFormat isFormat, IPermission isPermision, bool ignoreCheckShowForm) { //if (FrameworkParams.wait != null) FrameworkParams.wait.Finish(); //if (isWait) FrameworkParams.wait = new WaitingMsg(); ////Kích hoạt menu đang mở nếu đã mở //foreach (Form f in mainForm.MdiChildren) //{ // if (f.Text.Equals(form.Text) && f.Controls.Count == form.Controls.Count) // { // f.Activate(); // return; // } //} if (ignoreCheckShowForm == false) { if (HelpPermission.CanShowForm(form) == false) { ApplyPermissionAction.getPermissionFormFail().ShowDialog(); form.Dispose(); return; } } try { if (form.IsDisposed) return; HelpUserLog.logOpenForm(form); PLPlugin.HookShowAllPlugin(form); form.FormClosed += new FormClosedEventHandler(form_FormClosed); //form.Disposed += new EventHandler(form_Disposed); form.MdiParent = mainForm; form.MinimizeBox = false; form.WindowState = FormWindowState.Maximized; form.ShowInTaskbar = false; form.Icon = FrameworkParams.ApplicationIcon; ProtocolForm.pl_wrapper(ref form, isFormat, isPermision); form.Shown += new EventHandler(wait); //DEVEXPRESS if (FrameworkParams.UsingRightClickForm) HelpXtraForm.PopupRightClickForm(form); if (form is frmPermissionFail) form.ShowDialog(FrameworkParams.MainForm); else form.Show(); } catch (Exception ex) { PLException.AddException(ex); PLMessageBox.ShowSystemErrorMessage(ex.ToString()); } }
public static void ShowDialog(DevExpress.XtraEditors.XtraForm mainForm, DevExpress.XtraEditors.XtraForm form, bool isWaitForm, bool isModal, bool ignoreCheckShowForm) { //if (FrameworkParams.wait != null) FrameworkParams.wait.Finish(); //if (isWaitForm) FrameworkParams.wait = new WaitingMsg(); //Kiểm tra quyền. if (ignoreCheckShowForm == false) { if (HelpPermission.CanShowForm(form) == false) { ApplyPermissionAction.getPermissionFormFail().ShowDialog(); form.Dispose(); return; } } try { if (form.IsDisposed) return; HelpUserLog.logOpenForm(form); PLPlugin.HookShowAllPlugin(form); form.FormClosed += new FormClosedEventHandler(form_FormClosed); ProtocolForm.pl_wrapper(ref form); EventHandler showEvent = new EventHandler(wait); form.Shown += showEvent; //DEVEXPRESS if (FrameworkParams.UsingRightClickForm) HelpXtraForm.PopupRightClickForm(form); if (FrameworkParams.wait != null) FrameworkParams.wait.Finish(); if (form is frmPermissionFail) { form.ShowDialog(mainForm); } else { HelpXtraForm.SetModal(mainForm, form, isModal); } } catch (Exception ex) { PLException.AddException(ex); PLMessageBox.ShowSystemErrorMessage(ex.ToString()); } }