本文整理汇总了C#中System.Xml.XmlWriter.WriteElements方法的典型用法代码示例。如果您正苦于以下问题:C# XmlWriter.WriteElements方法的具体用法?C# XmlWriter.WriteElements怎么用?C# XmlWriter.WriteElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlWriter
的用法示例。
在下文中一共展示了XmlWriter.WriteElements方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteXml
public override void WriteXml(XmlWriter writer)
{
// Write tag attributes
base.WriteXml(writer);
writer.WriteElements(_isotopeEnrichments);
}
示例2: WriteXml
public override void WriteXml(XmlWriter writer)
{
// Write tag attributes
base.WriteXml(writer);
if (IsTrained)
{
writer.WriteAttribute(ATTR.uses_decoys, UsesDecoys, true);
writer.WriteAttribute(ATTR.uses_false_targets, UsesSecondBest);
writer.WriteAttribute(ATTR.bias, Parameters.Bias);
// Write calculators
var calculators = new List<FeatureCalculator>(PeakFeatureCalculators.Count);
for (int i = 0; i < PeakFeatureCalculators.Count; i++)
calculators.Add(new FeatureCalculator(PeakFeatureCalculators[i].GetType(), Parameters.Weights[i]));
writer.WriteElements(calculators);
}
}
示例3: 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);
}
示例4: 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());
}
示例5: WriteXml
public void WriteXml(XmlWriter writer)
{
// Write attibutes
writer.WriteAttribute(ATTR.max_variable_mods, MaxVariableMods);
writer.WriteAttribute(ATTR.max_neutral_losses, MaxNeutralLosses);
if (InternalStandardTypes.Count == 0)
{
writer.WriteAttribute(ATTR.internal_standard, IsotopeLabelType.NONE_NAME);
}
if (InternalStandardTypes.Count == 1)
{
var internalStandardType = InternalStandardTypes[0];
if (!ReferenceEquals(internalStandardType, IsotopeLabelType.heavy))
writer.WriteAttribute(ATTR.internal_standard, internalStandardType.Name);
}
else
{
foreach (var labelType in InternalStandardTypes)
{
writer.WriteStartElement(EL.internal_standard);
writer.WriteAttribute(ATTR.name, labelType.Name);
writer.WriteEndElement();
}
}
// Write child elements
if (StaticModifications.Count > 0)
writer.WriteElementList(EL.static_modifications, StaticModifications);
foreach (var heavyMods in GetHeavyModifications())
{
writer.WriteStartElement(EL.heavy_modifications);
if (!ReferenceEquals(heavyMods.LabelType, IsotopeLabelType.heavy))
writer.WriteAttribute(ATTR.isotope_label, heavyMods.LabelType);
writer.WriteElements(heavyMods.Modifications);
writer.WriteEndElement();
}
}
示例6: WriteXml
public void WriteXml(XmlWriter writer)
{
writer.WriteElements(RetentionTimeSources.Values);
writer.WriteElements(FileAlignments.Values);
}
示例7: WriteXml
public override void WriteXml(XmlWriter writer)
{
// Write tag attributes.
base.WriteXml(writer);
if (PrecursorRightFilter.HasValue)
{
writer.WriteAttributeNullable(ATTR.precursor_left_filter, PrecursorFilter);
writer.WriteAttributeNullable(ATTR.precursor_right_filter, PrecursorRightFilter);
}
else
{
writer.WriteAttributeNullable(ATTR.precursor_filter, PrecursorFilter);
}
if (!Equals(SpecialHandling, SpecialHandlingType.NONE))
writer.WriteAttribute(ATTR.special_handling, SpecialHandling);
writer.WriteAttributeNullable(ATTR.windows_per_scan, WindowsPerScan);
writer.WriteElements(_prespecifiedIsolationWindows);
}