/// <summary> /// Writes the value expressed as a <c>colorBlendMode</c>, which is the color blend mode. /// </summary> /// <param name="value">The blend mode.</param> public void WriteColorBlendMode(CesiumColorBlendMode value) { const string PropertyName = ColorBlendModePropertyName; if (ForceInterval) { OpenIntervalIfNecessary(); } if (IsInterval) { Output.WritePropertyName(PropertyName); } Output.WriteValue(CesiumFormattingHelper.ColorBlendModeToString(value)); }
/// <summary> /// Converts a <see cref="CesiumColorBlendMode"/> to the corresponding string in a CZML stream. /// </summary> /// <param name="value">The value to convert.</param> /// <returns>The string representing the specified value.</returns> public static string ColorBlendModeToString(CesiumColorBlendMode value) { switch (value) { case CesiumColorBlendMode.Highlight: return "HIGHLIGHT"; case CesiumColorBlendMode.Replace: return "REPLACE"; case CesiumColorBlendMode.Mix: return "MIX"; default: throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "value"); } }
public void TestColorBlendModeProperty() { const CesiumColorBlendMode expectedColorBlendMode = CesiumColorBlendMode.Replace; using (Packet) using (var model = Packet.OpenModelProperty()) using (var interval = model.OpenInterval()) { interval.WriteColorBlendModeProperty(expectedColorBlendMode); } AssertExpectedJson(PacketCesiumWriter.ModelPropertyName, new Dictionary <string, object> { { ModelCesiumWriter.ColorBlendModePropertyName, CesiumFormattingHelper.ColorBlendModeToString(expectedColorBlendMode) }, }); }
/// <summary> /// Converts a <see cref="CesiumColorBlendMode"/> to the corresponding string in a CZML stream. /// </summary> /// <param name="value">The value to convert.</param> /// <returns>The string representing the specified value.</returns> public static string ColorBlendModeToString(CesiumColorBlendMode value) { switch (value) { case CesiumColorBlendMode.Highlight: return("HIGHLIGHT"); case CesiumColorBlendMode.Replace: return("REPLACE"); case CesiumColorBlendMode.Mix: return("MIX"); default: throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "value"); } }
public void TestColorBlendModeToString(CesiumColorBlendMode value) { string s = CesiumFormattingHelper.ColorBlendModeToString(value); Assert.IsNotNull(s); }