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


C# XmlWriter.WriteAttribute方法代码示例

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

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

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

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

示例5: WriteXml

 public void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     writer.WriteAttribute(ATTR.symbol, IsotopeSymbol);
     // Write element string
     writer.WriteString(AtomPercentEnrichment.ToString(CultureInfo.InvariantCulture));
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:7,代码来源:IsotopeEnrichments.cs

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

示例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);
 }
开发者ID:chrisforbes,项目名称:aliengame,代码行数:8,代码来源:Actor.cs

示例8: WriteXml

 public override void WriteXml(XmlWriter writer)
 {
     base.WriteXml(writer);
     writer.WriteAttribute(Attr.library, Library);
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:5,代码来源:RetentionTimeSource.cs

示例9: SaveAttributes

 protected override void SaveAttributes(XmlWriter w)
 {
     base.SaveAttributes(w);
     w.WriteAttribute("numguards", NumGuards);
     w.WriteAttribute("maxguards", MaxGuards);
     w.WriteAttribute("respawnrate", RespawnRate);
 }
开发者ID:chrisforbes,项目名称:aliengame,代码行数:7,代码来源:GuardSpawner.cs

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

示例11: WriteXml

 public void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     writer.WriteAttribute(ATTR2.type, Type);
     writer.WriteAttribute(ATTR2.weight, Weight);
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:6,代码来源:FeatureCalculator.cs

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

示例13: WriteXml

 public override void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     base.WriteXml(writer);
     writer.WriteAttribute(ATTR.count_measured, SpectrumCount);
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:6,代码来源:BiblioSpec.cs

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

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


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