private void ReturnLastAction() { CanSaveState obj = savedStateStack.Pop(); obj.backToPrevious(); if (!bkgImages.Contains(selectedFigure)) { selectedFigure = null; } UpdateGraphics(); if (savedStateStack.Count == 0) { btnReturnLastAction.Enabled = false; } }