コード例 #1
0
        public ReaderFlatFile(Connection connection, FlatFile table, bool previewMode)
        {
            ReferenceConnection = connection;
            _fileConnection     = (ConnectionFlatFile)connection;
            CacheTable          = table;

            _previewMode = previewMode;

            switch (table.FormatType)
            {
            case DataType.ETypeCode.Json:
                _fileHandler = new FileHandlerJson(table, table.RowPath);
                break;

            case DataType.ETypeCode.Text:
                _fileHandler = new FileHandlerText(table, table.FileConfiguration);
                break;

            case DataType.ETypeCode.Xml:
                _fileHandler = new FileHandlerXml(table, table.RowPath);
                break;

            default:
                throw new ConnectionException(
                          $"The format type ${table.FormatType} is not currently supported.");
            }

            _fileNameOrdinal = table.GetDeltaColumnOrdinal(TableColumn.EDeltaType.FileName);
            _baseRow         = new object[table.Columns.Count];
        }