本文整理汇总了C#中System.Xml.XmlWriter.WriteAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# XmlWriter.WriteAttribute方法的具体用法?C# XmlWriter.WriteAttribute怎么用?C# XmlWriter.WriteAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlWriter
的用法示例。
在下文中一共展示了XmlWriter.WriteAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
public void Save(XmlWriter w)
{
w.WriteStartElement("door");
w.WriteAttribute("x", Position.X);
w.WriteAttribute("y", Position.Y);
w.WriteAttribute("kind", Kind);
w.WriteAttribute("state", State);
w.WriteEndElement();
}
示例2: Save
public void Save(XmlWriter w)
{
w.WriteStartElement("brush");
w.WriteAttribute("left", Bounds.Left);
w.WriteAttribute("top", Bounds.Top);
w.WriteAttribute("right", Bounds.Right);
w.WriteAttribute("bottom", Bounds.Bottom);
w.WriteAttribute("content", Content);
w.WriteEndElement();
}
示例3: 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);
}
示例4: 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);
}
}
示例5: WriteXml
public void WriteXml(XmlWriter writer)
{
// Write tag attributes
writer.WriteAttribute(ATTR.symbol, IsotopeSymbol);
// Write element string
writer.WriteString(AtomPercentEnrichment.ToString(CultureInfo.InvariantCulture));
}
示例6: WriteXml
public override void WriteXml(XmlWriter writer)
{
// Write tag attributes
base.WriteXml(writer);
writer.WriteAttribute(ATTR.use_for_retention_time_prediction, false);
writer.WriteAttributeNullable(ATTR.analyte_concentration, AnalyteConcentration);
if (null != SampleType && !Equals(SampleType, SampleType.DEFAULT))
{
writer.WriteAttribute(ATTR.sample_type, SampleType.Name);
}
// Write optimization element, if present
if (OptimizationFunction != null)
{
IXmlElementHelper<OptimizableRegression> helper = XmlUtil.FindHelper(
OptimizationFunction, OPTIMIZATION_HELPERS);
if (helper == null)
throw new InvalidOperationException(Resources.ChromatogramSet_WriteXml_Attempt_to_serialize_list_containing_invalid_type);
writer.WriteElement(helper.ElementNames[0], OptimizationFunction);
}
int i = 0;
foreach (var fileInfo in MSDataFileInfos)
{
writer.WriteStartElement(EL.sample_file);
writer.WriteAttribute(ATTR.id, GetOrdinalSaveId(i++));
writer.WriteAttribute(ATTR.file_path, fileInfo.FilePath);
writer.WriteAttribute(ATTR.sample_name, fileInfo.FilePath.GetSampleOrFileName());
if(fileInfo.RunStartTime != null)
{
writer.WriteAttribute(ATTR.acquired_time, XmlConvert.ToString((DateTime) fileInfo.RunStartTime, "yyyy-MM-ddTHH:mm:ss")); // Not L10N
}
if(fileInfo.FileWriteTime != null)
{
writer.WriteAttribute(ATTR.modified_time, XmlConvert.ToString((DateTime)fileInfo.FileWriteTime, "yyyy-MM-ddTHH:mm:ss")); // Not L10N
}
// instrument information
WriteInstrumentConfigList(writer, fileInfo.InstrumentInfoList);
writer.WriteEndElement();
}
SrmDocument.WriteAnnotations(writer, Annotations);
}
示例7: SaveAttributes
protected virtual void SaveAttributes(XmlWriter w)
{
w.WriteAttribute("class", GetType().ToString());
w.WriteAttribute("x", Position.X);
w.WriteAttribute("y", Position.Y);
w.WriteAttribute("dir", Direction);
w.WriteAttribute("name", Name);
}
示例8: WriteXml
public override void WriteXml(XmlWriter writer)
{
base.WriteXml(writer);
writer.WriteAttribute(Attr.library, Library);
}
示例9: SaveAttributes
protected override void SaveAttributes(XmlWriter w)
{
base.SaveAttributes(w);
w.WriteAttribute("numguards", NumGuards);
w.WriteAttribute("maxguards", MaxGuards);
w.WriteAttribute("respawnrate", RespawnRate);
}
示例10: 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();
}
}
示例11: WriteXml
public void WriteXml(XmlWriter writer)
{
// Write tag attributes
writer.WriteAttribute(ATTR2.type, Type);
writer.WriteAttribute(ATTR2.weight, Weight);
}
示例12: 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);
}
}
示例13: WriteXml
public override void WriteXml(XmlWriter writer)
{
// Write tag attributes
base.WriteXml(writer);
writer.WriteAttribute(ATTR.count_measured, SpectrumCount);
}
示例14: WriteXml
public override void WriteXml(XmlWriter writer)
{
// Write tag attributes
base.WriteXml(writer);
writer.WriteAttributeString(ATTR.regex, Regex);
writer.WriteAttribute(ATTR.include, IsIncludeMatch);
writer.WriteAttribute(ATTR.match_mod_sequence, IsMatchMod);
}
示例15: 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);
}