示例#1
0
        public SimpleTimeSeries(TimeSeries source):base(source)
        {
            if (source == null)
            {
                Events = new TimeSeriesEvent[0];
                return;
            }

            IList<TimeSeriesEvent> eventList = new List<TimeSeriesEvent>();
            for (int i = 0; i < source.count(); i++)
                eventList.Add(new TimeSeriesEvent
                    {
                        Date = source.timeForItem(i).ToString(CultureInfo.InvariantCulture),
                        Value = source[i]
                    });

            Events = eventList.ToArray();
        }
示例#2
0
        public SimpleTimeSeries(TimeSeries source) : base(source)
        {
            if (source == null)
            {
                Events = new TimeSeriesEvent[0];
                return;
            }

            IList <TimeSeriesEvent> eventList = new List <TimeSeriesEvent>();

#if BeforeCaseRefactor
            for (int i = 0; i < source.count(); i++)
#else
            for (int i = 0; i < source.Count; i++)
#endif
            { eventList.Add(new TimeSeriesEvent
                {
                    Date  = source.timeForItem(i).ToString(CultureInfo.InvariantCulture),
                    Value = source[i]
                }); }

            Events = eventList.ToArray();
        }