public static NormalizeOption FromPersistedName(string name) { if (string.IsNullOrEmpty(name)) { return(FromNormalizationMethod(NormalizationMethod.NONE)); } if (_specialOptions.TryGetValue(name, out Special specialNormalizeOption)) { return(specialNormalizeOption); } return(FromNormalizationMethod(NormalizationMethod.FromName(name))); }
void IXmlSerializable.ReadXml(XmlReader reader) { RegressionWeighting = RegressionWeighting.Parse(reader.GetAttribute(Attr.weighting)); RegressionFit = RegressionFit.Parse(reader.GetAttribute(Attr.fit)); NormalizationMethod = NormalizationMethod.FromName(reader.GetAttribute(Attr.normalization)); MsLevel = reader.GetNullableIntAttribute(Attr.ms_level); Units = reader.GetAttribute(Attr.units); bool empty = reader.IsEmptyElement; reader.Read(); if (!empty) { reader.ReadEndElement(); } }
private object ParseValue(string value, Type type) { if (string.IsNullOrEmpty(value)) { return(null); } if (type == typeof(SampleType)) { return(SampleType.FromName(value)); } if (type == typeof(NormalizationMethod)) { return(NormalizationMethod.FromName(value)); } return(Convert.ChangeType(value, type, DataSchema.DataSchemaLocalizer.FormatProvider)); }
void IXmlSerializable.ReadXml(XmlReader reader) { RegressionWeighting = RegressionWeighting.Parse(reader.GetAttribute(Attr.weighting)); RegressionFit = RegressionFit.Parse(reader.GetAttribute(Attr.fit)); NormalizationMethod = NormalizationMethod.FromName(reader.GetAttribute(Attr.normalization)); MsLevel = reader.GetNullableIntAttribute(Attr.ms_level); Units = reader.GetAttribute(Attr.units); LodCalculation = LodCalculation.Parse(reader.GetAttribute(Attr.lod_calculation)); MaxLoqBias = reader.GetNullableDoubleAttribute(Attr.max_loq_bias); MaxLoqCv = reader.GetNullableDoubleAttribute(Attr.max_loq_cv); bool empty = reader.IsEmptyElement; reader.Read(); if (!empty) { reader.ReadEndElement(); } }