private void btnUndoDelete_Click(object sender, EventArgs e) { if (undoBufferIndex > 0) { if (MessageBox.Show(UserMessages.ARE_YOU_SURE("Undo Delete"), UserMessages.CONFIRMION("Undo Delete"), MessageBoxButtons.YesNo) == DialogResult.Yes) { bool flag = taskDTO.save(undoBuffer[undoBufferIndex]); tasks.Add(undoBuffer[undoBufferIndex]); undoBufferIndex = (((undoBufferIndex - 1) % bufferSize) + bufferSize) % bufferSize; ++lastId; UserMessages.messageStatus(flag); refreshTaskData(); } } else { MessageBox.Show(UserMessages.EMPTY_OPERATION("Undo")); } }