/// <summary> /// Write the contents of this element to the given <see cref="XmlWriter"/>. /// </summary> /// <remarks>The caller of this method has already written the start element tag before /// calling this method, so deriving classes only need to write the element content, not /// the start or end tags.</remarks> /// <param name="writer">Writer to send XML content to.</param> public override void SerializeContent(XmlWriter writer) { writer.WriteAttributeIfNotEmpty(InstanceElement.NamePropertyName, this.Name) .WriteAttributeIfNotEmpty(InstanceElement.ValuePropertyName, this.Value) .WriteAttributeIfNotEmpty(InstanceElement.TypeNamePropertyName, this.TypeName) .WriteAttributeIfNotEmpty(InstanceElement.TypeConverterTypeNamePropertyName, this.TypeConverterTypeName); }
/// <summary> /// Write the contents of this element to the given <see cref="XmlWriter"/>. /// </summary> /// <remarks>The caller of this method has already written the start element tag before /// calling this method, so deriving classes only need to write the element content, not /// the start or end tags.</remarks> /// <param name="writer">Writer to send XML content to.</param> public override void SerializeContent(XmlWriter writer) { writer.WriteAttributeIfNotEmpty(TypeNamePropertyName, this.TypeName); foreach (var valueElement in this.Values) { ValueElementHelper.SerializeParameterValueElement(writer, valueElement, true); } }
/// <summary> /// Write the contents of this element to the given <see cref="XmlWriter"/>. /// </summary> /// <remarks>The caller of this method has already written the start element tag before /// calling this method, so deriving classes only need to write the element content, not /// the start or end tags.</remarks> /// <param name="writer">Writer to send XML content to.</param> public override void SerializeContent(XmlWriter writer) { base.SerializeContent(writer); writer.WriteAttributeIfNotEmpty(NamePropertyName, Name); }
/// <summary> /// Write the contents of this element to the given <see cref="XmlWriter"/>. /// </summary> /// <remarks>The caller of this method has already written the start element tag before /// calling this method, so deriving classes only need to write the element content, not /// the start or end tags.</remarks> /// <param name="writer">Writer to send XML content to.</param> public override void SerializeContent(XmlWriter writer) { writer.WriteAttributeString(NamePropertyName, Name); writer.WriteAttributeIfNotEmpty(TypeNamePropertyName, TypeName); if(LifetimeIsPresent()) { writer.WriteElement("lifetime", Lifetime.SerializeContent); } foreach(var injectionElement in Injection) { writer.WriteElement(injectionElement.ElementName, injectionElement.SerializeContent); } }
///<summary> /// Write the contents of this element to the given <see cref="XmlWriter"/>. This /// method always outputs an explicit <dependency> tag, instead of providing /// attributes to the parent method. ///</summary> ///<param name="writer">Writer to send XML content to.</param> public override void SerializeContent(XmlWriter writer) { writer.WriteAttributeIfNotEmpty(NamePropertyName, Name) .WriteAttributeIfNotEmpty(TypeNamePropertyName, TypeName); }
/// <summary> /// Write the contents of this element to the given <see cref="XmlWriter"/>. /// </summary> /// <remarks>The caller of this method has already written the start element tag before /// calling this method, so deriving classes only need to write the element content, not /// the start or end tags.</remarks> /// <param name="writer">Writer to send XML content to.</param> void IAttributeOnlyElement.SerializeContent(XmlWriter writer) { writer.WriteAttributeIfNotEmpty("dependencyName", Name) .WriteAttributeIfNotEmpty("dependencyType", TypeName); }
/// <summary> /// Write the contents of this element to the given <see cref="XmlWriter"/>. /// </summary> /// <remarks>The caller of this method has already written the start element tag before /// calling this method, so deriving classes only need to write the element content, not /// the start or end tags.</remarks> /// <param name="writer">Writer to send XML content to.</param> public override void SerializeContent(XmlWriter writer) { Guard.ArgumentNotNull(writer, "writer"); writer.WriteAttributeString(NamePropertyName, Name); writer.WriteAttributeIfNotEmpty(TypeNamePropertyName, TypeName); ValueElementHelper.SerializeParameterValueElement(writer, Value, false); }
/// <summary> /// Write the contents of this element to the given <see cref="XmlWriter"/>. /// </summary> /// <remarks>The caller of this method has already written the start element tag before /// calling this method, so deriving classes only need to write the element content, not /// the start or end tags.</remarks> /// <param name="writer">Writer to send XML content to.</param> public override void SerializeContent(XmlWriter writer) { writer.WriteAttributeIfNotEmpty(OptionalElement.NamePropertyName, this.Name) .WriteAttributeIfNotEmpty(OptionalElement.TypeNamePropertyName, this.TypeName); }
public override void SerializeContent(XmlWriter writer) { Guard.ArgumentNotNull(writer, "writer"); writer.WriteAttributeIfNotEmpty(NamePropertyName, Name); writer.WriteAttributeIfNotEmpty(TypeNamePropertyName, TypeName); if(IsDefaultForType) { writer.WriteAttributeString(IsDefaultForTypePropertyName, IsDefaultForType.ToString()); } }
public override void SerializeContent(XmlWriter writer) { Microsoft.Practices.Unity.Utility.Guard.ArgumentNotNull(writer, "writer"); writer.WriteAttributeString(TypePropertyName, TypeName); writer.WriteAttributeIfNotEmpty(MapToPropertyName, MapToName) .WriteAttributeIfNotEmpty(NamePropertyName, Name); if(!string.IsNullOrEmpty(Lifetime.TypeName)) { writer.WriteElement("lifetime", Lifetime.SerializeContent); } SerializeInjectionMembers(writer); }
/// <summary> /// Serializes the specified XML writer. /// </summary> /// <param name="xmlWriter">The XML writer.</param> public virtual void Serialize(XmlWriter xmlWriter) { xmlWriter.WriteAttributeString("id", Id.ToString()); xmlWriter.WriteAttributeString("type", Type.ToString()); xmlWriter.WriteAttributeString("expressionName", ExpressionName); xmlWriter.WriteAttributeString("uniqueName", UniqueName); xmlWriter.WriteAttributeIfNotEmpty("functionName", FunctionName); xmlWriter.WriteAttributeString("left", Left.ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("top", Top.ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("width", Width.ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("height", Height.ToString(CultureInfo.InvariantCulture)); }
/// <summary> /// Write the contents of this element to the given <see cref="XmlWriter"/>. /// </summary> /// <remarks>The caller of this method has already written the start element tag before /// calling this method, so deriving classes only need to write the element content, not /// the start or end tags.</remarks> /// <param name="writer">Writer to send XML content to.</param> public override void SerializeContent(XmlWriter writer) { writer.WriteAttributeIfNotEmpty(NamePropertyName, Name); Extensions.SerializeElementContents(writer, "extension"); Registrations.SerializeElementContents(writer, "register"); Instances.SerializeElementContents(writer, "instance"); SerializeContainerConfiguringElements(writer); }
public override void SerializeContent(XmlWriter writer) { Microsoft.Practices.Unity.Utility.Guard.ArgumentNotNull(writer, "writer"); writer.WriteAttributeString(NamePropertyName, this.Name); writer.WriteAttributeIfNotEmpty(TypeNamePropertyName, this.TypeName); if (this.LifetimeIsPresent()) { writer.WriteElement("lifetime", this.Lifetime.SerializeContent); } foreach (var injectionElement in this.Injection) { writer.WriteElement(injectionElement.ElementName, injectionElement.SerializeContent); } }
/// <summary> /// Serializes the specified XML writer. /// </summary> /// <param name="xmlWriter">The XML writer.</param> public void Serialize(XmlWriter xmlWriter) { xmlWriter.WriteAttributeString("id", Id.ToString()); xmlWriter.WriteAttributeString("name", Name); xmlWriter.WriteAttributeString("dataType", DataType.ToString()); xmlWriter.WriteAttributeIfNotEmpty("innerName", InnerName); xmlWriter.WriteAttributeIfNotEmpty("setName", SetName); xmlWriter.WriteAttributeIfNotEmpty("systemName", SystemName); xmlWriter.WriteAttributeIfNotEmpty("objectName", GetObjectName()); xmlWriter.WriteAttributeIfNotEmpty("uniqueName", UniqueName); xmlWriter.WriteAttributeIfNotEmpty("keepSubfieldsAlive", KeepSubfieldsAlive ? Boolean.TrueString : Boolean.FalseString); xmlWriter.WriteAttributeIfNotEmpty("hideConnector", HideConnector ? Boolean.TrueString : Boolean.FalseString); xmlWriter.WriteAttributeIfNotEmpty("isGroupingField", IsGroupingField ? Boolean.TrueString : Boolean.FalseString); xmlWriter.WriteAttributeIfNotEmpty("isGroupCollapsed", IsGroupCollapsed ? Boolean.TrueString : Boolean.FalseString); xmlWriter.WriteStartElement("ConnectorOut"); ConnectorOut.Serialize(xmlWriter); xmlWriter.WriteEndElement(); if (AdditionalInfo != null) { xmlWriter.WriteStartElement("AdditionalInfo"); AdditionalInfo.Serialize(xmlWriter); xmlWriter.WriteEndElement(); } if (_subfields != null && _subfields.Any()) { xmlWriter.WriteStartElement("Subfields"); foreach (var subfield in Subfields) { xmlWriter.WriteStartElement("SourceField"); ((SourceField)subfield).Serialize(xmlWriter); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); } }
/// <summary> /// Write the contents of this element to the given <see cref="XmlWriter"/>. /// </summary> /// <remarks>The caller of this method has already written the start element tag before /// calling this method, so deriving classes only need to write the element content, not /// the start or end tags.</remarks> /// <param name="writer">Writer to send XML content to.</param> public override void SerializeContent(XmlWriter writer) { writer.WriteAttributeString(TypePropertyName, TypeName); writer.WriteAttributeIfNotEmpty(MapToPropertyName, MapToName) .WriteAttributeIfNotEmpty(NamePropertyName, Name); if(!string.IsNullOrEmpty(Lifetime.TypeName)) { writer.WriteElement("lifetime", Lifetime.SerializeContent); } SerializeInjectionMembers(writer); }