using System; namespace VEPROMS { // B2019-071 Dialog will ask user if he wants to close the current tab, exit PROMS, or cancel // This is displayed when user click on the PROMS X (upper right corner), V button Exit, or the Word X button inside a Word attachment public partial class DlgCloseTabsOrExit : DevComponents.DotNetBar.Office2007Form { private bool _Cancel = true; public bool Cancel => _Cancel; public bool ExitPROMS { get; set; } public DlgCloseTabsOrExit(bool isMainWindow, bool hasChildWindows) { InitializeComponent(); if (!isMainWindow) { // B2019-101 if closing a child window change the dialog message and exit button text - Separate Windows labelX1.Text = "Do you want to Close the Current Tab or\nClose this Separate Window?"; BtnExitPROMS.Text = "Close Separate Window"; } else if (hasChildWindows) { // B2019-101 if closing a th main window and there are child windows then change the dialog message and exit button text - Separate Windows labelX1.Text = "Do you want to Close the Current Tab or\nClose All Separate Windows and Exit PROMS?"; } } private void BtnClsTab_Click(object sender, EventArgs e) { _Cancel = false; ExitPROMS = false; Hide(); } private void BtnExitPROMS_Click(object sender, EventArgs e) { _Cancel = false; ExitPROMS = true; Hide(); } private void btnCancel_Click(object sender, EventArgs e) { _Cancel = true; ExitPROMS = false; Hide(); } } }