private void dispose(Boolean disposing) { if (IsDisposed) { return; } if (disposing) // Do deterministic finalization of managed resources { if (_baseTable != null) { _baseTable.Dispose(); } _baseTable = null; if (_reader != null) { _reader.Dispose(); } _reader = null; if (_writer != null) { _writer.Dispose(); } _writer = null; } _isOpen = false; }
/// <summary> /// Opens the <see cref="DbaseFile"/> on the file name /// specified in the constructor, /// with a value determining if the file is locked for /// exclusive read access or not. /// </summary> /// <exception cref="ObjectDisposedException"> /// Thrown when the method is called /// and Object has been disposed. /// </exception> internal void Open(WriteAccess writeAccess) { checkState(); // TODO: implement asynchronous access _dbaseFileStream = openDbfFileStream(writeAccess); _isOpen = true; syncReadHeader(DataStream); _reader = new DbaseReader(this); if (writeAccess != WriteAccess.ReadOnly) { _writer = new DbaseWriter(this); } // TODO: NullBinaryWriter }
private void dispose(bool disposing) { if (IsDisposed) { return; } if (disposing) // Do deterministic finalization of managed resources { if (_baseTable != null) _baseTable.Dispose(); _baseTable = null; if (_reader != null) _reader.Dispose(); _reader = null; if (_writer != null) _writer.Dispose(); _writer = null; } _isOpen = false; }
/// <summary> /// Opens the <see cref="DbaseFile"/> on the file name /// specified in the constructor, /// with a value determining if the file is locked for /// exclusive read access or not. /// </summary> /// <exception cref="ObjectDisposedException"> /// Thrown when the method is called /// and object has been disposed. /// </exception> internal void Open(bool exclusive) { checkState(); // TODO: implement asynchronous access #if !CFBuild _dbaseFileStream = new FileStream(_filename, FileMode.OpenOrCreate, FileAccess.ReadWrite, exclusive ? FileShare.None : FileShare.Read, 4096, FileOptions.None); #else _dbaseFileStream = new FileStream(_filename, FileMode.OpenOrCreate, FileAccess.ReadWrite, exclusive ? FileShare.None : FileShare.Read, 4096); #endif _isOpen = true; if (!_headerIsParsed) //Don't read the header if it's already parsed { _header = DbaseHeader.ParseDbfHeader(new BufferingStream(DataStream)); _baseTable = DbaseSchema.GetFeatureTableForFields(_header.Columns); _headerIsParsed = true; } _writer = new DbaseWriter(this); _reader = new DbaseReader(this); }
/// <summary> /// Opens the <see cref="DbaseFile"/> on the file name /// specified in the constructor, /// with a value determining if the file is locked for /// exclusive read access or not. /// </summary> /// <exception cref="ObjectDisposedException"> /// Thrown when the method is called /// and Object has been disposed. /// </exception> internal void Open(WriteAccess writeAccess) { checkState(); // TODO: implement asynchronous access _dbaseFileStream = openDbfFileStream(writeAccess); _isOpen = true; syncReadHeader(DataStream); _reader = new DbaseReader(this); if (writeAccess != WriteAccess.ReadOnly) _writer = new DbaseWriter(this); // TODO: NullBinaryWriter }