public string ToString(string format, IFormatProvider formatProvider) { switch (format) { case null: case "N": return("None"); case "F": return(FirstName); case "L": return(LastName); case "C": return(Country); case "S": return(Starts.ToString()); case "W": return(Wins.ToString()); case "A": return($"{FirstName} {LastName},{Country}; start:{Starts}, wins:{Wins}"); default: throw new FormatException($"Format {format} not supproted"); } }
public string ToString(string format, IFormatProvider formatProvider) { switch (format) { case null: case "N": return(ToString()); case "F": return(FirstName); case "L": return(LastName); case "C": return(Country); case "S": return(Starts.ToString()); case "W": return(Wins.ToString()); case "A": return(String.Format("{0} {1}, {2}; starts: {3}, wins: {4}", FirstName, LastName, Country, Starts, Wins)); default: throw new FormatException(String.Format( "Format {0} not supported", format)); } }
public string[] GetData() { return(new string[] { Name, Starts.ToString(), Wins.ToString(), AlmostWins.ToString(), Loses.ToString(), Hardness.ToString() + "%", EmotionFactor.ToString() + "%" }); }