public void BuildLabelsTest()
        {
            TrackCollection tracks = LoadTracks();
            AxisLabelProvider target = new AxisLabelProvider();
            DateTime startTime = tracks.First.StartTime;
            DateTime endTime = tracks.Last.EndTime;
            target.BuildLabels(startTime, endTime);

            Assert.AreEqual(target.Count, 2);
            Assert.AreEqual(target.GetTime(0), new DateTime(2012, 3, 1, 11, 0, 0));
            Assert.AreEqual(target.GetTime(1), new DateTime(2012, 3, 1, 12, 0, 0));
        }
        private void RefreshView()
        {
            if (Tracks == null) return;

            DateTime start = new DateTime();
            DateTime end = new DateTime();
            if (Tracks.First != null) {
                start = Tracks.First.StartTime;
            }
            if (Tracks.Last != null) {
                end = Tracks.Last.EndTime;
            }

            AxisLabelProvider labels = new AxisLabelProvider();
            labels.BuildLabels(start, end);

            TimelineValueCollection values = new TimelineValueCollection(start, end);
            values.Build(Tracks);

            bar.AllBackground = this.AllBackground;
            bar.EventBackground = this.EventBackground;
            bar.RefreshBar(values, labels);
        }
Esempio n. 3
0
        public void RefreshBar(TimelineValueCollection values, AxisLabelProvider labels)
        {
            m_plotElement.AxisLabels = labels;
            m_plotElement.Values = values;
            m_xaxisElement.AxisLabels = labels;

            InvalidateArrange();
        }