private static string GetSinglePropertyValue(object item, Match m, IFormatProvider provider)
{
object current;
try
{
current = GetPropertyValue(item, m.Groups[PROPERTY].Value);
}
catch (ArgumentOutOfRangeException ex)
{
throw new MissingFieldException(item.GetType().Name, m.Groups[PROPERTY].Value);
}
if (m.Groups[FORMAT].Value != String.Empty)
{
string result = FormatProperty(current, m, provider);
return result;
}
else
{
return current.ToString();
}
}