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
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
GetDelimiterArgsThe args.
Returns
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
GetDynamicPropertyNameArgsThe args.
Returns
HeaderValidated(HeaderValidatedArgs)
Throws a ValidationException if
public static void HeaderValidated(HeaderValidatedArgs args)
Parameters
args
HeaderValidatedArgs
MissingFieldFound(MissingFieldFoundArgs)
Throws a MissingFieldException
.
public static void MissingFieldFound(MissingFieldFoundArgs args)
Parameters
PrepareHeaderForMatch(PrepareHeaderForMatchArgs)
Returns the
public static string PrepareHeaderForMatch(PrepareHeaderForMatchArgs args)
Parameters
Returns
ReadingExceptionOccurred(ReadingExceptionOccurredArgs)
Throws the given
public static bool ReadingExceptionOccurred(ReadingExceptionOccurredArgs args)
Parameters
Returns
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
ShouldQuoteArgsThe args.
Returns
- bool
true
if the field should be quoted, otherwisefalse
.
ShouldUseConstructorParameters(ShouldUseConstructorParametersArgs)
Returns true
if args.ParameterType.ParameterType
:
- does not have a parameterless constructor
- has a constructor
- is not a value type
- is not a primitive
- is not an enum
- is not an interface
- TypeCode is an Object.
public static bool ShouldUseConstructorParameters(ShouldUseConstructorParametersArgs args)