Ejemplo n.º 1
0
 /// <summary>
 /// Formats the argument into a string.
 /// </summary>
 /// <param name="value">Value to format.</param>
 /// <param name="suppressArgNames">True to suppress argument names;
 /// false to leave them in.</param>
 /// <returns>The formatted string.</returns>
 public IEnumerable <string> Format(object value, bool suppressArgNames = false)
 {
     if (CollectionArgumentType != null)
     {
         foreach (var item in CollectionArgumentType.ToEnumerable(value))
         {
             if (suppressArgNames)
             {
                 yield return(CollectionArgumentType.ElementType.Format(item));
             }
             else
             {
                 yield return(Format(CollectionArgumentType.ElementType, item));
             }
         }
     }
     else if (suppressArgNames)
     {
         yield return(ArgumentType.Format(value));
     }
     else
     {
         yield return(Format(ArgumentType, value));
     }
 }