Exemplo n.º 1
0
        /// <summary>
        /// Formats a value in the specified field presentation format.
        /// </summary>
        /// <param name="values">
        /// The values to format.
        /// </param>
        /// <param name="format">
        /// The format to present the value in.
        /// </param>
        /// <returns>
        /// The formatted value.
        /// </returns>
        public string FormatValue(IEnumerable <string> values, FieldPresentationFormats format)
        {
            var instance      = new T();
            var configuration = instance.DeserializeConfiguration(FieldConfiguration);

            return(instance.FormatValue(values ?? new string[0], format, configuration));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Formats a value in the specified field presentation format.
        /// </summary>
        /// <param name="values">
        /// The values to format.
        /// </param>
        /// <param name="format">
        /// The format to present the value in.
        /// </param>
        /// <param name="configuration">
        /// The configuration for this field.
        /// </param>
        /// <returns>
        /// The formatted value.
        /// </returns>
        public string FormatValue(IEnumerable <string> values, FieldPresentationFormats format,
                                  object configuration)
        {
            var castedConfig = configuration as TextConstantConfiguration;

            return(castedConfig?.Text);
        }
Exemplo n.º 3
0
 public string FormatValue(IEnumerable<string> values, FieldPresentationFormats format)
 {
     values = values.Select(x => new
     {
         Parsed = DateUtility.AttemptParseDate(x),
         Original = x
     }).Select(x => x.Parsed.HasValue
         ? x.Parsed.Value.ToString("MMMM dd, yyyy")
         : x.Original);
     var combined = string.Join(", ", values);
     return combined;
 }
Exemplo n.º 4
0
        /// <inheritdoc />
        public string FormatValue(IEnumerable <string> values, FieldPresentationFormats format, object configuration)
        {
            values = values.Select(x => new
            {
                Parsed   = DateUtility.AttemptParseDate(x),
                Original = x
            }).Select(x => x.Parsed.HasValue
                ? x.Parsed.Value.ToString("MMMM dd, yyyy")
                : x.Original);
            var combined = string.Join(", ", values);

            return(combined);
        }
Exemplo n.º 5
0
 public string FormatValue(IEnumerable <string> values, FieldPresentationFormats format,
                           object configuration)
 {
     return(string.Join(", ", values));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Formats a value in the specified field presentation format.
 /// </summary>
 /// <param name="values">
 /// The values to format.
 /// </param>
 /// <param name="format">
 /// The format to present the value in.
 /// </param>
 /// <returns>
 /// The formatted value.
 /// </returns>
 public string FormatValue(IEnumerable <string> values, FieldPresentationFormats format)
 {
     return(null);
 }
Exemplo n.º 7
0
 public string FormatValue(IEnumerable<string> values, FieldPresentationFormats format)
 {
     return null;
 }
Exemplo n.º 8
0
 public string FormatValue(IEnumerable<string> values, FieldPresentationFormats format)
 {
     return string.Join(", ", values);
 }
Exemplo n.º 9
0
        /// <summary>
        /// Formats a value in the specified field presentation format.
        /// </summary>
        /// <param name="values">
        /// The values to format.
        /// </param>
        /// <param name="format">
        /// The format to present the value in.
        /// </param>
        /// <returns>
        /// The formatted value.
        /// </returns>
        public string FormatValue(IEnumerable <string> values, FieldPresentationFormats format)
        {
            var instance = new T();

            return(instance.FormatValue(values ?? new string[0], format));
        }