/// <summary> /// Writes a value for the <code>style</code> property as a <code>labelStyle</code> value. The <code>style</code> property specifies the style of the label. /// </summary> /// <param name="value">The label style.</param> public void WriteStyleProperty(CesiumLabelStyle value) { using (var writer = OpenStyleProperty()) { writer.WriteLabelStyle(value); } }
/// <summary> /// Writes the <code>labelStyle</code> property. The <code>labelStyle</code> property specifies the label style. Valid values are "FILL", "OUTLINE", and "FILL_AND_OUTLINE". /// </summary> /// <param name="value">The label style.</param> public void WriteLabelStyle(CesiumLabelStyle value) { const string PropertyName = LabelStylePropertyName; if (IsInterval) { Output.WritePropertyName(PropertyName); } Output.WriteValue(CesiumFormattingHelper.LabelStyleToString(value)); }
/// <summary> /// Converts a <see cref="CesiumLabelStyle"/> to the corresponding string in a /// CZML stream. /// </summary> /// <param name="labelStyle">The label style to convert.</param> /// <returns>The string representing the specified <see cref="CesiumLabelStyle"/>.</returns> public static string LabelStyleToString(CesiumLabelStyle labelStyle) { switch (labelStyle) { case CesiumLabelStyle.Fill: return("FILL"); case CesiumLabelStyle.Outline: return("OUTLINE"); case CesiumLabelStyle.FillAndOutline: return("FILL_AND_OUTLINE"); default: throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "labelStyle"); } }
public void LabelStyleCanBeWrittenAsSimpleString() { const string expectedPropertyName = "foo"; const CesiumLabelStyle expectedValue = CesiumLabelStyle.FillAndOutline; using (Packet) using (var writer = new LabelStyleCesiumWriter(expectedPropertyName)) { writer.Open(OutputStream); writer.WriteLabelStyle(expectedValue); } AssertExpectedJson(new Dictionary <string, object> { { expectedPropertyName, CesiumFormattingHelper.LabelStyleToString(expectedValue) }, }); }
public void LabelStyleCanBeWrittenInsideInterval() { var start = new GregorianDate(2012, 6, 7, 12, 0, 0).ToJulianDate(); var stop = start.AddSeconds(100.0); const string expectedPropertyName = "foo"; const CesiumLabelStyle expectedValue = CesiumLabelStyle.FillAndOutline; using (Packet) using (var writer = new LabelStyleCesiumWriter(expectedPropertyName)) { writer.Open(OutputStream); writer.WriteInterval(start, stop); writer.WriteLabelStyle(expectedValue); } AssertExpectedJson(expectedPropertyName, new Dictionary <string, object> { { "interval", CesiumFormattingHelper.ToIso8601Interval(start, stop, Iso8601Format.Compact) }, { LabelStyleCesiumWriter.LabelStylePropertyName, CesiumFormattingHelper.LabelStyleToString(expectedValue) }, }); }
public void TestLabelStyleToString(CesiumLabelStyle value) { string s = CesiumFormattingHelper.LabelStyleToString(value); Assert.IsNotNull(s); }
/// <summary> /// Converts a <see cref="CesiumLabelStyle"/> to the corresponding string in a /// CZML stream. /// </summary> /// <param name="labelStyle">The label style to convert.</param> /// <returns>The string representing the specified <see cref="CesiumLabelStyle"/>.</returns> public static string LabelStyleToString(CesiumLabelStyle labelStyle) { switch (labelStyle) { case CesiumLabelStyle.Fill: return "FILL"; case CesiumLabelStyle.Outline: return "OUTLINE"; case CesiumLabelStyle.FillAndOutline: return "FILL_AND_OUTLINE"; default: throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "labelStyle"); } }