public override void Open() { if (!IsOpen || _mzMLConnection == null) { Stream stream = new FileStream(FilePath, FileMode.Open); try { _indexedmzMLConnection = _indexedSerializer.Deserialize(stream) as indexedmzML; _mzMLConnection = _indexedmzMLConnection.mzML; } catch (Exception e1) { try { _mzMLConnection = _mzMLSerializer.Deserialize(stream) as mzMLType; } catch (Exception e2) { throw new InvalidDataException("Unable to parse " + FilePath + " as a mzML file!"); } } base.Open(); } }
protected override void Dispose(bool disposing) { if (disposing) { _mzMLConnection = null; _indexedmzMLConnection = null; } base.Dispose(disposing); }