コード例 #1
0
        /// <summary>
        /// Appends the timestamps of the single trend to the string builder.
        /// </summary>
        private void AppendTimestamps(StringBuilder stringBuilder, Trend trend)
        {
            stringBuilder.Append('[');

            if (trend != null)
            {
                int counter = 0;

                foreach (Data.Models.TrendPoint point in trend.Points)
                {
                    TimePoint.Append(stringBuilder,
                                     point.Timestamp.GetUnixMilliseconds(),
                                     point.Timestamp.ToLocalTimeString(options.TimeZone));

                    if (++counter == ItemsPerLine)
                    {
                        counter = 0;
                        stringBuilder.AppendLine();
                    }
                }
            }

            stringBuilder.Append(']');
        }
コード例 #2
0
        /// <summary>
        /// Appends the timestamps of the trend bundle to the string builder.
        /// </summary>
        private void AppendTimestamps(StringBuilder stringBuilder, TrendBundle trendBundle)
        {
            stringBuilder.Append('[');

            if (trendBundle != null)
            {
                int counter = 0;

                foreach (DateTime timestamp in trendBundle.Timestamps)
                {
                    TimePoint.Append(stringBuilder,
                                     timestamp.GetUnixMilliseconds(),
                                     timestamp.ToLocalTimeString(options.TimeZone));

                    if (++counter == ItemsPerLine)
                    {
                        counter = 0;
                        stringBuilder.AppendLine();
                    }
                }
            }

            stringBuilder.Append(']');
        }