private void PrepareReader() { string soilProfile2DQuery = SoilDatabaseQueryBuilder.GetSoilProfile2DQuery(); try { dataReader = CreateDataReader(soilProfile2DQuery); preconsolidationStressReader = new PreconsolidationStressReader(Path); preconsolidationStressReader.Initialize(); } catch (SQLiteException exception) { string message = new FileReaderErrorMessageBuilder(Path).Build(Resources.SoilProfileReader_Error_reading_soil_profile_from_database); throw new CriticalFileReadException(message, exception); } }
protected override void Dispose(bool disposing) { if (dataReader != null) { dataReader.Close(); dataReader.Dispose(); dataReader = null; } if (preconsolidationStressReader != null) { preconsolidationStressReader.Dispose(); preconsolidationStressReader = null; } base.Dispose(disposing); }