private void HandleSaveCommand(S2VXCommand oldCommand) { var commandString = EditInputBar.ValuesToString(); var addSuccessful = false; try { var newCommand = S2VXCommand.FromString(commandString); Editor.Reversibles.Push(new ReversibleUpdateCommand(oldCommand, newCommand, this)); addSuccessful = true; } catch (Exception ex) { EditInputBar.AddErrorIndicator(); Console.WriteLine(ex); } if (addSuccessful) { EditCommandReference = null; LoadCommandsList(); } }
private void ResetEditInputBar(S2VXCommand command) { EditInputBar = CreateEditInputBar(); EditInputBar.CommandToValues(command); }