public void SerializeDegeneratePointSymbolizer() { FeatureTypeStyleType featureStyleType = new FeatureTypeStyleType(); RuleType rule = new RuleType(); featureStyleType.Items = new Object[1]; featureStyleType.Items[0] = rule; PointSymbolizerType pointSymbolizer = new PointSymbolizerType(); rule.Items = new SymbolizerType[1]; rule.Items[0] = pointSymbolizer; String xml = FeatureTypeStyleSerializer.Serialize(featureStyleType); StringAssert.Contains("<Rule>", xml); StringAssert.Contains("</Rule>", xml); StringAssert.Contains("<PointSymbolizer", xml); }
public static String LabelStyle(LabelStyle style) { FeatureTypeStyleType rawStyle = new FeatureTypeStyleType(); if (!String.IsNullOrEmpty(style.Name)) { rawStyle.Name = style.Name; } if (style.Description != null) { rawStyle.Description = new DescriptionType(); rawStyle.Description.Title = style.Description.Title; rawStyle.Description.Abstract= style.Description.Abstract; } return FeatureTypeStyleSerializer.Serialize(rawStyle); }
public static String Serialize(FeatureTypeStyleType featureTypeStyle) { StringWriter writer = new StringWriter(); _serializer.Serialize(writer, featureTypeStyle); return writer.ToString(); }