private void Name_TextEdit_TextChanged(object sender, TextChangedEventArgs e) { TextBox box = sender as TextBox; int index = SystemErrorsGrid.SelectedIndex; if ((index < SystemErrorsGrid.Items.Count) && (index >= 0)) { if (NameUtils.CheckMacroName(box.Text)) { autosarApp.SystemErrors[index].Name = box.Text; } } }
public void RenameFieldName(TextBox textBox) { int index = grid.SelectedIndex; if ((index < grid.Items.Count) && (index >= 0)) { if (NameUtils.CheckMacroName(textBox.Text)) { datatype.Fields[index].Name = textBox.Text; } else { textBox.Text = datatype.Fields[index].Name; textBox.Select(textBox.Text.Length, 0); } tree.UpdateAutosarTreeView(tree.SelectedItem); } }