Esempio n. 1
0
        public override IsobaricResult ReadFromFile(string fileName)
        {
            IsobaricResult result = new IsobaricResult()
            {
                Mode = ITraqResultXmlFormatReader.GetMode(fileName)
            };

            var reader = new ITraqResultXmlFormatReader()
            {
                Progress  = this.Progress,
                Accept    = this.Accept,
                ReadPeaks = this.ReadPeaks
            };

            reader.OpenFile(fileName);
            try
            {
                IsobaricItem item;
                while (null != (item = reader.Next()))
                {
                    result.Add(item);
                }
            }
            finally
            {
                reader.Close();
            }

            return(result);
        }
Esempio n. 2
0
 public static String GetMode(string fileName)
 {
     using (var reader = new ITraqResultXmlFormatReader())
     {
         reader.OpenFile(fileName);
         while (reader._reader.MoveToElement("ITraqResult"))
         {
             if (reader._reader.HasAttributes)
             {
                 return(reader._reader.GetAttribute("Mode"));
             }
         }
     }
     return(string.Empty);
 }