예제 #1
0
        public bool Close()
        {
            if (Receiver.CanStop())
            {
                Stop();
            }

            if (Dirty)
            {
                switch (MessageBox.Show(TabPanel,
                                        "Session '" + Name + "' has unsaved changes. Save before exit?",
                                        "NLogViewer",
                                        MessageBoxButtons.YesNoCancel))
                {
                case DialogResult.Yes:
                    if (!Save(TabPanel))
                    {
                        return(false);
                    }
                    break;

                case DialogResult.Cancel:
                    return(false);
                }
            }
            _mainForm.RemoveSession(this);
            return(true);
        }