实现IFormattable的Tostring的方法,实现为类型输出格式化字符串。
public string ToString(string format, IFormatProvider formatProvider)
{
switch (format)
{
case "EN":
return string.Format("{0} {1}", LastName, FirstName);
case "CH":
return this.ToString();
default:
return "";
}
}
public override string ToString()
{
return FirstName + " " + LastName;
}