I am wondering how do I do multiple dates in filehelpers? It seems that you must specify every single format you are going to support (what kinda sucks...wish it could handle more of the basic ones).
[FieldOrder(1), FieldConverter(ConverterKind.DateMultiFormat, "MM/dd/yyyy", "MM/d/yyyy", "M/d/yyyy","M/dd/yyyy")]
This gives me though
Error 35 Argument 1: cannot convert from 'FileHelpers.ConverterKind' to 'System.Type'
So it seems I have to make some custom convert or something? Is this correct?
Edit
I am using version 2.9.9.0
Options
// Summary:
// Indicates the FileHelpers.ConverterKind used for read/write operations.
//
// Remarks:
// See the Complete attributes list for more information and examples of each
// one.
[AttributeUsage(AttributeTargets.Field)]
public sealed class FieldConverterAttribute : Attribute
{
// Summary:
// Indicates the FileHelpers.ConverterKind used for read/write operations.
//
// Parameters:
// converter:
// The FileHelpers.ConverterKind used for the transformations.
public FieldConverterAttribute(ConverterKind converter);
//
// Summary:
// Indicates a custom FileHelpers.ConverterBase implementation.
//
// Parameters:
// customConverter:
// The Type of your custom converter.
public FieldConverterAttribute(Type customConverter);
//
// Summary:
// Indicates the FileHelpers.ConverterKind used for read/write operations.
//
// Parameters:
// converter:
// The FileHelpers.ConverterKind used for the transformations.
//
// arg1:
// The first param passed directly to the Converter Constructor.
public FieldConverterAttribute(ConverterKind converter, string arg1);
//
// Summary:
// Indicates a custom FileHelpers.ConverterBase implementation.
//
// Parameters:
// customConverter:
// The Type of your custom converter.
//
// args:
// A list of params passed directly to your converter constructor.
public FieldConverterAttribute(Type customConverter, params object[] args);
//
// Summary:
// Indicates a custom FileHelpers.ConverterBase implementation.
//
// Parameters:
// customConverter:
// The Type of your custom converter.
//
// arg1:
// The first param passed directly to the Converter Constructor.
public FieldConverterAttribute(Type customConverter, string arg1);
//
// Summary:
// Indicates the FileHelpers.ConverterKind used for read/write operations.
//
// Parameters:
// converter:
// The FileHelpers.ConverterKind used for the transformations.
//
// arg1:
// The first param passed directly to the Converter Constructor.
//
// arg2:
// The second param passed directly to the Converter Constructor.
public FieldConverterAttribute(ConverterKind converter, string arg1, string arg2);
//
// Summary:
// Indicates a custom FileHelpers.ConverterBase implementation.
//
// Parameters:
// customConverter:
// The Type of your custom converter.
//
// arg1:
// The first param passed directly to the Converter Constructor.
//
// arg2:
// The second param passed directly to the Converter Constructor.
public FieldConverterAttribute(Type customConverter, string arg1, string arg2);
//
// Summary:
// Indicates the FileHelpers.ConverterKind used for read/write operations.
//
// Parameters:
// converter:
// The FileHelpers.ConverterKind used for the transformations.
//
// arg1:
// The first param passed directly to the Converter Constructor.
//
// arg2:
// The second param passed directly to the Converter Constructor.
//
// arg3:
// The third param passed directly to the Converter Constructor.
public FieldConverterAttribute(ConverterKind converter, string arg1, string arg2, string arg3);
//
// Summary:
// Indicates a custom FileHelpers.ConverterBase implementation.
//
// Parameters:
// customConverter:
// The Type of your custom converter.
//
// arg1:
// The first param passed directly to the Converter Constructor.
//
// arg2:
// The second param passed directly to the Converter Constructor.
//
// arg3:
// The third param passed directly to the Converter Constructor.
public FieldConverterAttribute(Type customConverter, string arg1, string arg2, string arg3);
}
FieldConverterAttribute(ConverterKind, params string[])
constructor overload? Since older versions don't allow more than 3 parameters for builtin conversions (some may support it but require manual wrapping in a string array – Not sure about that though, because I didn't research that far). At least the compiler error looks like that's the reason... – Pusillanimity