Fixed initial selected date issue and improved startup time.

This commit is contained in:
gamosoft_cp 2013-05-03 14:27:19 +00:00
parent 06ed1cbd60
commit cbb4618c7e
3 changed files with 16 additions and 4 deletions

View File

@ -40,6 +40,15 @@ namespace Outlook2013TodoAddIn
set { this.chkMailAlerts.Checked = value; }
}
/// <summary>
/// Gets/sets the selected calendar date
/// </summary>
public DateTime SelectedDate
{
get { return this.apptCalendar.SelectedDate; }
set { this.apptCalendar.SelectedDate = value; }
}
#endregion "Properties"
#region "Methods"

View File

@ -106,7 +106,6 @@ namespace Outlook2013TodoAddIn
public CustomCalendar()
{
InitializeComponent();
//this.SelectedDate = DateTime.Today;
this.FirstDayOfWeek = DayOfWeek.Sunday;
//TODO: Thread.CurrentThread.CurrentCulture.DateTimeFormat.FirstDayOfWeek
this.CurrentMonthForeColor = Color.Black;
@ -131,7 +130,7 @@ namespace Outlook2013TodoAddIn
{
// TODO: check initial double firing
// TODO: Mark dates with colors from outlook
this.UpdateCalendar();
// this.UpdateCalendar();
}
/// <summary>

View File

@ -41,8 +41,7 @@ namespace Outlook2013TodoAddIn
this.AppControl = new AppointmentsControl();
this.AppControl.MailAlertsEnabled = Properties.Settings.Default.MailAlertsEnabled;
this.AppControl.NumDays = Properties.Settings.Default.NumDays; // Setting the value will load the appointments
this.AppControl.RetrieveAppointments();
ToDoTaskPane = this.CustomTaskPanes.Add(this.AppControl, "Appointments");
ToDoTaskPane.Visible = Properties.Settings.Default.Visible;
ToDoTaskPane.Width = Properties.Settings.Default.Width;
@ -51,6 +50,11 @@ namespace Outlook2013TodoAddIn
ToDoTaskPane.VisibleChanged += ToDoTaskPane_VisibleChanged;
this.AppControl.SizeChanged += appControl_SizeChanged;
// Selecting the date will retrieve the appointments
// Otherwise it'll take the one used when the designer changed!
this.AppControl.SelectedDate = DateTime.Today;
// this.AppControl.RetrieveAppointments();
Globals.ThisAddIn.Application.ActiveExplorer().Deactivate += ThisAddIn_Deactivate;
// TODO: Make sure there are no memory leaks (dispose COM objects)