Exemplo n.º 1
0
        private void AskSaveChanges(bool askToSave)
        {
            DialogResult save = new DialogResult();
            save = DialogResult.Yes;

            if (askToSave == true) {
                save = MessageBox.Show("Do you want to save your changes?", "Save Changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            }

            if (save == DialogResult.Yes)
            {
                if ((TableBingo.filePath != null) && (TableBingo.filePath != ""))
                {
                    BingoWordFile file = new BingoWordFile(TableBingo.filePath, TableBingo.items, TableBingo.titleText, TableBingo.freeSpaceText, TableBingo.rowSize, TableBingo.colSize, TableBingo.numCardsToPrint, TableBingo.numCardsPerPage, TableBingo.printTitle, TableBingo.printFreeSpace);
                    TableBingo.DB.writeFile(file);
                }
                else
                {
                    saveAsNewFile();
                }
            }
        }
Exemplo n.º 2
0
        private void saveAsNewFile()
        {
            SaveFileDialog dialog = new SaveFileDialog();
            dialog.Filter = "Bingo Word Files|*.bwf";
            dialog.AddExtension = true;

            if (dialog.ShowDialog() == DialogResult.OK)
            {

                BingoWordFile file = new BingoWordFile(dialog.FileName, TableBingo.items, TableBingo.titleText, TableBingo.freeSpaceText, TableBingo.rowSize, TableBingo.colSize, TableBingo.numCardsToPrint, TableBingo.numCardsPerPage, TableBingo.printTitle, TableBingo.printFreeSpace);
                TableBingo.DB.writeFile(file);
            }
        }