本文整理汇总了C#中XmlReader.FindHelper方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.FindHelper方法的具体用法?C# XmlReader.FindHelper怎么用?C# XmlReader.FindHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlReader
的用法示例。
在下文中一共展示了XmlReader.FindHelper方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadXml
public void ReadXml(XmlReader reader)
{
// Consume tag
if (reader.IsEmptyElement)
reader.Read();
else
{
reader.ReadStartElement();
// Read child element
var helperSpec = reader.FindHelper(PEAK_SCORING_MODEL_SPEC_HELPERS);
if (helperSpec != null)
PeakScoringModel = helperSpec.Deserialize(reader);
reader.ReadEndElement();
}
}
示例2: ReadXml
public override void ReadXml(XmlReader reader)
{
// Read tag attributes
base.ReadXml(reader);
UseForRetentionTimeFilter = reader.GetBoolAttribute(ATTR.use_for_retention_time_prediction, false);
AnalyteConcentration = reader.GetNullableDoubleAttribute(ATTR.analyte_concentration);
SampleType = SampleType.FromName(reader.GetAttribute(ATTR.sample_type));
// Consume tag
reader.Read();
// Check if there is an optimization function element, and read
// if if there is.
IXmlElementHelper<OptimizableRegression> helper =
reader.FindHelper(OPTIMIZATION_HELPERS);
if (helper != null)
OptimizationFunction = helper.Deserialize(reader);
var msDataFilePaths = new List<MsDataFileUri>();
var fileLoadIds = new List<string>();
while (reader.IsStartElement(EL.sample_file) ||
reader.IsStartElement(EL.replicate_file) ||
reader.IsStartElement(EL.chromatogram_file))
{
// Note that the file path is actually be a URI that encodes things like lockmass correction as well as filename
msDataFilePaths.Add(MsDataFileUri.Parse(reader.GetAttribute(ATTR.file_path)));
string id = reader.GetAttribute(ATTR.id) ?? GetOrdinalSaveId(fileLoadIds.Count);
fileLoadIds.Add(id);
reader.Read();
if (reader.IsStartElement(EL.instrument_info_list))
{
reader.Skip();
reader.Read();
}
}
Annotations = SrmDocument.ReadAnnotations(reader);
MSDataFileInfos = msDataFilePaths.ConvertAll(path => new ChromFileInfo(path));
_fileLoadIds = fileLoadIds.ToArray();
// Consume end tag
reader.ReadEndElement();
}