예제 #1
0
 private void ShowMessageInFormConfirm(string message, frmOrderFormConfirm.OpenStyle openStyle, int verifyCode)
 {
     if (base.InvokeRequired)
     {
         base.Invoke(new frmCleanPort.ShowMessageInFormConfirmCallBack(this.ShowMessageInFormConfirm), new object[]
         {
             message,
             openStyle,
             verifyCode
         });
     }
     else
     {
         try
         {
             if (this._frmConfirm != null)
             {
                 if (!this._frmConfirm.IsDisposed)
                 {
                     this._frmConfirm.Dispose();
                 }
                 this._frmConfirm = null;
             }
             this._frmConfirm = new frmOrderFormConfirm(message, openStyle);
             this._frmConfirm.FormClosing -= new FormClosingEventHandler(this.frmConfirm_FormClosing);
             this._frmConfirm.FormClosing += new FormClosingEventHandler(this.frmConfirm_FormClosing);
             this._frmConfirm.TopLevel = false;
             this._frmConfirm.Parent = base.Parent;
             this._frmConfirm.Location = new Point((this._frmConfirm.Parent.Width - this._frmConfirm.Width) / 2, (this._frmConfirm.Parent.Height - this._frmConfirm.Height) / 2);
             this._frmConfirm.TopMost = true;
             this._frmConfirm.Show();
             this._frmConfirm.BringToFront();
         }
         catch (Exception ex)
         {
             this.ShowError("ShowMessageInFormConfirm", ex);
         }
     }
 }
예제 #2
0
 private void ShowMessageInFormConfirm(string message, frmOrderFormConfirm.OpenStyle openStyle)
 {
     if (base.InvokeRequired)
     {
         base.Invoke(new ucSmart1Click.ShowMessageInFormConfirmCallBack(this.ShowMessageInFormConfirm), new object[]
         {
             message,
             openStyle
         });
     }
     else
     {
         try
         {
             if (this.frmConfirm != null)
             {
                 if (!this.frmConfirm.IsDisposed)
                 {
                     this.frmConfirm.Dispose();
                 }
                 this.frmConfirm = null;
             }
             this.frmConfirm = new frmOrderFormConfirm(message, openStyle);
             this.frmConfirm.FormClosing -= new FormClosingEventHandler(this.frmConfirm_FormClosing);
             this.frmConfirm.FormClosing += new FormClosingEventHandler(this.frmConfirm_FormClosing);
             this.frmConfirm.TopLevel = false;
             if (base.Parent.GetType() == typeof(Panel))
             {
                 this.frmConfirm.Parent = base.Parent.Parent;
             }
             else if (base.Parent.GetType().BaseType == typeof(ClientBaseForm))
             {
                 this.frmConfirm.Parent = base.Parent;
             }
             else if (base.Parent.Parent.Parent.GetType() == typeof(frmMain))
             {
                 this.frmConfirm.Parent = base.Parent.Parent.Parent;
             }
             this.frmConfirm.Location = new Point((this.frmConfirm.Parent.Width - this.frmConfirm.Width) / 2, (this.frmConfirm.Parent.Height - this.frmConfirm.Height) / 2);
             this.frmConfirm.TopMost = true;
             this.frmConfirm.Show();
             this.frmConfirm.BringToFront();
         }
         catch (Exception ex)
         {
             this.ShowError("ShowMessageInFormConfirm", ex);
         }
     }
 }