当前位置: 首页>>代码示例>>C#>>正文


C# XmlReader.GetDoubleAttribute方法代码示例

本文整理汇总了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();
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:33,代码来源:LegacyScoringModel.cs

示例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();
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:30,代码来源:MProphetScoringModel.cs

示例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();
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:11,代码来源:FeatureCalculator.cs

示例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();
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:18,代码来源:CustomIon.cs

示例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();
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:19,代码来源:IsolationWindow.cs


注:本文中的XmlReader.GetDoubleAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。