private static void Collect(HashSet <XNamespace> result, ScoredProperty element) { result.AddXNamespaceOfXName(element.Name); Collect(result, element.Value); Collect(result, element.ParameterRef); foreach (var p in element.Properties) { Collect(result, p); } foreach (var sp in element.ScoredProperties) { Collect(result, sp); } }
private static void Write(XmlWriter writer, ScoredProperty element) { writer.WriteStartElement(Psf.ScoredProperty.LocalName, Psf.Namespace.NamespaceName); writer.WriteAttributeString("name", element.Name.ToQName(writer)); Write(writer, element.Value); Write(writer, element.ParameterRef); foreach (var p in element.Properties) { Write(writer, p); } foreach (var sp in element.ScoredProperties) { Write(writer, sp); } writer.WriteEndElement(); }
/// <summary> /// Add the specified element to the <see cref="Option"/>. /// </summary> /// <param name="element">The <see cref="ScoredProperty"/> to add.</param> /// <returns>A new Option with the element added.</returns> public Option Add(ScoredProperty element) { return(new Option(Name, Constrained, _properties, _scoredProperties.Add(element))); }