private bool CloseTVF()
        {
            if (_tvfChanged && TrafficViewer.Instance.TrafficViewerFile.RequestCount > 0)
            {
                ConfirmCloseResult result = (ConfirmCloseResult)TrafficViewerOptions.Instance.ActionOnClose;
                if (result == ConfirmCloseResult.Unknown)
                {
                    ConfirmClose confirmForm = new ConfirmClose();
                    confirmForm.ShowDialog();
                    result = confirmForm.Result;
                }
                if (result == ConfirmCloseResult.Cancel)
                {
                    return(false);                   //cancel operation
                }
                else if (result == ConfirmCloseResult.Save)
                {
                    Save();
                }
                else if (result == ConfirmCloseResult.Leave)
                {
                    TrafficViewer.Instance.CloseTvf(true);
                }
                else if (result == ConfirmCloseResult.Discard)
                {
                    TrafficViewer.Instance.CloseTvf(false);
                }
            }
            else
            {
                TrafficViewer.Instance.CloseTvf(false);
            }

            return(true);
        }
Beispiel #2
0
 private void DiscardClick(object sender, EventArgs e)
 {
     _result = ConfirmCloseResult.Discard;
     ProcessDontPrompt();
     this.Close();
 }
Beispiel #3
0
 private void LeaveClick(object sender, EventArgs e)
 {
     _result = ConfirmCloseResult.Leave;
     ProcessDontPrompt();
     this.Close();
 }