示例#1
0
        /// <summary>
        /// Writes the type of extrapolation to perform when a value is requested at a time before any available samples.
        /// </summary>
        /// <param name="extrapolationType">The extrapolation type.</param>
        public void WriteBackwardExtrapolationType(CesiumExtrapolationType extrapolationType)
        {
            OpenIntervalIfNecessary();

            Output.WritePropertyName("backwardExtrapolationType");
            Output.WriteValue(CesiumFormattingHelper.ExtrapolationTypeToString(extrapolationType));
        }
示例#2
0
        /// <summary>
        /// Converts a <see cref="CesiumExtrapolationType"/> to the corresponding string in a
        /// CZML stream.
        /// </summary>
        /// <param name="extrapolationType">The value to convert.</param>
        /// <returns>The string representing the specified <see cref="CesiumExtrapolationType"/>.</returns>
        public static string ExtrapolationTypeToString(CesiumExtrapolationType extrapolationType)
        {
            switch (extrapolationType)
            {
            case CesiumExtrapolationType.None:
                return("NONE");

            case CesiumExtrapolationType.Hold:
                return("HOLD");

            case CesiumExtrapolationType.Extrapolate:
                return("EXTRAPOLATE");

            default:
                throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "extrapolationType");
            }
        }
        public void WritesBackwardExtrapolationType()
        {
            const string expectedPropertyName = "foo";
            const CesiumExtrapolationType expectedBackwardExtrapolationType = CesiumExtrapolationType.Extrapolate;

            using (Packet)
                using (var propertyWriter = CreatePropertyWriter(expectedPropertyName))
                {
                    propertyWriter.Open(OutputStream);
                    using (TDerived intervalWriter = propertyWriter.OpenInterval())
                    {
                        intervalWriter.WriteBackwardExtrapolationType(expectedBackwardExtrapolationType);
                    }
                }

            AssertExpectedJson(expectedPropertyName, new Dictionary <string, object>
            {
                { "backwardExtrapolationType", CesiumFormattingHelper.ExtrapolationTypeToString(expectedBackwardExtrapolationType) },
            });
        }
        public void TestExtrapolationTypeToString(CesiumExtrapolationType value)
        {
            string s = CesiumFormattingHelper.ExtrapolationTypeToString(value);

            Assert.IsNotNull(s);
        }
示例#5
0
 /// <inheritdoc />
 public void WriteBackwardExtrapolationType(CesiumExtrapolationType extrapolationType)
 {
     m_parent.WriteBackwardExtrapolationType(extrapolationType);
 }
        /// <summary>
        /// Converts a <see cref="CesiumExtrapolationType"/> to the corresponding string in a
        /// CZML stream.
        /// </summary>
        /// <param name="extrapolationType">The value to convert.</param>
        /// <returns>The string representing the specified <see cref="CesiumExtrapolationType"/>.</returns>
        public static string ExtrapolationTypeToString(CesiumExtrapolationType extrapolationType)
        {
            switch (extrapolationType)
            {
                case CesiumExtrapolationType.None:
                    return "NONE";

                case CesiumExtrapolationType.Hold:
                    return "HOLD";

                case CesiumExtrapolationType.Extrapolate:
                    return "EXTRAPOLATE";

                default:
                    throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "extrapolationType");
            }
        }