private static string handleOtherFormats(string format, object arg, CultureInfo culture)
{
try
{
var obj = arg as IFormattable;
if (obj != null && format != null && format.Length > 0)
{
return obj.ToString(format, culture);
}
else if (arg != null)
{
return arg.ToString();
}
}
catch (FormatException e)
{
throw new FormatException(String.Format("The format of '{0}' is invalid.", format), e);
}
return String.Empty;
;
}