/// <summary>Writes the start of an XML element.</summary> /// <param name="writer">An <see cref="XmlWriter"/> to write to.</param> public void CreateStartElement(XmlWriter writer) { if (this.State != ItemIconStates.None) // Make sure there's something to save { var attributes = from v in States where (v != ItemIconStates.None) && this.State.HasFlag(v) select TypeBrowser.GetEnum(v).ElementName; string value = string.Join(" ", attributes); writer.WriteElementString("state", KmlNamespaces.Kml22Namespace, value); } }
/// <summary> /// Writes the start of an XML element. /// </summary> /// <param name="writer">An <see cref="XmlWriter"/> to write to.</param> public void CreateStartElement(XmlWriter writer) { // Make sure there's something to save if (this.State != ItemIconStates.None) { IEnumerable <string> attributes = States.Where(s => (s != ItemIconStates.None) && this.State.HasFlag(s)) .Select(s => TypeBrowser.GetEnum(s)) .Where(a => a != null) .Select(a => a.ElementName); string value = string.Join(" ", attributes); writer.WriteElementString("state", KmlNamespaces.Kml22Namespace, value); } }