Table of Contents

Class ConfigurationFunctions

Namespace
CsvHelper.Configuration
Assembly
CsvHelper.dll

Holds the default callback methods for delegate members of CsvHelper.Configuration.Configuration.

public static class ConfigurationFunctions
Inheritance
ConfigurationFunctions
Inherited Members

Methods

BadDataFound(BadDataFoundArgs)

Throws a BadDataException.

public static void BadDataFound(BadDataFoundArgs args)

Parameters

args BadDataFoundArgs

GetConstructor(GetConstructorArgs)

Returns the type's constructor with the most parameters. If two constructors have the same number of parameters, then there is no guarantee which one will be returned. If you have that situation, you should probably implement this function yourself.

public static ConstructorInfo GetConstructor(GetConstructorArgs args)

Parameters

args GetConstructorArgs

Returns

ConstructorInfo

GetDelimiter(GetDelimiterArgs)

Detects the delimiter based on the given text. Return the detected delimiter or null if one wasn't found.

public static string GetDelimiter(GetDelimiterArgs args)

Parameters

args GetDelimiterArgs

The args.

Returns

string

GetDynamicPropertyName(GetDynamicPropertyNameArgs)

Returns the header name ran through PrepareHeaderForMatch(PrepareHeaderForMatchArgs). If no header exists, property names will be Field1, Field2, Field3, etc.

public static string GetDynamicPropertyName(GetDynamicPropertyNameArgs args)

Parameters

args GetDynamicPropertyNameArgs

The args.

Returns

string

HeaderValidated(HeaderValidatedArgs)

Throws a ValidationException if is not empty.

public static void HeaderValidated(HeaderValidatedArgs args)

Parameters

args HeaderValidatedArgs

MissingFieldFound(MissingFieldFoundArgs)

Throws a MissingFieldException.

public static void MissingFieldFound(MissingFieldFoundArgs args)

Parameters

args MissingFieldFoundArgs

PrepareHeaderForMatch(PrepareHeaderForMatchArgs)

Returns the as given.

public static string PrepareHeaderForMatch(PrepareHeaderForMatchArgs args)

Parameters

args PrepareHeaderForMatchArgs

Returns

string

ReadingExceptionOccurred(ReadingExceptionOccurredArgs)

Throws the given .

public static bool ReadingExceptionOccurred(ReadingExceptionOccurredArgs args)

Parameters

args ReadingExceptionOccurredArgs

Returns

bool

ShouldQuote(ShouldQuoteArgs)

Returns true if the field contains a Quote, starts with a space, ends with a space, contains \r or \n, or contains the Delimiter.

public static bool ShouldQuote(ShouldQuoteArgs args)

Parameters

args ShouldQuoteArgs

The args.

Returns

bool

true if the field should be quoted, otherwise false.

ShouldUseConstructorParameters(ShouldUseConstructorParametersArgs)

Returns true if args.ParameterType.ParameterType:

  1. does not have a parameterless constructor
  2. has a constructor
  3. is not a value type
  4. is not a primitive
  5. is not an enum
  6. is not an interface
  7. TypeCode is an Object.
public static bool ShouldUseConstructorParameters(ShouldUseConstructorParametersArgs args)

Parameters

args ShouldUseConstructorParametersArgs

Returns

bool