private void layoutSaveAsToolStripMenuItem_Click(object sender, EventArgs e) { var d = new LayoutSaveAsForm(); if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var save = true; if (_M.Layouts.Any(uia => uia.Name.ToLower() == d.SaveAsName.ToLower())) { if (MessageBox.Show("Name already in use: " + d.SaveAsName + "\nReplace it?", "Verify Replace", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) { _M.DeleteLayout(d.SaveAsName); } else { save = false; } } if (save) { _M.ExtractAsNewLayoutAndSetActive(d.SaveAsName); } } _ButtonMenu.Close(); }
private void newLayoutToolStripMenuItem_Click(object sender, EventArgs e) { var d = new LayoutSaveAsForm(); if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (_M.Layouts.Any(uia => uia.Name.ToLower() == d.SaveAsName.ToLower())) { MessageBox.Show("Name already in use: " + d.SaveAsName); } else { _M.ActivateLayout(d.SaveAsName); } } _ButtonMenu.Close(); }