Beispiel #1
0
        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();
            }
        }
Beispiel #2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         _mzMLConnection        = null;
         _indexedmzMLConnection = null;
     }
     base.Dispose(disposing);
 }