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); }
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); }