Refactored code a bit.
Moved configuration to separate form. Added option to show past appointments from the selected day (previous in time, that is). Added some tooltips.
This commit is contained in:
parent
9d7c1d840a
commit
ef0f86d79d
89
Outlook2013TodoAddIn/AppointmentsControl.Designer.cs
generated
89
Outlook2013TodoAddIn/AppointmentsControl.Designer.cs
generated
@ -29,56 +29,17 @@
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
this.numRangeDays = new System.Windows.Forms.NumericUpDown();
|
|
||||||
this.lblRangeDays = new System.Windows.Forms.Label();
|
|
||||||
this.ctxMenuAppointments = new System.Windows.Forms.ContextMenuStrip(this.components);
|
this.ctxMenuAppointments = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
this.mnuItemReplyAllEmail = new System.Windows.Forms.ToolStripMenuItem();
|
this.mnuItemReplyAllEmail = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.btnRefresh = new System.Windows.Forms.Button();
|
|
||||||
this.panel1 = new System.Windows.Forms.Panel();
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
this.listView1 = new System.Windows.Forms.ListView();
|
this.listView1 = new System.Windows.Forms.ListView();
|
||||||
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.grpRefresh = new System.Windows.Forms.GroupBox();
|
|
||||||
this.chkMailAlerts = new System.Windows.Forms.CheckBox();
|
|
||||||
this.apptCalendar = new Outlook2013TodoAddIn.CustomCalendar();
|
this.apptCalendar = new Outlook2013TodoAddIn.CustomCalendar();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numRangeDays)).BeginInit();
|
|
||||||
this.ctxMenuAppointments.SuspendLayout();
|
this.ctxMenuAppointments.SuspendLayout();
|
||||||
this.panel1.SuspendLayout();
|
this.panel1.SuspendLayout();
|
||||||
this.grpRefresh.SuspendLayout();
|
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// numRangeDays
|
|
||||||
//
|
|
||||||
this.numRangeDays.Location = new System.Drawing.Point(61, 26);
|
|
||||||
this.numRangeDays.Maximum = new decimal(new int[] {
|
|
||||||
30,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0});
|
|
||||||
this.numRangeDays.Minimum = new decimal(new int[] {
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0});
|
|
||||||
this.numRangeDays.Name = "numRangeDays";
|
|
||||||
this.numRangeDays.Size = new System.Drawing.Size(55, 22);
|
|
||||||
this.numRangeDays.TabIndex = 2;
|
|
||||||
this.numRangeDays.Value = new decimal(new int[] {
|
|
||||||
3,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0});
|
|
||||||
this.numRangeDays.ValueChanged += new System.EventHandler(this.numRangeDays_ValueChanged);
|
|
||||||
//
|
|
||||||
// lblRangeDays
|
|
||||||
//
|
|
||||||
this.lblRangeDays.AutoSize = true;
|
|
||||||
this.lblRangeDays.Location = new System.Drawing.Point(11, 28);
|
|
||||||
this.lblRangeDays.Name = "lblRangeDays";
|
|
||||||
this.lblRangeDays.Size = new System.Drawing.Size(44, 17);
|
|
||||||
this.lblRangeDays.TabIndex = 3;
|
|
||||||
this.lblRangeDays.Text = "Days:";
|
|
||||||
//
|
|
||||||
// ctxMenuAppointments
|
// ctxMenuAppointments
|
||||||
//
|
//
|
||||||
this.ctxMenuAppointments.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.ctxMenuAppointments.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
@ -93,21 +54,9 @@
|
|||||||
this.mnuItemReplyAllEmail.Text = "Reply All With Email";
|
this.mnuItemReplyAllEmail.Text = "Reply All With Email";
|
||||||
this.mnuItemReplyAllEmail.Click += new System.EventHandler(this.mnuItemReplyAllEmail_Click);
|
this.mnuItemReplyAllEmail.Click += new System.EventHandler(this.mnuItemReplyAllEmail_Click);
|
||||||
//
|
//
|
||||||
// btnRefresh
|
|
||||||
//
|
|
||||||
this.btnRefresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
|
||||||
this.btnRefresh.Location = new System.Drawing.Point(122, 23);
|
|
||||||
this.btnRefresh.Name = "btnRefresh";
|
|
||||||
this.btnRefresh.Size = new System.Drawing.Size(77, 27);
|
|
||||||
this.btnRefresh.TabIndex = 4;
|
|
||||||
this.btnRefresh.Text = "Refresh";
|
|
||||||
this.btnRefresh.UseVisualStyleBackColor = true;
|
|
||||||
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
|
|
||||||
//
|
|
||||||
// panel1
|
// panel1
|
||||||
//
|
//
|
||||||
this.panel1.Controls.Add(this.listView1);
|
this.panel1.Controls.Add(this.listView1);
|
||||||
this.panel1.Controls.Add(this.grpRefresh);
|
|
||||||
this.panel1.Controls.Add(this.apptCalendar);
|
this.panel1.Controls.Add(this.apptCalendar);
|
||||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||||
@ -125,11 +74,11 @@
|
|||||||
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.listView1.FullRowSelect = true;
|
this.listView1.FullRowSelect = true;
|
||||||
this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
||||||
this.listView1.Location = new System.Drawing.Point(0, 315);
|
this.listView1.Location = new System.Drawing.Point(0, 228);
|
||||||
this.listView1.MultiSelect = false;
|
this.listView1.MultiSelect = false;
|
||||||
this.listView1.Name = "listView1";
|
this.listView1.Name = "listView1";
|
||||||
this.listView1.ShowItemToolTips = true;
|
this.listView1.ShowItemToolTips = true;
|
||||||
this.listView1.Size = new System.Drawing.Size(258, 452);
|
this.listView1.Size = new System.Drawing.Size(258, 539);
|
||||||
this.listView1.TabIndex = 4;
|
this.listView1.TabIndex = 4;
|
||||||
this.listView1.TileSize = new System.Drawing.Size(300, 38);
|
this.listView1.TileSize = new System.Drawing.Size(300, 38);
|
||||||
this.listView1.UseCompatibleStateImageBehavior = false;
|
this.listView1.UseCompatibleStateImageBehavior = false;
|
||||||
@ -146,31 +95,6 @@
|
|||||||
this.columnHeader2.Text = "Subject";
|
this.columnHeader2.Text = "Subject";
|
||||||
this.columnHeader2.Width = 200;
|
this.columnHeader2.Width = 200;
|
||||||
//
|
//
|
||||||
// grpRefresh
|
|
||||||
//
|
|
||||||
this.grpRefresh.Controls.Add(this.chkMailAlerts);
|
|
||||||
this.grpRefresh.Controls.Add(this.btnRefresh);
|
|
||||||
this.grpRefresh.Controls.Add(this.lblRangeDays);
|
|
||||||
this.grpRefresh.Controls.Add(this.numRangeDays);
|
|
||||||
this.grpRefresh.Dock = System.Windows.Forms.DockStyle.Top;
|
|
||||||
this.grpRefresh.Location = new System.Drawing.Point(0, 228);
|
|
||||||
this.grpRefresh.Name = "grpRefresh";
|
|
||||||
this.grpRefresh.Size = new System.Drawing.Size(258, 87);
|
|
||||||
this.grpRefresh.TabIndex = 3;
|
|
||||||
this.grpRefresh.TabStop = false;
|
|
||||||
this.grpRefresh.Text = "Configuration:";
|
|
||||||
//
|
|
||||||
// chkMailAlerts
|
|
||||||
//
|
|
||||||
this.chkMailAlerts.AutoSize = true;
|
|
||||||
this.chkMailAlerts.Location = new System.Drawing.Point(41, 59);
|
|
||||||
this.chkMailAlerts.Name = "chkMailAlerts";
|
|
||||||
this.chkMailAlerts.Size = new System.Drawing.Size(143, 21);
|
|
||||||
this.chkMailAlerts.TabIndex = 5;
|
|
||||||
this.chkMailAlerts.Text = "Enable Mail Alerts";
|
|
||||||
this.chkMailAlerts.UseVisualStyleBackColor = true;
|
|
||||||
this.chkMailAlerts.CheckedChanged += new System.EventHandler(this.chkMailAlerts_CheckedChanged);
|
|
||||||
//
|
|
||||||
// apptCalendar
|
// apptCalendar
|
||||||
//
|
//
|
||||||
this.apptCalendar.BoldedDates = null;
|
this.apptCalendar.BoldedDates = null;
|
||||||
@ -192,6 +116,7 @@
|
|||||||
this.apptCalendar.TodayForeColor = System.Drawing.Color.White;
|
this.apptCalendar.TodayForeColor = System.Drawing.Color.White;
|
||||||
this.apptCalendar.CellDoubleClick += new System.EventHandler(this.apptCalendar_CellDoubleClick);
|
this.apptCalendar.CellDoubleClick += new System.EventHandler(this.apptCalendar_CellDoubleClick);
|
||||||
this.apptCalendar.SelectedDateChanged += new System.EventHandler(this.apptCalendar_SelectedDateChanged);
|
this.apptCalendar.SelectedDateChanged += new System.EventHandler(this.apptCalendar_SelectedDateChanged);
|
||||||
|
this.apptCalendar.ConfigurationButtonClicked += new System.EventHandler(this.apptCalendar_ConfigurationButtonClicked);
|
||||||
//
|
//
|
||||||
// AppointmentsControl
|
// AppointmentsControl
|
||||||
//
|
//
|
||||||
@ -200,29 +125,21 @@
|
|||||||
this.Controls.Add(this.panel1);
|
this.Controls.Add(this.panel1);
|
||||||
this.Name = "AppointmentsControl";
|
this.Name = "AppointmentsControl";
|
||||||
this.Size = new System.Drawing.Size(258, 767);
|
this.Size = new System.Drawing.Size(258, 767);
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numRangeDays)).EndInit();
|
|
||||||
this.ctxMenuAppointments.ResumeLayout(false);
|
this.ctxMenuAppointments.ResumeLayout(false);
|
||||||
this.panel1.ResumeLayout(false);
|
this.panel1.ResumeLayout(false);
|
||||||
this.grpRefresh.ResumeLayout(false);
|
|
||||||
this.grpRefresh.PerformLayout();
|
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.NumericUpDown numRangeDays;
|
|
||||||
private System.Windows.Forms.Label lblRangeDays;
|
|
||||||
private System.Windows.Forms.ContextMenuStrip ctxMenuAppointments;
|
private System.Windows.Forms.ContextMenuStrip ctxMenuAppointments;
|
||||||
private System.Windows.Forms.ToolStripMenuItem mnuItemReplyAllEmail;
|
private System.Windows.Forms.ToolStripMenuItem mnuItemReplyAllEmail;
|
||||||
private System.Windows.Forms.Panel panel1;
|
private System.Windows.Forms.Panel panel1;
|
||||||
private System.Windows.Forms.Button btnRefresh;
|
|
||||||
private CustomCalendar apptCalendar;
|
private CustomCalendar apptCalendar;
|
||||||
private System.Windows.Forms.ListView listView1;
|
private System.Windows.Forms.ListView listView1;
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader1;
|
private System.Windows.Forms.ColumnHeader columnHeader1;
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader2;
|
private System.Windows.Forms.ColumnHeader columnHeader2;
|
||||||
private System.Windows.Forms.GroupBox grpRefresh;
|
|
||||||
private System.Windows.Forms.CheckBox chkMailAlerts;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using Outlook2013TodoAddIn.Forms;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -12,24 +13,21 @@ namespace Outlook2013TodoAddIn
|
|||||||
public partial class AppointmentsControl : UserControl
|
public partial class AppointmentsControl : UserControl
|
||||||
{
|
{
|
||||||
#region "Properties"
|
#region "Properties"
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of days (including today) to retrieve appointments from in the future
|
/// Number of days (including today) to retrieve appointments from in the future
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal NumDays
|
public decimal NumDays { get; set; }
|
||||||
{
|
|
||||||
get { return this.numRangeDays.Value; }
|
|
||||||
set { this.numRangeDays.Value = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets/sets whether mail notifications are enabled or not
|
/// Gets/sets whether mail notifications are enabled or not
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool MailAlertsEnabled
|
public bool MailAlertsEnabled { get; set; }
|
||||||
{
|
|
||||||
get { return this.chkMailAlerts.Checked; }
|
/// <summary>
|
||||||
set { this.chkMailAlerts.Checked = value; }
|
/// Gets/sets whether to show past appointments in the current day or not
|
||||||
}
|
/// </summary>
|
||||||
|
public bool ShowPastAppointments { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets/sets the selected calendar date
|
/// Gets/sets the selected calendar date
|
||||||
@ -50,7 +48,6 @@ namespace Outlook2013TodoAddIn
|
|||||||
public AppointmentsControl()
|
public AppointmentsControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.btnRefresh.FlatAppearance.MouseOverBackColor = this.apptCalendar.HoverBackColor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -64,74 +61,82 @@ namespace Outlook2013TodoAddIn
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Change days to retrieve appointments in the future
|
/// Retrieves tasks for all stores
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender">Sender</param>
|
public void RetrieveTasks()
|
||||||
/// <param name="e">EventArgs</param>
|
|
||||||
private void numRangeDays_ValueChanged(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
Properties.Settings.Default.NumDays = this.numRangeDays.Value;
|
// We want tasks for all the accounts
|
||||||
this.RetrieveAppointments();
|
//foreach (Outlook.Store store in Globals.ThisAddIn.Application.Session.Stores)
|
||||||
|
//{
|
||||||
|
// // Get the Outlook to-do folder to retrieve the items
|
||||||
|
// MessageBox.Show("Store: " + store.DisplayName);
|
||||||
|
// // TODO: try..catch (public folders times out)
|
||||||
|
Outlook.Folder todoFolder =
|
||||||
|
Globals.ThisAddIn.Application.Session.GetDefaultFolder(
|
||||||
|
Outlook.OlDefaultFolders.olFolderToDo)
|
||||||
|
as Outlook.Folder;
|
||||||
|
this.RetrieveTasksForFolder(todoFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Manual refresh
|
/// Retrieves to-do tasks for the folder on the specified store
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender">Sender</param>
|
/// <param name="todoFolder">Outlook folder</param>
|
||||||
/// <param name="e">EventArgs</param>
|
private void RetrieveTasksForFolder(Outlook.Folder todoFolder)
|
||||||
private void btnRefresh_Click(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
this.RetrieveAppointments();
|
foreach (object item in todoFolder.Items)
|
||||||
|
{
|
||||||
|
if (item is Outlook.MailItem)
|
||||||
|
{
|
||||||
|
Outlook.MailItem mail = item as Outlook.MailItem;
|
||||||
|
//mail.Categories
|
||||||
|
//mail.TaskCompletedDate;
|
||||||
|
MessageBox.Show(String.Format("Mail Task: {0}, Due: {1}", mail.TaskSubject, mail.TaskDueDate.ToShortDateString()));
|
||||||
|
}
|
||||||
|
else if (item is Outlook.ContactItem)
|
||||||
|
{
|
||||||
|
Outlook.ContactItem contact = item as Outlook.ContactItem;
|
||||||
|
//contact.Categories
|
||||||
|
//contact.TaskCompletedDate
|
||||||
|
MessageBox.Show(String.Format("Contact Task: {0}, Due: {1}", contact.TaskSubject, contact.TaskDueDate.ToShortDateString()));
|
||||||
|
}
|
||||||
|
else if (item is Outlook.TaskItem)
|
||||||
|
{
|
||||||
|
Outlook.TaskItem task = item as Outlook.TaskItem;
|
||||||
|
//task.Categories
|
||||||
|
//task.DateCompleted
|
||||||
|
MessageBox.Show(String.Format("Task Task: {0}, Due: {1}", task.Subject, task.DueDate.ToShortDateString()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Unknown type");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enables/disables email notifications
|
/// Retrieve all appointments for the current configurations for all stores
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender">Sender</param>
|
|
||||||
/// <param name="e">EventArgs</param>
|
|
||||||
private void chkMailAlerts_CheckedChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Properties.Settings.Default.MailAlertsEnabled = this.chkMailAlerts.Checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve all appointments for the current configurations
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void RetrieveAppointments()
|
public void RetrieveAppointments()
|
||||||
{
|
{
|
||||||
|
//foreach (Outlook.Store store in Globals.ThisAddIn.Application.Session.Stores)
|
||||||
// Get the Outlook folder for the calendar to retrieve the appointments
|
// Get the Outlook folder for the calendar to retrieve the appointments
|
||||||
Outlook.Folder calFolder =
|
Outlook.Folder calFolder =
|
||||||
Globals.ThisAddIn.Application.Session.GetDefaultFolder(
|
Globals.ThisAddIn.Application.Session.GetDefaultFolder(
|
||||||
Outlook.OlDefaultFolders.olFolderCalendar)
|
Outlook.OlDefaultFolders.olFolderCalendar)
|
||||||
as Outlook.Folder;
|
as Outlook.Folder;
|
||||||
|
List<Outlook.AppointmentItem> appts = this.RetrieveAppointmentsForFolder(calFolder);
|
||||||
int selectedMonth = this.apptCalendar.SelectedDate.Month;
|
|
||||||
int selectedYear = this.apptCalendar.SelectedDate.Year;
|
|
||||||
|
|
||||||
// To get all the appointments for the current month (so it displays nicely bolded even for past events)
|
|
||||||
DateTime start = new DateTime(selectedYear, selectedMonth, 1); // MM-01-YYYY
|
|
||||||
DateTime end = start.AddMonths(1).AddDays(-1); // Last day of the month
|
|
||||||
end = end.AddDays((int)this.numRangeDays.Value); // So we get appointments for the "possible" first days of the next month
|
|
||||||
|
|
||||||
// Get all the appointments
|
|
||||||
Outlook.Items rangeAppts = GetAppointmentsInRange(calFolder, start, end);
|
|
||||||
|
|
||||||
// Get a more manageable list
|
|
||||||
List<Outlook.AppointmentItem> appts = new List<Outlook.AppointmentItem>();
|
|
||||||
if (rangeAppts != null)
|
|
||||||
{
|
|
||||||
foreach (Outlook.AppointmentItem appt in rangeAppts)
|
|
||||||
{
|
|
||||||
appts.Add(appt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Highlight dates with appointments in the current calendar
|
// Highlight dates with appointments in the current calendar
|
||||||
this.apptCalendar.BoldedDates = appts.Select<Outlook.AppointmentItem, DateTime>(a => a.Start.Date).Distinct().ToArray();
|
this.apptCalendar.BoldedDates = appts.Select<Outlook.AppointmentItem, DateTime>(a => a.Start.Date).Distinct().ToArray();
|
||||||
|
|
||||||
// Now display the actual appointments below the calendar
|
// Now display the actual appointments below the calendar
|
||||||
DateTime startRange = this.apptCalendar.SelectedDate;
|
DateTime startRange = this.apptCalendar.SelectedDate;
|
||||||
DateTime endRange = startRange.AddDays((int)this.numRangeDays.Value);
|
if (!this.ShowPastAppointments)
|
||||||
|
{
|
||||||
|
startRange = startRange.Add(DateTime.Now.TimeOfDay);
|
||||||
|
}
|
||||||
|
DateTime endRange = startRange.AddDays((int)this.NumDays);
|
||||||
|
|
||||||
// Get items in range
|
// Get items in range
|
||||||
var lstItems = appts.Where(a => a.Start >= startRange && a.Start <= endRange);
|
var lstItems = appts.Where(a => a.Start >= startRange && a.Start <= endRange);
|
||||||
@ -186,6 +191,36 @@ namespace Outlook2013TodoAddIn
|
|||||||
this.apptCalendar.UpdateCalendar();
|
this.apptCalendar.UpdateCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve all appointments for the current configurations for a specific folder
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="calFolder">Outlook folder</param>
|
||||||
|
/// <returns>List of appointments</returns>
|
||||||
|
private List<Outlook.AppointmentItem> RetrieveAppointmentsForFolder(Outlook.Folder calFolder)
|
||||||
|
{
|
||||||
|
int selectedMonth = this.apptCalendar.SelectedDate.Month;
|
||||||
|
int selectedYear = this.apptCalendar.SelectedDate.Year;
|
||||||
|
|
||||||
|
// To get all the appointments for the current month (so it displays nicely bolded even for past events)
|
||||||
|
DateTime start = new DateTime(selectedYear, selectedMonth, 1); // MM-01-YYYY
|
||||||
|
DateTime end = start.AddMonths(1).AddDays(-1); // Last day of the month
|
||||||
|
end = end.AddDays((int)this.NumDays); // So we get appointments for the "possible" first days of the next month
|
||||||
|
|
||||||
|
// Get all the appointments
|
||||||
|
Outlook.Items rangeAppts = GetAppointmentsInRange(calFolder, start, end);
|
||||||
|
|
||||||
|
// Get a more manageable list
|
||||||
|
List<Outlook.AppointmentItem> appts = new List<Outlook.AppointmentItem>();
|
||||||
|
if (rangeAppts != null)
|
||||||
|
{
|
||||||
|
foreach (Outlook.AppointmentItem appt in rangeAppts)
|
||||||
|
{
|
||||||
|
appts.Add(appt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return appts;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get recurring appointments in a date range.
|
/// Get recurring appointments in a date range.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -306,6 +341,25 @@ namespace Outlook2013TodoAddIn
|
|||||||
cv.GoToDate(this.apptCalendar.SelectedDate);
|
cv.GoToDate(this.apptCalendar.SelectedDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// New method to show the configuration form
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">Sender</param>
|
||||||
|
/// <param name="e">EventArgs</param>
|
||||||
|
private void apptCalendar_ConfigurationButtonClicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
using (FormConfiguration cfg = new FormConfiguration())
|
||||||
|
{
|
||||||
|
if (cfg.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
this.NumDays = cfg.NumDays;
|
||||||
|
this.MailAlertsEnabled = cfg.MailAlertsEnabled;
|
||||||
|
this.ShowPastAppointments = cfg.ShowPastAppointments;
|
||||||
|
this.RetrieveAppointments();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion "Methods"
|
#endregion "Methods"
|
||||||
}
|
}
|
||||||
}
|
}
|
26
Outlook2013TodoAddIn/CustomCalendar.Designer.cs
generated
26
Outlook2013TodoAddIn/CustomCalendar.Designer.cs
generated
@ -28,11 +28,14 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
|
this.components = new System.ComponentModel.Container();
|
||||||
this.btnPrevious = new System.Windows.Forms.Button();
|
this.btnPrevious = new System.Windows.Forms.Button();
|
||||||
this.btnNext = new System.Windows.Forms.Button();
|
this.btnNext = new System.Windows.Forms.Button();
|
||||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||||
this.lnkCurrentRange = new System.Windows.Forms.LinkLabel();
|
this.lnkCurrentRange = new System.Windows.Forms.LinkLabel();
|
||||||
this.lnkToday = new System.Windows.Forms.LinkLabel();
|
this.lnkToday = new System.Windows.Forms.LinkLabel();
|
||||||
|
this.btnConfig = new System.Windows.Forms.Button();
|
||||||
|
this.toolTipCalendar = new System.Windows.Forms.ToolTip(this.components);
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// btnPrevious
|
// btnPrevious
|
||||||
@ -44,6 +47,7 @@
|
|||||||
this.btnPrevious.Size = new System.Drawing.Size(31, 23);
|
this.btnPrevious.Size = new System.Drawing.Size(31, 23);
|
||||||
this.btnPrevious.TabIndex = 0;
|
this.btnPrevious.TabIndex = 0;
|
||||||
this.btnPrevious.Text = "<";
|
this.btnPrevious.Text = "<";
|
||||||
|
this.toolTipCalendar.SetToolTip(this.btnPrevious, "Previous month");
|
||||||
this.btnPrevious.UseVisualStyleBackColor = true;
|
this.btnPrevious.UseVisualStyleBackColor = true;
|
||||||
this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click);
|
this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click);
|
||||||
//
|
//
|
||||||
@ -56,6 +60,7 @@
|
|||||||
this.btnNext.Size = new System.Drawing.Size(31, 23);
|
this.btnNext.Size = new System.Drawing.Size(31, 23);
|
||||||
this.btnNext.TabIndex = 2;
|
this.btnNext.TabIndex = 2;
|
||||||
this.btnNext.Text = ">";
|
this.btnNext.Text = ">";
|
||||||
|
this.toolTipCalendar.SetToolTip(this.btnNext, "Next month");
|
||||||
this.btnNext.UseVisualStyleBackColor = true;
|
this.btnNext.UseVisualStyleBackColor = true;
|
||||||
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
|
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
|
||||||
//
|
//
|
||||||
@ -97,19 +102,34 @@
|
|||||||
// lnkToday
|
// lnkToday
|
||||||
//
|
//
|
||||||
this.lnkToday.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
|
this.lnkToday.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
|
||||||
this.lnkToday.Location = new System.Drawing.Point(9, 196);
|
this.lnkToday.Location = new System.Drawing.Point(40, 196);
|
||||||
this.lnkToday.Name = "lnkToday";
|
this.lnkToday.Name = "lnkToday";
|
||||||
this.lnkToday.Size = new System.Drawing.Size(234, 23);
|
this.lnkToday.Size = new System.Drawing.Size(166, 23);
|
||||||
this.lnkToday.TabIndex = 4;
|
this.lnkToday.TabIndex = 4;
|
||||||
this.lnkToday.TabStop = true;
|
this.lnkToday.TabStop = true;
|
||||||
this.lnkToday.Text = "lnkToday";
|
this.lnkToday.Text = "lnkToday";
|
||||||
this.lnkToday.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
this.lnkToday.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
|
this.toolTipCalendar.SetToolTip(this.lnkToday, "Refresh today\'s appointments");
|
||||||
this.lnkToday.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkToday_LinkClicked);
|
this.lnkToday.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkToday_LinkClicked);
|
||||||
//
|
//
|
||||||
|
// btnConfig
|
||||||
|
//
|
||||||
|
this.btnConfig.BackgroundImage = global::Outlook2013TodoAddIn.Properties.Resources.gear;
|
||||||
|
this.btnConfig.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||||
|
this.btnConfig.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.btnConfig.Location = new System.Drawing.Point(219, 198);
|
||||||
|
this.btnConfig.Name = "btnConfig";
|
||||||
|
this.btnConfig.Size = new System.Drawing.Size(24, 24);
|
||||||
|
this.btnConfig.TabIndex = 5;
|
||||||
|
this.toolTipCalendar.SetToolTip(this.btnConfig, "Configuration");
|
||||||
|
this.btnConfig.UseVisualStyleBackColor = true;
|
||||||
|
this.btnConfig.Click += new System.EventHandler(this.btnConfig_Click);
|
||||||
|
//
|
||||||
// CustomCalendar
|
// CustomCalendar
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Controls.Add(this.btnConfig);
|
||||||
this.Controls.Add(this.lnkToday);
|
this.Controls.Add(this.lnkToday);
|
||||||
this.Controls.Add(this.lnkCurrentRange);
|
this.Controls.Add(this.lnkCurrentRange);
|
||||||
this.Controls.Add(this.tableLayoutPanel1);
|
this.Controls.Add(this.tableLayoutPanel1);
|
||||||
@ -130,5 +150,7 @@
|
|||||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||||
private System.Windows.Forms.LinkLabel lnkCurrentRange;
|
private System.Windows.Forms.LinkLabel lnkCurrentRange;
|
||||||
private System.Windows.Forms.LinkLabel lnkToday;
|
private System.Windows.Forms.LinkLabel lnkToday;
|
||||||
|
private System.Windows.Forms.Button btnConfig;
|
||||||
|
private System.Windows.Forms.ToolTip toolTipCalendar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,6 +168,7 @@ namespace Outlook2013TodoAddIn
|
|||||||
|
|
||||||
this.btnPrevious.FlatAppearance.MouseOverBackColor = this.HoverBackColor;
|
this.btnPrevious.FlatAppearance.MouseOverBackColor = this.HoverBackColor;
|
||||||
this.btnNext.FlatAppearance.MouseOverBackColor = this.HoverBackColor;
|
this.btnNext.FlatAppearance.MouseOverBackColor = this.HoverBackColor;
|
||||||
|
this.btnConfig.FlatAppearance.MouseOverBackColor = this.HoverBackColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -504,6 +505,20 @@ namespace Outlook2013TodoAddIn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event handler to subscribe to
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler ConfigurationButtonClicked;
|
||||||
|
|
||||||
|
private void btnConfig_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
EventHandler handler = ConfigurationButtonClicked;
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Select today's date in the calendar
|
/// Select today's date in the calendar
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -117,4 +117,7 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<metadata name="toolTipCalendar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
</root>
|
</root>
|
148
Outlook2013TodoAddIn/Forms/FormConfiguration.Designer.cs
generated
Normal file
148
Outlook2013TodoAddIn/Forms/FormConfiguration.Designer.cs
generated
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
namespace Outlook2013TodoAddIn.Forms
|
||||||
|
{
|
||||||
|
partial class FormConfiguration
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.chkMailAlerts = new System.Windows.Forms.CheckBox();
|
||||||
|
this.lblRangeDays = new System.Windows.Forms.Label();
|
||||||
|
this.numRangeDays = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.btnCancel = new System.Windows.Forms.Button();
|
||||||
|
this.btnOK = new System.Windows.Forms.Button();
|
||||||
|
this.chkShowPastAppointments = new System.Windows.Forms.CheckBox();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.numRangeDays)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// chkMailAlerts
|
||||||
|
//
|
||||||
|
this.chkMailAlerts.AutoSize = true;
|
||||||
|
this.chkMailAlerts.Location = new System.Drawing.Point(59, 134);
|
||||||
|
this.chkMailAlerts.Name = "chkMailAlerts";
|
||||||
|
this.chkMailAlerts.Size = new System.Drawing.Size(143, 21);
|
||||||
|
this.chkMailAlerts.TabIndex = 8;
|
||||||
|
this.chkMailAlerts.Text = "Enable Mail Alerts";
|
||||||
|
this.chkMailAlerts.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// lblRangeDays
|
||||||
|
//
|
||||||
|
this.lblRangeDays.AutoSize = true;
|
||||||
|
this.lblRangeDays.Location = new System.Drawing.Point(55, 60);
|
||||||
|
this.lblRangeDays.Name = "lblRangeDays";
|
||||||
|
this.lblRangeDays.Size = new System.Drawing.Size(44, 17);
|
||||||
|
this.lblRangeDays.TabIndex = 7;
|
||||||
|
this.lblRangeDays.Text = "Days:";
|
||||||
|
//
|
||||||
|
// numRangeDays
|
||||||
|
//
|
||||||
|
this.numRangeDays.Location = new System.Drawing.Point(115, 58);
|
||||||
|
this.numRangeDays.Maximum = new decimal(new int[] {
|
||||||
|
30,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.numRangeDays.Minimum = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.numRangeDays.Name = "numRangeDays";
|
||||||
|
this.numRangeDays.Size = new System.Drawing.Size(55, 22);
|
||||||
|
this.numRangeDays.TabIndex = 6;
|
||||||
|
this.numRangeDays.Value = new decimal(new int[] {
|
||||||
|
3,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
//
|
||||||
|
// btnCancel
|
||||||
|
//
|
||||||
|
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
this.btnCancel.Location = new System.Drawing.Point(169, 181);
|
||||||
|
this.btnCancel.Name = "btnCancel";
|
||||||
|
this.btnCancel.Size = new System.Drawing.Size(87, 37);
|
||||||
|
this.btnCancel.TabIndex = 11;
|
||||||
|
this.btnCancel.Text = "Cancel";
|
||||||
|
this.btnCancel.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// btnOK
|
||||||
|
//
|
||||||
|
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||||
|
this.btnOK.Location = new System.Drawing.Point(27, 181);
|
||||||
|
this.btnOK.Name = "btnOK";
|
||||||
|
this.btnOK.Size = new System.Drawing.Size(87, 37);
|
||||||
|
this.btnOK.TabIndex = 10;
|
||||||
|
this.btnOK.Text = "OK";
|
||||||
|
this.btnOK.UseVisualStyleBackColor = true;
|
||||||
|
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||||
|
//
|
||||||
|
// chkShowPastAppointments
|
||||||
|
//
|
||||||
|
this.chkShowPastAppointments.AutoSize = true;
|
||||||
|
this.chkShowPastAppointments.Location = new System.Drawing.Point(59, 98);
|
||||||
|
this.chkShowPastAppointments.Name = "chkShowPastAppointments";
|
||||||
|
this.chkShowPastAppointments.Size = new System.Drawing.Size(186, 21);
|
||||||
|
this.chkShowPastAppointments.TabIndex = 12;
|
||||||
|
this.chkShowPastAppointments.Text = "Show Past Appointments";
|
||||||
|
this.chkShowPastAppointments.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// FormConfiguration
|
||||||
|
//
|
||||||
|
this.AcceptButton = this.btnOK;
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.CancelButton = this.btnCancel;
|
||||||
|
this.ClientSize = new System.Drawing.Size(282, 253);
|
||||||
|
this.Controls.Add(this.chkShowPastAppointments);
|
||||||
|
this.Controls.Add(this.btnCancel);
|
||||||
|
this.Controls.Add(this.btnOK);
|
||||||
|
this.Controls.Add(this.chkMailAlerts);
|
||||||
|
this.Controls.Add(this.lblRangeDays);
|
||||||
|
this.Controls.Add(this.numRangeDays);
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "FormConfiguration";
|
||||||
|
this.ShowIcon = false;
|
||||||
|
this.ShowInTaskbar = false;
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Configuration";
|
||||||
|
this.Load += new System.EventHandler(this.FormConfiguration_Load);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.numRangeDays)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.CheckBox chkMailAlerts;
|
||||||
|
private System.Windows.Forms.Label lblRangeDays;
|
||||||
|
private System.Windows.Forms.NumericUpDown numRangeDays;
|
||||||
|
private System.Windows.Forms.Button btnCancel;
|
||||||
|
private System.Windows.Forms.Button btnOK;
|
||||||
|
private System.Windows.Forms.CheckBox chkShowPastAppointments;
|
||||||
|
}
|
||||||
|
}
|
81
Outlook2013TodoAddIn/Forms/FormConfiguration.cs
Normal file
81
Outlook2013TodoAddIn/Forms/FormConfiguration.cs
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Outlook2013TodoAddIn.Forms
|
||||||
|
{
|
||||||
|
public partial class FormConfiguration : Form
|
||||||
|
{
|
||||||
|
#region "Properties"
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of days (including today) to retrieve appointments from in the future
|
||||||
|
/// </summary>
|
||||||
|
public decimal NumDays
|
||||||
|
{
|
||||||
|
get { return this.numRangeDays.Value; }
|
||||||
|
set { this.numRangeDays.Value = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets/sets whether mail notifications are enabled or not
|
||||||
|
/// </summary>
|
||||||
|
public bool MailAlertsEnabled
|
||||||
|
{
|
||||||
|
get { return this.chkMailAlerts.Checked; }
|
||||||
|
set { this.chkMailAlerts.Checked = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets/sets whether to show past appointments in the current day or not
|
||||||
|
/// </summary>
|
||||||
|
public bool ShowPastAppointments
|
||||||
|
{
|
||||||
|
get { return this.chkShowPastAppointments.Checked; }
|
||||||
|
set { this.chkShowPastAppointments.Checked = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion "Properties"
|
||||||
|
|
||||||
|
#region "Methods"
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor
|
||||||
|
/// </summary>
|
||||||
|
public FormConfiguration()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On load, display saved configuration
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">Sender</param>
|
||||||
|
/// <param name="e">EventArgs</param>
|
||||||
|
private void FormConfiguration_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.numRangeDays.Value = Properties.Settings.Default.NumDays;
|
||||||
|
this.chkMailAlerts.Checked = Properties.Settings.Default.MailAlertsEnabled;
|
||||||
|
this.chkShowPastAppointments.Checked = Properties.Settings.Default.ShowPastAppointments;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clicking the OK button
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">Sender</param>
|
||||||
|
/// <param name="e">EventArgs</param>
|
||||||
|
private void btnOK_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Properties.Settings.Default.NumDays = this.numRangeDays.Value;
|
||||||
|
Properties.Settings.Default.MailAlertsEnabled = this.chkMailAlerts.Checked;
|
||||||
|
Properties.Settings.Default.ShowPastAppointments = this.chkShowPastAppointments.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion "Methods"
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
namespace Outlook2013TodoAddIn
|
namespace Outlook2013TodoAddIn.Forms
|
||||||
{
|
{
|
||||||
partial class FormRecurringOpen
|
partial class FormRecurringOpen
|
||||||
{
|
{
|
@ -1,6 +1,6 @@
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Outlook2013TodoAddIn
|
namespace Outlook2013TodoAddIn.Forms
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Mimic Outlook's popup to open one instance or the whole series
|
/// Mimic Outlook's popup to open one instance or the whole series
|
@ -1,4 +1,4 @@
|
|||||||
namespace Outlook2013TodoAddIn
|
namespace Outlook2013TodoAddIn.Forms
|
||||||
{
|
{
|
||||||
partial class NewMailAlert
|
partial class NewMailAlert
|
||||||
{
|
{
|
@ -9,7 +9,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Outlook2013TodoAddIn
|
namespace Outlook2013TodoAddIn.Forms
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// New form to display new emai lnotifications
|
/// New form to display new emai lnotifications
|
120
Outlook2013TodoAddIn/Forms/NewMailAlert.resx
Normal file
120
Outlook2013TodoAddIn/Forms/NewMailAlert.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
BIN
Outlook2013TodoAddIn/Images/gear.png
Normal file
BIN
Outlook2013TodoAddIn/Images/gear.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
@ -189,16 +189,22 @@
|
|||||||
<Compile Include="CustomCalendar.Designer.cs">
|
<Compile Include="CustomCalendar.Designer.cs">
|
||||||
<DependentUpon>CustomCalendar.cs</DependentUpon>
|
<DependentUpon>CustomCalendar.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="FormRecurringOpen.cs">
|
<Compile Include="Forms\FormConfiguration.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="FormRecurringOpen.Designer.cs">
|
<Compile Include="Forms\FormConfiguration.Designer.cs">
|
||||||
|
<DependentUpon>FormConfiguration.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Forms\FormRecurringOpen.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Forms\FormRecurringOpen.Designer.cs">
|
||||||
<DependentUpon>FormRecurringOpen.cs</DependentUpon>
|
<DependentUpon>FormRecurringOpen.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="NewMailAlert.cs">
|
<Compile Include="Forms\NewMailAlert.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="NewMailAlert.Designer.cs">
|
<Compile Include="Forms\NewMailAlert.Designer.cs">
|
||||||
<DependentUpon>NewMailAlert.cs</DependentUpon>
|
<DependentUpon>NewMailAlert.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="OutlookHelper.cs" />
|
<Compile Include="OutlookHelper.cs" />
|
||||||
@ -221,10 +227,13 @@
|
|||||||
<EmbeddedResource Include="CustomCalendar.resx">
|
<EmbeddedResource Include="CustomCalendar.resx">
|
||||||
<DependentUpon>CustomCalendar.cs</DependentUpon>
|
<DependentUpon>CustomCalendar.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="FormRecurringOpen.resx">
|
<EmbeddedResource Include="Forms\FormConfiguration.resx">
|
||||||
|
<DependentUpon>FormConfiguration.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Forms\FormRecurringOpen.resx">
|
||||||
<DependentUpon>FormRecurringOpen.cs</DependentUpon>
|
<DependentUpon>FormRecurringOpen.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="NewMailAlert.resx">
|
<EmbeddedResource Include="Forms\NewMailAlert.resx">
|
||||||
<DependentUpon>NewMailAlert.cs</DependentUpon>
|
<DependentUpon>NewMailAlert.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
@ -277,6 +286,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Images\Envelope.png" />
|
<None Include="Images\Envelope.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Images\gear.png" />
|
||||||
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.18033
|
// Runtime Version:4.0.30319.18046
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
@ -90,6 +90,16 @@ namespace Outlook2013TodoAddIn.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap gear {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("gear", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -127,6 +127,9 @@
|
|||||||
<data name="Flag" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="Flag" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Images\Flag.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Images\Flag.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="gear" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\images\gear.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
<data name="todoIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="todoIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Images\2012-11-20_1546.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Images\2012-11-20_1546.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
14
Outlook2013TodoAddIn/Properties/Settings.Designer.cs
generated
14
Outlook2013TodoAddIn/Properties/Settings.Designer.cs
generated
@ -1,7 +1,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.18033
|
// Runtime Version:4.0.30319.18046
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
@ -82,5 +82,17 @@ namespace Outlook2013TodoAddIn.Properties {
|
|||||||
this["MailAlertsEnabled"] = value;
|
this["MailAlertsEnabled"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
|
public bool ShowPastAppointments {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["ShowPastAppointments"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["ShowPastAppointments"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,5 +17,8 @@
|
|||||||
<Setting Name="MailAlertsEnabled" Type="System.Boolean" Scope="User">
|
<Setting Name="MailAlertsEnabled" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="ShowPastAppointments" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">True</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
using Outlook2013TodoAddIn.Forms;
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -40,6 +41,7 @@ namespace Outlook2013TodoAddIn
|
|||||||
|
|
||||||
this.AppControl = new AppointmentsControl();
|
this.AppControl = new AppointmentsControl();
|
||||||
this.AppControl.MailAlertsEnabled = Properties.Settings.Default.MailAlertsEnabled;
|
this.AppControl.MailAlertsEnabled = Properties.Settings.Default.MailAlertsEnabled;
|
||||||
|
this.AppControl.ShowPastAppointments = Properties.Settings.Default.ShowPastAppointments;
|
||||||
this.AppControl.NumDays = Properties.Settings.Default.NumDays; // Setting the value will load the appointments
|
this.AppControl.NumDays = Properties.Settings.Default.NumDays; // Setting the value will load the appointments
|
||||||
|
|
||||||
ToDoTaskPane = this.CustomTaskPanes.Add(this.AppControl, "Appointments");
|
ToDoTaskPane = this.CustomTaskPanes.Add(this.AppControl, "Appointments");
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
<setting name="MailAlertsEnabled" serializeAs="String">
|
<setting name="MailAlertsEnabled" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="ShowPastAppointments" serializeAs="String">
|
||||||
|
<value>True</value>
|
||||||
|
</setting>
|
||||||
</Outlook2013TodoAddIn.Properties.Settings>
|
</Outlook2013TodoAddIn.Properties.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||||
|
Loading…
Reference in New Issue
Block a user