Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Charts/Axes/DateTime/DateTimeAxisControl.cs @ 12503

Last change on this file since 12503 was 12503, checked in by aballeit, 9 years ago

#2283 added GUI and charts; fixed MCTS

File size: 831 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6namespace Microsoft.Research.DynamicDataDisplay.Charts
7{
8  /// <summary>
9  /// AxisControl for DateTime axes.
10  /// </summary>
11  public class DateTimeAxisControl : AxisControl<DateTime>
12  {
13    /// <summary>
14    /// Initializes a new instance of the <see cref="DateTimeAxisControl"/> class.
15    /// </summary>
16    public DateTimeAxisControl()
17    {
18      LabelProvider = new DateTimeLabelProvider();
19      TicksProvider = new DateTimeTicksProvider();
20      MajorLabelProvider = new MajorDateTimeLabelProvider();
21
22      ConvertToDouble = dt => dt.Ticks;
23      ConvertFromDouble = d =>
24      {
25        if (d < 0)
26          d = 0;
27        return new DateTime((long)d);
28      };
29
30      Range = new Range<DateTime>(DateTime.Now, DateTime.Now.AddYears(1));
31    }
32  }
33}
Note: See TracBrowser for help on using the repository browser.