Пример #1
0
        public FlatFileToDataTablePusher(FlatFileToLoad fileToLoad, FlatFileColumnCollection headers, Func <string, object> hackValuesFunc, bool attemptToResolveNewlinesInRecords, CultureInfo culture)
        {
            _fileToLoad     = fileToLoad;
            _headers        = headers;
            _hackValuesFunc = hackValuesFunc;
            _attemptToResolveNewlinesInRecords = attemptToResolveNewlinesInRecords;
            _culture = culture ?? CultureInfo.CurrentCulture;

            typeDeciderFactory = new TypeDeciderFactory(_culture);
        }
Пример #2
0
        public FlatFileToDataTablePusher(FlatFileToLoad fileToLoad, FlatFileColumnCollection headers, Func <string, object> hackValuesFunc, bool attemptToResolveNewlinesInRecords, CultureInfo culture)
        {
            _fileToLoad     = fileToLoad;
            _headers        = headers;
            _hackValuesFunc = hackValuesFunc;
            _attemptToResolveNewlinesInRecords = attemptToResolveNewlinesInRecords;
            _culture        = culture;
            _dateTimeParser = new DateTimeTypeDecider();

            if (culture != null)
            {
                _dateTimeParser.Culture = culture;
            }
        }
Пример #3
0
        public FlatFileToDataTablePusher(FlatFileToLoad fileToLoad, FlatFileColumnCollection headers, Func <string, object> hackValuesFunc, bool attemptToResolveNewlinesInRecords, CultureInfo culture, string explicitDateTimeFormat)
        {
            _fileToLoad     = fileToLoad;
            _headers        = headers;
            _hackValuesFunc = hackValuesFunc;
            _attemptToResolveNewlinesInRecords = attemptToResolveNewlinesInRecords;
            _culture = culture ?? CultureInfo.CurrentCulture;
            _explicitDateTimeFormat = explicitDateTimeFormat;
            typeDeciderFactory      = new TypeDeciderFactory(_culture);

            if (!string.IsNullOrWhiteSpace(explicitDateTimeFormat))
            {
                typeDeciderFactory.Settings.ExplicitDateFormats = new [] { explicitDateTimeFormat }
            }
            ;
        }