public String ToString(String format) {
if (format == null || format.Length == 0)
format = "G";
if (String.Compare(format, "G", StringComparison.OrdinalIgnoreCase) == 0)
{
return ToString();
// return InternalFormat(this.GetType(), this.GetValue());
}
if (String.Compare(format, "D", StringComparison.OrdinalIgnoreCase) == 0)
return this.GetValue().ToString();
if (String.Compare(format, "X", StringComparison.OrdinalIgnoreCase) == 0)
return this.ToHexString();
if (String.Compare(format, "F", StringComparison.OrdinalIgnoreCase) == 0)
return InternalFlagsFormat(this.GetType(), this.GetValue());
throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification"));
}