/// <summary> /// Executes the action. /// </summary> public void ExecuteDo() { if (_pinnedLocations.Contains(_pinnedLocation)) { _existingIndex = _pinnedLocations.IndexOf(_pinnedLocation); _pinnedLocations.Remove(_pinnedLocation); } _pinnedLocations.Insert(0, _pinnedLocation); }
/// <summary> /// Undoes the action. /// </summary> public void ExecuteUndo() { if (_existingIndex.HasValue) { _pinnedLocations.Insert(_existingIndex.Value, _pinnedLocation); } }