private void NewButton_Click(object sender, RoutedEventArgs e) { List <string> existingAutomataNames = new List <string>(); foreach (AutomataData ad in automataList) { existingAutomataNames.Add(ad.Name); } NewAutomata asn = new NewAutomata(existingAutomataNames.ToArray()); asn.ShowDialog(); string newAutomataName = asn.automataName; string newAutomataDesc = asn.automataDesc; if (newAutomataName != "") { var result = Operations.Insert( string.Format("INSERT INTO automata(automata_name, automata_desc, enabled, created_date, updated_date) VALUES (\"{0}\", \"{1}\", true, \"{2}\", \"{3}\");", newAutomataName, newAutomataDesc, Operations.GetDateTime(), Operations.GetDateTime())); if (result != 0) { //MessageBox.Show("Error creating automata (" + result + ").", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); new Message("Error creating automata (" + result + ").", "Error", false, false).ShowDialog(); return; } //new AutomataEdit(username, newAutomataName).Show(); //Close(); OnEditMode?.Invoke(this, e); } }
private void EditButton_Click(object sender, RoutedEventArgs e) { TextBlock t = AutomataGrid.Columns[1].GetCellContent(AutomataGrid.Items[selectedRow]) as TextBlock; //new AutomataEdit(username, t.Text).Show(); //Close(); OnEditMode?.Invoke(this, e); }
public void ActiveEditMode() { OnEditMode?.Invoke(_isEditMode); _isEditMode = !_isEditMode; }