本文整理汇总了C#中XmlReader.GetDoubleAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.GetDoubleAttribute方法的具体用法?C# XmlReader.GetDoubleAttribute怎么用?C# XmlReader.GetDoubleAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlReader
的用法示例。
在下文中一共展示了XmlReader.GetDoubleAttribute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadXml
public override void ReadXml(XmlReader reader)
{
// Read tag attributes
base.ReadXml(reader);
// Earlier versions always used decoys only
UsesDecoys = reader.GetBoolAttribute(ATTR.uses_decoys, true);
UsesSecondBest = reader.GetBoolAttribute(ATTR.uses_false_targets, false);
double bias = reader.GetDoubleAttribute(ATTR.bias);
bool isEmpty = reader.IsEmptyElement;
// Consume tag
reader.Read();
if (!isEmpty)
{
// Read calculators
var calculators = new List<FeatureCalculator>();
reader.ReadElements(calculators);
var weights = new double[calculators.Count];
for (int i = 0; i < calculators.Count; i++)
{
if (calculators[i].Type != PeakFeatureCalculators[i].GetType())
throw new InvalidDataException(Resources.LegacyScoringModel_ReadXml_Invalid_legacy_model_);
weights[i] = calculators[i].Weight;
}
Parameters = new LinearModelParams(weights, bias);
reader.ReadEndElement();
}
DoValidate();
}
示例2: ReadXml
public override void ReadXml(XmlReader reader)
{
// Read tag attributes
base.ReadXml(reader);
ColinearWarning = reader.GetBoolAttribute(ATTR.colinear_warning);
// Earlier versions always used decoys only
UsesDecoys = reader.GetBoolAttribute(ATTR.uses_decoys, true);
UsesSecondBest = reader.GetBoolAttribute(ATTR.uses_false_targets);
double bias = reader.GetDoubleAttribute(ATTR.bias);
// Consume tag
reader.Read();
// Read calculators
var calculators = new List<FeatureCalculator>();
reader.ReadElements(calculators);
var peakFeatureCalculators = new List<IPeakFeatureCalculator>(calculators.Count);
var weights = new double[calculators.Count];
for (int i = 0; i < calculators.Count; i++)
{
weights[i] = calculators[i].Weight;
peakFeatureCalculators.Add(PeakFeatureCalculator.GetCalculator(calculators[i].Type));
}
SetPeakFeatureCalculators(peakFeatureCalculators);
Parameters = new LinearModelParams(weights, bias);
reader.ReadEndElement();
DoValidate();
}
示例3: ReadXml
public void ReadXml(XmlReader reader)
{
// Read tag attributes
Type = reader.GetTypeAttribute(ATTR2.type);
Weight = reader.GetDoubleAttribute(ATTR2.weight);
// Consume tag
reader.Read();
Validate();
}
示例4: ReadAttributes
protected virtual void ReadAttributes(XmlReader reader)
{
Formula = reader.GetAttribute(ATTR.formula);
if (!string.IsNullOrEmpty(Formula))
{
Formula = BioMassCalc.AddH(Formula); // Update this old style formula to current by adding the hydrogen we formerly left out due to assuming protonation
}
else
{
Formula = reader.GetAttribute(ATTR.ion_formula);
}
if (string.IsNullOrEmpty(Formula))
{
AverageMass = reader.GetDoubleAttribute(ATTR.mass_average);
MonoisotopicMass = reader.GetDoubleAttribute(ATTR.mass_monoisotopic);
}
Validate();
}
示例5: ReadXml
public void ReadXml(XmlReader reader)
{
// Read tag attributes
Start = reader.GetDoubleAttribute(ATTR.start);
End = reader.GetDoubleAttribute(ATTR.end);
Target = reader.GetNullableDoubleAttribute(ATTR.target);
StartMargin = reader.GetNullableDoubleAttribute(ATTR.margin);
if (StartMargin == null)
{
StartMargin = reader.GetNullableDoubleAttribute(ATTR.margin_left);
EndMargin = reader.GetNullableDoubleAttribute(ATTR.margin_right);
}
CERange = reader.GetNullableDoubleAttribute(ATTR.ce_range);
// Consume tag
reader.Read();
DoValidate();
}