Ejemplo n.º 1
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (_edited)
     {
         SaveBeforeClosePrompt prompt = new SaveBeforeClosePrompt();
         DialogResult          result = prompt.ShowDialog();
         if (result == DialogResult.Yes)
         {
             saveProject();
         }
         if (result == DialogResult.Cancel)
         {
             e.Cancel = true;
         }
     }
 }
Ejemplo n.º 2
0
        private void newProject()
        {
            bool cancelled = false;

            if (_edited)
            {
                SaveBeforeClosePrompt prompt = new SaveBeforeClosePrompt();
                if (prompt.ShowDialog() == DialogResult.Cancel)
                {
                    cancelled = true;
                }
            }
            if (!cancelled)
            {
                flushAllDataSources();
                _projectPath = null;
                _openProject = new InventoryProject();
                gatherTabPagesAndHide();
                _edited = false;
            }
        }