CesiumLanguageWriter.Advanced.CesiumWritingHelper.WriteDouble C# (CSharp) Method

WriteDouble() public static method

Writes time-tagged floating-point values as an array in [Time, Value] order. Times are epoch seconds since an epoch that is determined from the first date to be written. The epoch property is written as well.
public static WriteDouble ( CesiumOutputStream output, string propertyName, IList dates, IList values, int startIndex, int length ) : void
output CesiumOutputStream The stream to which to write the array.
propertyName string The name of the property to write.
dates IList The dates at which the value is specified.
values IList The corresponding value for each date.
startIndex int The index of the first element to use in the collection.
length int The number of elements to use from the collection.
return void
        public static void WriteDouble(CesiumOutputStream output, string propertyName, IList<JulianDate> dates, IList<double> values, int startIndex, int length)
        {
            if (dates.Count != values.Count)
                throw new ArgumentException(CesiumLocalization.MismatchedNumberOfDatesAndValues, "values");

            JulianDate epoch = GetAndWriteEpoch(output, dates, startIndex, length);

            output.WritePropertyName(propertyName);
            output.WriteStartSequence();
            int last = startIndex + length;
            for (int i = startIndex; i < last; ++i)
            {
                output.WriteValue(epoch.SecondsDifference(dates[i]));
                output.WriteValue(values[i]);
                output.WriteLineBreak();
            }

            output.WriteEndSequence();
        }