/// <summary> /// /// </summary> /// <returns>True if the form may close.</returns> public bool TryClose() { var res = messageService.DisplayYesNoCancel(SAVE_BEFORE_EXIT); if (res == MessageResult.Cancel) { return(false); } if (res == MessageResult.Yes) { //If the save fails, stop. if (!TrySave()) { return(false); } //Save the RockList try { this.fileService.Save(RockList.ToJson(this.rockList)); } catch (Exception e) { messageService.DisplayError(e, "Failed to save Rock List"); return(false); } } return(true); }
public string Load() { return(RockList.ToJson(UseAsOutput)); }