From d8fb233a7a568bba192e1f8d9ea357c0a105fb0c Mon Sep 17 00:00:00 2001 From: gamosoft_cp Date: Thu, 8 Aug 2013 17:53:30 +0000 Subject: [PATCH] Fixed a bug for show past appointments not showing them for all days. Now it will only hide earlier ones (if unchecked) when the selected date == today. --- Outlook2013TodoAddIn/AppointmentsControl.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Outlook2013TodoAddIn/AppointmentsControl.cs b/Outlook2013TodoAddIn/AppointmentsControl.cs index 36eab1b..585f40a 100644 --- a/Outlook2013TodoAddIn/AppointmentsControl.cs +++ b/Outlook2013TodoAddIn/AppointmentsControl.cs @@ -70,6 +70,14 @@ namespace Outlook2013TodoAddIn public AppointmentsControl() { InitializeComponent(); + + if (Properties.Settings.Default.SplitterDistance >= this.splitContainer1.Panel1MinSize && Properties.Settings.Default.SplitterDistance <= this.splitContainer1.Height - this.splitContainer1.Panel2MinSize) + { + // This is to avoid the bug "SplitterDistance must be between Panel1MinSize and Width - Panel2MinSize." + this.splitContainer1.SplitterDistance = Properties.Settings.Default.SplitterDistance; + // TODO: This doesn't work, need to fix (race condition?) + // TODO: Another event is fired after controls are added... + } } /// @@ -92,13 +100,6 @@ namespace Outlook2013TodoAddIn if (this.ShowTasks) { this.splitContainer1.Panel2Collapsed = false; - if (Properties.Settings.Default.SplitterDistance >= this.splitContainer1.Panel1MinSize && Properties.Settings.Default.SplitterDistance <= this.splitContainer1.Height - this.splitContainer1.Panel2MinSize) - { - // This is to avoid the bug "SplitterDistance must be between Panel1MinSize and Width - Panel2MinSize." - this.splitContainer1.SplitterDistance = Properties.Settings.Default.SplitterDistance; - // TODO: This doesn't work, need to fix (race condition?) - } - // this.RetrieveTasks(); } else { @@ -199,7 +200,7 @@ namespace Outlook2013TodoAddIn // Now display the actual appointments below the calendar DateTime startRange = this.apptCalendar.SelectedDate; - if (!this.ShowPastAppointments) + if (!this.ShowPastAppointments && startRange.Date == DateTime.Today) { startRange = startRange.Add(DateTime.Now.TimeOfDay); }