コード例 #1
0
ファイル: Mzml.cs プロジェクト: B-Rich/CSMSL
 public override void Dispose()
 {
     if (_mzMLConnection != null)
     {
         _mzMLConnection = null;
     }
     if (_indexedmzMLConnection != null)
     {
         _indexedmzMLConnection = null;
     }
     base.Dispose();
 }
コード例 #2
0
 public static bool LoadFromFile(string fileName, out mzMLType obj)
 {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
コード例 #3
0
 /// <summary>
 /// Deserializes xml markup from file into an mzMLType object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output mzMLType object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out mzMLType obj, out System.Exception exception)
 {
     exception = null;
     obj = default(mzMLType);
     try {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
コード例 #4
0
 public static bool Deserialize(string xml, out mzMLType obj)
 {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
コード例 #5
0
 /// <summary>
 /// Deserializes workflow markup into an mzMLType object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output mzMLType object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out mzMLType obj, out System.Exception exception)
 {
     exception = null;
     obj = default(mzMLType);
     try {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
コード例 #6
0
ファイル: Mzml.cs プロジェクト: B-Rich/CSMSL
 public override void Open()
 {
     if (!IsOpen ||_mzMLConnection == null)
     {
         Stream stream = new FileStream(FilePath, FileMode.Open);
         // Need these nested try catch to test if the file is a indexed mzML or just a plain mzML
         try
         {
             _indexedmzMLConnection = _indexedSerializer.Deserialize(stream) as indexedmzML;
             _mzMLConnection = _indexedmzMLConnection.mzML;
         }
         catch (Exception)
         {
             try
             {
                 _mzMLConnection = _mzMLSerializer.Deserialize(stream) as mzMLType;
             }
             catch (Exception)
             {
                 throw new InvalidDataException("Unable to parse " + FilePath + " as a mzML file!");
             }
         }
         base.Open();
     }
 }
コード例 #7
0
 public indexedmzML()
 {
     this.indexListField = new IndexListType();
     this.mzMLField = new mzMLType();
 }