public void SerializeLabelStyleName() { LabelStyle labelStyle = new LabelStyle(); labelStyle.Name = "Test Style"; String xml = OgcSymbologySerialize.LabelStyle(labelStyle); StringAssert.Contains(@"<Name>Test Style</Name>", xml); StringAssert.Contains(@"<FeatureTypeStyle", xml); }
public void SerializeLabelStyleDescription() { LabelStyle labelStyle = new LabelStyle(); labelStyle.Description = new Description("description","abstract"); String xml = OgcSymbologySerialize.LabelStyle(labelStyle); StringAssert.Contains(@"<Title>description</Title>", xml); StringAssert.Contains(@"<Abstract>abstract</Abstract>", 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 LabelStyle LabelStyle(String xml) { FeatureTypeStyleType rawStyle = FeatureTypeStyleSerializer.Deserialize(xml); LabelStyle labelStyle = new LabelStyle(); if (!String.IsNullOrEmpty(rawStyle.Name)) { labelStyle.Name = rawStyle.Name; } if (rawStyle.Description != null) { labelStyle.Description = new Description(rawStyle.Description.Title, rawStyle.Description.Abstract); } return labelStyle; }