/// <summary>
 /// Shows the specified called show method.
 /// </summary>
 /// <param name="calledShowMethod">The called show method.</param>
 /// <param name="owner">The owner or null otherwise.</param>
 private void Show(CalledShowMethod calledShowMethod, IWin32Window owner)
 {
     if (!DesignMode)
     {
         if (UserCanOpenForm)
         {
             if (UserIsAllowed != null)
             {
                 UserIsAllowed(this, new EventArgs());
             }
             ShowForm(calledShowMethod, owner);
         }
         else
         {
             if (UserIsDenied != null)
             {
                 ShowForm(calledShowMethod, owner);
                 UserIsDenied(this, new EventArgs());
             }
             else
             if (this.IsMainWindow)
             {
                 Application.Exit();
             }
         }
     }
     //else
     //ShowForm(calledShowMethod, owner);
 }
        /// <summary>
        /// Shows the dialog.
        /// </summary>
        /// <param name="calledShowMethod">The called show method.</param>
        /// <param name="owner">The owner.</param>
        /// <returns></returns>
        private DialogResult ShowDialog(CalledShowMethod calledShowMethod, IWin32Window owner)
        {
            if (!DesignMode)
            {
                DialogResult result = DialogResult.None;
                if (UserCanOpenForm)
                {
                    if (UserIsAllowed != null)
                    {
                        UserIsAllowed(this, new EventArgs());
                    }
                    result = ShowDialogForm(calledShowMethod, owner);
                }
                else
                {
                    if (UserIsDenied != null)
                    {
                        //result = ShowDialogForm(calledShowMethod, owner);
                        UserIsDenied(this, new EventArgs());
                    }
                    else
                    if (IsMainWindow)
                    {
                        Application.Exit();
                    }
                }

                return(result);
            }
            else
            {
                return(ShowDialogForm(calledShowMethod, owner));
            }
        }
 /// <summary>
 /// Shows the dialog form.
 /// </summary>
 /// <param name="calledShowMethod">The called show method.</param>
 /// <param name="owner">The owner.</param>
 /// <returns></returns>
 private DialogResult ShowDialogForm(CalledShowMethod calledShowMethod, IWin32Window owner)
 {
     if (calledShowMethod == CalledShowMethod.Show)
     {
         return(base.ShowDialog());
     }
     else
     {
         return(base.ShowDialog(owner));
     }
 }
 /// <summary>
 /// Shows the form.
 /// </summary>
 /// <param name="calledShowMethod">The called show method.</param>
 /// <param name="owner">The owner.</param>
 private void ShowForm(CalledShowMethod calledShowMethod, IWin32Window owner)
 {
     if (calledShowMethod == CalledShowMethod.Show)
     {
         base.Show();
     }
     else
     {
         base.Show(owner);
     }
 }
Beispiel #5
0
 /// <summary>
 /// Shows the dialog form.
 /// </summary>
 /// <param name="calledShowMethod">The called show method.</param>
 /// <param name="owner">The owner.</param>
 /// <returns></returns>
 private DialogResult ShowDialogForm(CalledShowMethod calledShowMethod, IWin32Window owner)
 {
     if (calledShowMethod == CalledShowMethod.Show)
         return base.ShowDialog();
     else
         return base.ShowDialog(owner);
 }
Beispiel #6
0
        /// <summary>
        /// Shows the dialog.
        /// </summary>
        /// <param name="calledShowMethod">The called show method.</param>
        /// <param name="owner">The owner.</param>
        /// <returns></returns>
        private DialogResult ShowDialog(CalledShowMethod calledShowMethod, IWin32Window owner)
        {
            if (!DesignMode)
            {
                DialogResult result = DialogResult.None;
                if (UserCanOpenForm)
                {
                    result = ShowDialogForm(calledShowMethod, owner);
                    if (UserIsAllowed != null)
                        UserIsAllowed(this, new EventArgs());
                }
                else
                {
                    if (UserIsDenied != null)
                    {
                        result = ShowDialogForm(calledShowMethod, owner);
                        UserIsDenied(this, new EventArgs());
                    }
                    else
                        if (IsMainWindow)
                        Application.Exit();
                }

                return result;
            }
            else
                return ShowDialogForm(calledShowMethod, owner);
        }
Beispiel #7
0
 /// <summary>
 /// Shows the form.
 /// </summary>
 /// <param name="calledShowMethod">The called show method.</param>
 /// <param name="owner">The owner.</param>
 private void ShowForm(CalledShowMethod calledShowMethod, IWin32Window owner)
 {
     if (calledShowMethod == CalledShowMethod.Show)
         base.Show();
     else
         base.Show(owner);
 }
Beispiel #8
0
 /// <summary>
 /// Shows the specified called show method.
 /// </summary>
 /// <param name="calledShowMethod">The called show method.</param>
 /// <param name="owner">The owner or null otherwise.</param>
 private void Show(CalledShowMethod calledShowMethod, IWin32Window owner)
 {
     if (!DesignMode)
     {
         if (UserCanOpenForm)
         {
             ShowForm(calledShowMethod, owner);
             if (UserIsAllowed != null)
                 UserIsAllowed(this, new EventArgs());
         }
         else
         {
             if (UserIsDenied != null)
             {
                 ShowForm(calledShowMethod, owner);
                 UserIsDenied(this, new EventArgs());
             }
             else
                 if (this.IsMainWindow)
                 Application.Exit();
         }
     }
     else
         ShowForm(calledShowMethod, owner);
 }