本文整理汇总了C#中System.Xml.XmlWriter.WriteAttributeIfString方法的典型用法代码示例。如果您正苦于以下问题:C# XmlWriter.WriteAttributeIfString方法的具体用法?C# XmlWriter.WriteAttributeIfString怎么用?C# XmlWriter.WriteAttributeIfString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlWriter
的用法示例。
在下文中一共展示了XmlWriter.WriteAttributeIfString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteXml
public override void WriteXml(XmlWriter writer)
{
// Write tag attributes
base.WriteXml(writer);
writer.WriteAttributeIfString(ATTR.aminoacid, AAs);
writer.WriteAttributeNullable(ATTR.terminus, Terminus);
writer.WriteAttribute(ATTR.variable, IsVariable);
writer.WriteAttributeIfString(ATTR.formula, Formula);
writer.WriteAttribute(ATTR.label_13C, Label13C);
writer.WriteAttribute(ATTR.label_15N, Label15N);
writer.WriteAttribute(ATTR.label_18O, Label18O);
writer.WriteAttribute(ATTR.label_2H, Label2H);
writer.WriteAttribute(ATTR.relative_rt, RelativeRT, RelativeRT.Matching);
if (string.IsNullOrEmpty(Formula))
{
writer.WriteAttributeNullable(ATTR.massdiff_monoisotopic, MonoisotopicMass);
writer.WriteAttributeNullable(ATTR.massdiff_average, AverageMass);
}
if (!IsVariable)
writer.WriteAttribute(ATTR.explicit_decl, IsExplicit);
writer.WriteAttributeNullable(ATTR.unimod_id, UnimodId);
writer.WriteAttributeIfString(ATTR.short_name, ShortName);
if (Losses != null)
writer.WriteElements(Losses);
}
示例2: WriteXml
public void WriteXml(XmlWriter writer)
{
// Write tag attributes
writer.WriteAttributeIfString(ATTR.formula, Formula);
writer.WriteAttribute(ATTR.massdiff_monoisotopic, MonoisotopicMass);
writer.WriteAttribute(ATTR.massdiff_average, AverageMass);
writer.WriteAttribute(ATTR.inclusion, Inclusion, LossInclusion.Library);
}
示例3: WriteXml
public override void WriteXml(XmlWriter writer)
{
base.WriteXml(writer);
writer.WriteAttributeIfString(ATTR.control_annotation, ControlAnnotation);
writer.WriteAttributeIfString(ATTR.control_value, ControlValue);
writer.WriteAttributeIfString(ATTR.case_value, CaseValue);
writer.WriteAttributeIfString(ATTR.identity_annotation, IdentityAnnotation);
writer.WriteAttribute(ATTR.avg_tech_replicates, AverageTechnicalReplicates, true);
writer.WriteAttribute(ATTR.sum_transitions, SumTransitions, true);
writer.WriteAttributeIfString(ATTR.normalization_method, NormalizationMethod.Name);
writer.WriteAttribute(ATTR.include_interaction_transitions, IncludeInteractionTransitions, false);
writer.WriteAttribute(ATTR.summarization_method, SummarizationMethod.Name);
writer.WriteAttribute(ATTR.confidence_level, ConfidenceLevelTimes100);
writer.WriteAttribute(ATTR.per_protein, PerProtein, false);
}
示例4:
void IXmlSerializable.WriteXml(XmlWriter writer)
{
if (null != RegressionWeighting)
{
writer.WriteAttributeString(Attr.weighting, RegressionWeighting.Name);
}
if (null != RegressionFit)
{
writer.WriteAttributeString(Attr.fit, RegressionFit.Name);
}
if (null != NormalizationMethod)
{
writer.WriteAttributeString(Attr.normalization, NormalizationMethod.Name);
}
writer.WriteAttributeNullable(Attr.ms_level, MsLevel);
writer.WriteAttributeIfString(Attr.units, Units);
}
示例5: WriteXml
public void WriteXml(XmlWriter writer)
{
if(PanoramaPublishUri != null)
writer.WriteAttributeIfString(Attr.panorama_publish_uri, PanoramaPublishUri.ToString());
// Assume.IsFalse(string.IsNullOrEmpty(DocumentGuid)); // Should have a document GUID by this point
if(!string.IsNullOrEmpty(DocumentGuid))
writer.WriteAttributeString(Attr.document_guid, DocumentGuid);
var elements = AnnotationDefs.Cast<IXmlSerializable>().Concat(GroupComparisonDefs);
if (ViewSpecList.ViewSpecs.Any())
{
elements = elements.Concat(new[] {ViewSpecList});
}
writer.WriteElements(elements, GetElementHelpers());
}
示例6: WriteXml
public override void WriteXml(XmlWriter writer)
{
// Write tag attributes
base.WriteXml(writer);
if (IsFragment)
{
writer.WriteAttributeString(ATTR.cut, Fragment);
writer.WriteAttributeIfString(ATTR.no_cut, Restrict);
writer.WriteAttributeNullable(ATTR.sense, Terminus);
writer.WriteAttributeNullable(ATTR.min_length, MinFragmentLength);
}
else
{
writer.WriteAttributeIfString(ATTR.ion_formula, SettingsCustomIon.Formula);
// Masses are information only, if their is a formula, but Panorama may need these
writer.WriteAttribute(ATTR.mass_monoisotopic, SettingsCustomIon.MonoisotopicMass);
writer.WriteAttribute(ATTR.mass_average, SettingsCustomIon.AverageMass);
writer.WriteAttributeString(ATTR.charge, Charge.ToString(CultureInfo.InvariantCulture));
writer.WriteAttribute(ATTR.optional, IsOptional);
}
}