Example #1
0
        public bool CloseQuery(QueryPage page)
        {
            if (page.Modified && ConfirmFileSave)
            {
                switch (MessageBox.Show(String.Format("Save {0}?", page.FileName),
                    GetApplicationTitle(), MessageBoxButton.YesNoCancel, MessageBoxImage.Question))
                {
                    case MessageBoxResult.Yes:
                        if (!SaveQuery(page))
                            return false;
                        break;

                    case MessageBoxResult.Cancel:
                        return false;
                }
            }
            page.Close();
            return true;
        }