public void NullLog() { var form = new Form { Text = "Test", Width = 600, Height = 300, Font = new Font("Times New Roman", 12, FontStyle.Regular, GraphicsUnit.Point), }; var ctl = new TimeLogChartControl { Dock = DockStyle.Fill, TimeRecords = null, }; form.Controls.Add(ctl); form.Closed += (sender, e) => { Application.Exit(); }; Application.Run(form); }
public TimeLogForm(IEnumerable<TimeRecord> log, Dictionary<int, string> names) { InitializeComponent(); var control = new TimeLogChartControl { Dock = DockStyle.Fill, Names = names, TimeRecords = log, }; Controls.Add(control); control.DoubleClick += (sender, e) => { Close(); }; control.KeyPress += (sender, e) => { if (e.KeyChar == 27) { Close(); } }; }
public void ShortLog() { var form = new Form { Text = "Test", Width = 600, Height = 300, Font = new Font("Times New Roman", 12, FontStyle.Regular, GraphicsUnit.Point), }; var timeTracking = new TimeTracking(); timeTracking.Records.Add(new TimeRecord { AssignableID = 5, Started = Time(11, 8), Ended = Time(11, 9), Description = "First task completed" }); var ctl = new TimeLogChartControl { Dock = DockStyle.Fill, TimeRecords = timeTracking.Records, }; form.Controls.Add(ctl); form.Closed += (sender, e) => { Application.Exit(); }; Application.Run(form); }
public void NormalLog() { var form = new Form { Text = "Test", Width = 600, Height = 300, Font = new Font("Arial", 12, FontStyle.Regular, GraphicsUnit.Point), }; var timeTracking = new TimeTracking(); timeTracking.Records.Add(new TimeRecord { AssignableID = 5, Started = Time(10, 8), Ended = Time(11, 23), Description = "First task completed" }); timeTracking.Records.Add(new TimeRecord { AssignableID = 3, Started = Time(11, 49), Ended = Time(12, 23), Description = "First task completed" }); timeTracking.Records.Add(new TimeRecord { AssignableID = 4, Started = Time(13, 1), Ended = Time(13, 23), Description = "First task completed" }); timeTracking.Records.Add(new TimeRecord { AssignableID = 5, Started = Time(13, 23), Ended = Time(15, 59), Description = "First task completed" }); timeTracking.Records.Add(new TimeRecord { AssignableID = 6, Started = Time(16, 0), Ended = Time(17, 28), Description = "First task completed" }); var ctl = new TimeLogChartControl { Dock = DockStyle.Fill, Names = new Dictionary<int, string> { {3, "Simple task"}, {4, "Moderate task"}, {5, "Complex task with a very long name that does not fit to a header cell and needs to be wrapped or a tool tip needs to be displayed for it."}, }, TimeRecords = timeTracking.Records, }; form.Controls.Add(ctl); form.Closed += (sender, e) => { Application.Exit(); }; Application.Run(form); }