private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (sfdSaveGraphFile.ShowDialog() == System.Windows.Forms.DialogResult.OK && validateGraph()) { CGraphManager graphman = new CGraphManager(this, m_log); graphman.SaveGraph(graphCtrl, sfdSaveGraphFile.FileName); m_dirty = false; } }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { if (m_dirty) { if (MessageBox.Show("Save before starting a new conversation?", "Save", MessageBoxButtons.YesNoCancel) == System.Windows.Forms.DialogResult.Yes) { if (sfdSaveGraphFile.ShowDialog() == System.Windows.Forms.DialogResult.OK && validateGraph()) { CGraphManager graphman = new CGraphManager(this, m_log); graphman.SaveGraph(graphCtrl, sfdSaveGraphFile.FileName); } } } List <Node> nodeList = new List <Node>(); foreach (Node n in graphCtrl.Nodes) { nodeList.Add(n); } graphCtrl.RemoveNodes(nodeList); graphCtrl.Refresh(); m_dirty = false; }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { if(m_dirty) { if(MessageBox.Show("Save before starting a new conversation?", "Save", MessageBoxButtons.YesNoCancel) == System.Windows.Forms.DialogResult.Yes) { if (sfdSaveGraphFile.ShowDialog() == System.Windows.Forms.DialogResult.OK && validateGraph()) { CGraphManager graphman = new CGraphManager(this, m_log); graphman.SaveGraph(graphCtrl, sfdSaveGraphFile.FileName); } } } List<Node> nodeList = new List<Node>(); foreach (Node n in graphCtrl.Nodes) nodeList.Add(n); graphCtrl.RemoveNodes(nodeList); graphCtrl.Refresh(); m_dirty = false; }