public SelectList CreatePlaceList() { Func <IPlace, SelectListItem> placeItemCreator = place => new SelectListItem { Text = PrettyString.ToString(place), Value = place.Id.ToString() }; return(new SelectList(_placeRepository.GetPlaces().Select(placeItemCreator), "Value", "Text")); }
private static string FormatItemString(string items, int key, string color, NPCDialogChoicesEnum value) { Debug.Log("***FormatItemString***"); items = string.Concat( items, PrettyString.FormatString(key.ToString(), true, color), dashSeparation, value.GetText()); return(items); }
public string ToPrettyString() { PrettyString = ""; // This part was wrote by Harry for (int i = 0; i < maxValue * maxValue; i++) { if ((i + 1) % maxValue == 0) { PrettyString += " " + sudokuArray[i].ToString(); PrettyString += "\n"; } else { if ((i + 1) % squareWidth == 0) { PrettyString += " " + sudokuArray[i].ToString() + " |"; } else { PrettyString += " " + sudokuArray[i].ToString(); } } if ((i + 1) % (squareHeight * maxValue) == 0 && (i + 1) % (maxValue * maxValue) != 0) { for (int j = 0; j < maxValue / squareWidth; j++) { for (int k = 0; k < squareWidth * 2 + 1; k++) { PrettyString += "-"; } if (j != maxValue / squareWidth - 1) { PrettyString += "+"; } } PrettyString += "\n"; } }// End here. PrettyString = PrettyString.Replace('0', '*'); return(PrettyString); }