/// <summary> /// Asks user, if wants to overwrite already present favorite the newName by conflicting (editedFavorite) /// and then take an action asigned to be performed as rename. /// </summary> /// <param name="editedFavorite">The currently edited favorite to update.</param> /// <param name="newName">The newly assigned name of edited favorite.</param> internal void ApplyRename(IFavorite editedFavorite, string newName) { IFavorite oldFavorite = this.favorites[newName]; // prevent conflict with another favorite than edited bool notUnique = oldFavorite != null && !editedFavorite.StoreIdEquals(oldFavorite); if (notUnique) this.OverwriteByConflictingName(newName, oldFavorite, editedFavorite); else this.service.Rename(editedFavorite, newName); }
/// <summary> /// Asks user, if wants to overwrite already present favorite the newName by conflicting (editedFavorite) /// and then take an action asigned to be performed as rename. /// </summary> /// <param name="editedFavorite">The currently edited favorite to update.</param> /// <param name="newName">The newly assigned name of edited favorite.</param> internal void ApplyRename(IFavorite editedFavorite, string newName) { var oldFavorite = this.favorites[newName]; // prevent conflict with another favorite than edited var notUnique = oldFavorite != null && !editedFavorite.StoreIdEquals(oldFavorite); if (notUnique) { this.OverwriteByConflictingName(newName, oldFavorite, editedFavorite); } else { this.service.Rename(editedFavorite, newName); } }