From 2ac3c5046eaaab246a2d734449dda86d1b5e694d Mon Sep 17 00:00:00 2001 From: gamosoft_cp Date: Fri, 29 Mar 2013 16:00:07 +0000 Subject: [PATCH] --- Outlook2013TodoAddIn.sln | 20 ++ Outlook2013TodoAddIn/2012-11-20_1546.png | Bin 0 -> 321 bytes .../AppointmentsControl.Designer.cs | 201 ++++++++++++ Outlook2013TodoAddIn/AppointmentsControl.cs | 265 ++++++++++++++++ Outlook2013TodoAddIn/AppointmentsControl.resx | 123 ++++++++ .../FormRecurringOpen.Designer.cs | 121 ++++++++ Outlook2013TodoAddIn/FormRecurringOpen.cs | 22 ++ Outlook2013TodoAddIn/FormRecurringOpen.resx | 120 ++++++++ .../ManageTaskPaneRibbon.resx | 120 ++++++++ .../Outlook2013TodoAddIn.csproj | 274 +++++++++++++++++ .../Outlook2013TodoAddIn_TemporaryKey.pfx | Bin 0 -> 1732 bytes .../Properties/AssemblyInfo.cs | 35 +++ .../Properties/Resources.Designer.cs | 73 +++++ .../Properties/Resources.resx | 124 ++++++++ .../Properties/Settings.Designer.cs | 62 ++++ .../Properties/Settings.settings | 15 + Outlook2013TodoAddIn/ThisAddIn.Designer.cs | 286 ++++++++++++++++++ Outlook2013TodoAddIn/ThisAddIn.Designer.xml | 4 + Outlook2013TodoAddIn/ThisAddIn.cs | 133 ++++++++ .../TodoRibbonAddIn.Designer.cs | 92 ++++++ Outlook2013TodoAddIn/TodoRibbonAddIn.cs | 16 + Outlook2013TodoAddIn/TodoRibbonAddIn.resx | 120 ++++++++ Outlook2013TodoAddIn/app.config | 21 ++ 23 files changed, 2247 insertions(+) create mode 100644 Outlook2013TodoAddIn.sln create mode 100644 Outlook2013TodoAddIn/2012-11-20_1546.png create mode 100644 Outlook2013TodoAddIn/AppointmentsControl.Designer.cs create mode 100644 Outlook2013TodoAddIn/AppointmentsControl.cs create mode 100644 Outlook2013TodoAddIn/AppointmentsControl.resx create mode 100644 Outlook2013TodoAddIn/FormRecurringOpen.Designer.cs create mode 100644 Outlook2013TodoAddIn/FormRecurringOpen.cs create mode 100644 Outlook2013TodoAddIn/FormRecurringOpen.resx create mode 100644 Outlook2013TodoAddIn/ManageTaskPaneRibbon.resx create mode 100644 Outlook2013TodoAddIn/Outlook2013TodoAddIn.csproj create mode 100644 Outlook2013TodoAddIn/Outlook2013TodoAddIn_TemporaryKey.pfx create mode 100644 Outlook2013TodoAddIn/Properties/AssemblyInfo.cs create mode 100644 Outlook2013TodoAddIn/Properties/Resources.Designer.cs create mode 100644 Outlook2013TodoAddIn/Properties/Resources.resx create mode 100644 Outlook2013TodoAddIn/Properties/Settings.Designer.cs create mode 100644 Outlook2013TodoAddIn/Properties/Settings.settings create mode 100644 Outlook2013TodoAddIn/ThisAddIn.Designer.cs create mode 100644 Outlook2013TodoAddIn/ThisAddIn.Designer.xml create mode 100644 Outlook2013TodoAddIn/ThisAddIn.cs create mode 100644 Outlook2013TodoAddIn/TodoRibbonAddIn.Designer.cs create mode 100644 Outlook2013TodoAddIn/TodoRibbonAddIn.cs create mode 100644 Outlook2013TodoAddIn/TodoRibbonAddIn.resx create mode 100644 Outlook2013TodoAddIn/app.config diff --git a/Outlook2013TodoAddIn.sln b/Outlook2013TodoAddIn.sln new file mode 100644 index 0000000..48e3e30 --- /dev/null +++ b/Outlook2013TodoAddIn.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Outlook2013TodoAddIn", "Outlook2013TodoAddIn\Outlook2013TodoAddIn.csproj", "{EF0CD4A2-56E1-4C98-BE40-ED2D969F16A8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EF0CD4A2-56E1-4C98-BE40-ED2D969F16A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF0CD4A2-56E1-4C98-BE40-ED2D969F16A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF0CD4A2-56E1-4C98-BE40-ED2D969F16A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF0CD4A2-56E1-4C98-BE40-ED2D969F16A8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Outlook2013TodoAddIn/2012-11-20_1546.png b/Outlook2013TodoAddIn/2012-11-20_1546.png new file mode 100644 index 0000000000000000000000000000000000000000..0d908990c069678af718a63fb82300ae6c0b6aef GIT binary patch literal 321 zcmeAS@N?(olHy`uVBq!ia0vp^@<1%h!2~4lvM8hiDVB6cUq=Rpjs4tz5?O(K&H|6f zVg?4jLm+Kv#0z`Pk1hFcp$ZGjZyOMU!|HEZ#2G@h`PPH@^3IzGJU| P9%1lw^>bP0l+XkKvm1X0 literal 0 HcmV?d00001 diff --git a/Outlook2013TodoAddIn/AppointmentsControl.Designer.cs b/Outlook2013TodoAddIn/AppointmentsControl.Designer.cs new file mode 100644 index 0000000..2cbedcf --- /dev/null +++ b/Outlook2013TodoAddIn/AppointmentsControl.Designer.cs @@ -0,0 +1,201 @@ +namespace Outlook2013TodoAddIn +{ + partial class AppointmentsControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.numRangeDays = new System.Windows.Forms.NumericUpDown(); + this.lblRangeDays = new System.Windows.Forms.Label(); + this.apptCalendar = new System.Windows.Forms.MonthCalendar(); + this.ctxMenuAppointments = new System.Windows.Forms.ContextMenuStrip(this.components); + this.mnuItemReplyAllEmail = new System.Windows.Forms.ToolStripMenuItem(); + this.hdrDate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.hdrSubject = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.listView1 = new System.Windows.Forms.ListView(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.btnRefresh = new System.Windows.Forms.Button(); + this.panel1 = new System.Windows.Forms.Panel(); + ((System.ComponentModel.ISupportInitialize)(this.numRangeDays)).BeginInit(); + this.ctxMenuAppointments.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // numRangeDays + // + this.numRangeDays.Location = new System.Drawing.Point(60, 21); + this.numRangeDays.Maximum = new decimal(new int[] { + 15, + 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(10, 23); + this.lblRangeDays.Name = "lblRangeDays"; + this.lblRangeDays.Size = new System.Drawing.Size(44, 17); + this.lblRangeDays.TabIndex = 3; + this.lblRangeDays.Text = "Days:"; + // + // apptCalendar + // + this.apptCalendar.Dock = System.Windows.Forms.DockStyle.Top; + this.apptCalendar.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.apptCalendar.Location = new System.Drawing.Point(0, 0); + this.apptCalendar.MaxSelectionCount = 1; + this.apptCalendar.Name = "apptCalendar"; + this.apptCalendar.TabIndex = 4; + this.apptCalendar.DateChanged += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar1_DateChanged); + // + // ctxMenuAppointments + // + this.ctxMenuAppointments.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mnuItemReplyAllEmail}); + this.ctxMenuAppointments.Name = "ctxMenuAppointments"; + this.ctxMenuAppointments.Size = new System.Drawing.Size(214, 28); + // + // mnuItemReplyAllEmail + // + this.mnuItemReplyAllEmail.Name = "mnuItemReplyAllEmail"; + this.mnuItemReplyAllEmail.Size = new System.Drawing.Size(213, 24); + this.mnuItemReplyAllEmail.Text = "Reply All With Email"; + this.mnuItemReplyAllEmail.Click += new System.EventHandler(this.mnuItemReplyAllEmail_Click); + // + // hdrDate + // + this.hdrDate.Text = "Date"; + this.hdrDate.Width = 78; + // + // hdrSubject + // + this.hdrSubject.Text = "Subject"; + this.hdrSubject.Width = 163; + // + // listView1 + // + this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.hdrDate, + this.hdrSubject}); + this.listView1.ContextMenuStrip = this.ctxMenuAppointments; + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.Font = new System.Drawing.Font("Calibri", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.listView1.FullRowSelect = true; + this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.MultiSelect = false; + this.listView1.Name = "listView1"; + this.listView1.ShowItemToolTips = true; + this.listView1.Size = new System.Drawing.Size(289, 507); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.DoubleClick += new System.EventHandler(this.listView1_DoubleClick); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.btnRefresh); + this.groupBox1.Controls.Add(this.lblRangeDays); + this.groupBox1.Controls.Add(this.numRangeDays); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top; + this.groupBox1.Location = new System.Drawing.Point(0, 207); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(289, 53); + this.groupBox1.TabIndex = 7; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Days:"; + // + // btnRefresh + // + this.btnRefresh.Location = new System.Drawing.Point(162, 20); + this.btnRefresh.Name = "btnRefresh"; + this.btnRefresh.Size = new System.Drawing.Size(75, 23); + this.btnRefresh.TabIndex = 4; + this.btnRefresh.Text = "Refresh"; + this.btnRefresh.UseVisualStyleBackColor = true; + this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click); + // + // panel1 + // + this.panel1.Controls.Add(this.listView1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 260); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(289, 507); + this.panel1.TabIndex = 8; + // + // AppointmentsControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.panel1); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.apptCalendar); + this.Name = "AppointmentsControl"; + this.Size = new System.Drawing.Size(289, 767); + ((System.ComponentModel.ISupportInitialize)(this.numRangeDays)).EndInit(); + this.ctxMenuAppointments.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.NumericUpDown numRangeDays; + private System.Windows.Forms.Label lblRangeDays; + private System.Windows.Forms.MonthCalendar apptCalendar; + private System.Windows.Forms.ContextMenuStrip ctxMenuAppointments; + private System.Windows.Forms.ToolStripMenuItem mnuItemReplyAllEmail; + private System.Windows.Forms.ColumnHeader hdrDate; + private System.Windows.Forms.ColumnHeader hdrSubject; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btnRefresh; + + + } +} diff --git a/Outlook2013TodoAddIn/AppointmentsControl.cs b/Outlook2013TodoAddIn/AppointmentsControl.cs new file mode 100644 index 0000000..9cdbd68 --- /dev/null +++ b/Outlook2013TodoAddIn/AppointmentsControl.cs @@ -0,0 +1,265 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; +using Outlook = Microsoft.Office.Interop.Outlook; + +namespace Outlook2013TodoAddIn +{ + public partial class AppointmentsControl : UserControl + { + private const string PR_SMTP_ADDRESS = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"; + + public decimal NumDays + { + get + { + return this.numRangeDays.Value; + } + set + { + this.numRangeDays.Value = value; + } + } + + public AppointmentsControl() + { + InitializeComponent(); + + //(this.apptCalendar as Control).SetStyle(); + //(this.apptCalendar as Control).DoubleClick += AppointmentsControl_DoubleClick; + // ShowScrollBar(this.listView1.Handle.ToInt64(), SB_HORZ, 0); + } + + //[DllImport("user32")] + //private static extern long ShowScrollBar(long hwnd, long wBar, long bShow); + //long SB_HORZ = 0; + //long SB_VERT = 1; + //long SB_BOTH = 3; + + //void AppointmentsControl_DoubleClick(object sender, EventArgs e) + //{ + // MessageBox.Show("Test"); + //} + + private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e) + { + this.RetrieveAppointments(); + } + + private void numRangeDays_ValueChanged(object sender, EventArgs e) + { + Properties.Settings.Default.NumDays = this.numRangeDays.Value; + this.RetrieveAppointments(); + } + + private void btnRefresh_Click(object sender, EventArgs e) + { + this.RetrieveAppointments(); + } + + public void RetrieveAppointments() + { + // Get the Outlook folder for the calendar to retrieve the appointments + Outlook.Folder calFolder = + Globals.ThisAddIn.Application.Session.GetDefaultFolder( + Outlook.OlDefaultFolders.olFolderCalendar) + as Outlook.Folder; + + int selectedMonth = this.apptCalendar.SelectionStart.Month; + int selectedYear = this.apptCalendar.SelectionStart.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 appts = new List(); + if (rangeAppts != null) + { + foreach (Outlook.AppointmentItem appt in rangeAppts) + { + appts.Add(appt); + } + } + + // Highlight dates with appointments in the current calendar + this.apptCalendar.BoldedDates = appts.Select(a => a.Start).ToArray(); + + // Now display the actual appointments below the calendar + DateTime startRange = this.apptCalendar.SelectionStart; + DateTime endRange = startRange.AddDays((int)this.numRangeDays.Value); + + // Get items in range + var lstItems = appts.Where(a => a.Start >= startRange && a.Start <= endRange); + + int sameDay = -1; // startRange.Day; + + List lstCol = new List(); + lstItems.ToList().ForEach(i => + { + if (i.Start.Day != sameDay) + { + ListViewItem dateItem = new ListViewItem() { Text = i.Start.ToShortDateString() }; + dateItem.Font = new Font(this.listView1.Font, FontStyle.Bold); + lstCol.Add(dateItem); + sameDay = i.Start.Day; + }; + + ListViewItem current = new ListViewItem() { Text = i.Start.ToShortTimeString() }; + current.SubItems.Add(i.Subject); + + // current.SubItems.Add(i.Location); + current.ToolTipText = String.Format("{0} - {1} {2}", i.Start.ToShortTimeString(), i.End.ToShortTimeString(), i.Subject); + current.Tag = i; + + switch (i.BusyStatus) + { + case Outlook.OlBusyStatus.olBusy: + current.ForeColor = Color.Purple; + break; + + case Outlook.OlBusyStatus.olFree: + break; + + case Outlook.OlBusyStatus.olOutOfOffice: + current.ForeColor = Color.Brown; + break; + + case Outlook.OlBusyStatus.olTentative: + break; + + case Outlook.OlBusyStatus.olWorkingElsewhere: + break; + + default: + break; + } + + lstCol.Add(current); + + // Add location into a new line (if available) + if (!String.IsNullOrEmpty(i.Location)) + { + ListViewItem locationItem = new ListViewItem() { Text = String.Empty }; + locationItem.SubItems.Add(i.Location); + locationItem.ForeColor = current.ForeColor; + locationItem.Tag = i; + lstCol.Add(locationItem); + } + }); + + this.listView1.Items.Clear(); + this.listView1.Items.AddRange(lstCol.ToArray()); + } + + /// + /// Get recurring appointments in date range. + /// + /// + /// + /// + /// Outlook.Items + private Outlook.Items GetAppointmentsInRange(Outlook.Folder folder, DateTime startTime, DateTime endTime) + { + string filter = "[Start] >= '" + + startTime.ToString("g") + + "' AND [End] <= '" + + endTime.ToString("g") + "'"; + + try + { + Outlook.Items calItems = folder.Items; + calItems.IncludeRecurrences = true; + calItems.Sort("[Start]", Type.Missing); + Outlook.Items restrictItems = calItems.Restrict(filter); + if (restrictItems.Count > 0) + { + return restrictItems; + } + else + { + return null; + } + } + catch { return null; } + } + + private void listView1_DoubleClick(object sender, EventArgs e) + { + if (this.listView1.SelectedIndices.Count != 0) + { + Outlook.AppointmentItem appt = this.listView1.SelectedItems[0].Tag as Outlook.AppointmentItem; + if (appt != null) + { + if (appt.IsRecurring) + { + FormRecurringOpen f = new FormRecurringOpen(); + if (f.ShowDialog() == DialogResult.OK) + { + if (f.OpenRecurring) + { + // Open up the master appointment in a new window + // If we open the current instance then there is an error: "This item is no longer valid because it has been closed" + // One workaround is to refresh the appointments list to get new instances... + Outlook.AppointmentItem masterAppt = appt.Parent; // Get the master appointment item + masterAppt.Display(true); // Will modify ALL instances + } + else + { + // Open up the appointment in a new window + appt.Display(true); // Modal yes/no + } + } + } + else + { + // Open up the appointment in a new window + appt.Display(true); // Modal yes/no + } + + // At the end, synchronously "refresh" items in case they have changed + this.RetrieveAppointments(); + } + } + } + + private void mnuItemReplyAllEmail_Click(object sender, EventArgs e) + { + if (this.listView1.SelectedIndices.Count != 0) + { + Outlook.AppointmentItem appt = this.listView1.SelectedItems[0].Tag as Outlook.AppointmentItem; + if (appt != null) + { + Outlook.MailItem mail = Globals.ThisAddIn.Application.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem; + + string curUserAddress = GetEmailAddress(Globals.ThisAddIn.Application.Session.CurrentUser); + foreach (Outlook.Recipient rcpt in appt.Recipients) + { + string smtpAddress = GetEmailAddress(rcpt); + if (curUserAddress != smtpAddress) + { + mail.Recipients.Add(smtpAddress); + + //mail.Recipients.Add(rcpt.AddressEntry.Name); + } + } + mail.Body = Environment.NewLine + Environment.NewLine + appt.Body; + mail.Subject = "RE: " + appt.Subject; + mail.Display(); + } + } + } + + private string GetEmailAddress(Outlook.Recipient rcpt) + { + Outlook.PropertyAccessor pa = rcpt.PropertyAccessor; + return pa.GetProperty(PR_SMTP_ADDRESS).ToString(); + } + } +} \ No newline at end of file diff --git a/Outlook2013TodoAddIn/AppointmentsControl.resx b/Outlook2013TodoAddIn/AppointmentsControl.resx new file mode 100644 index 0000000..86afd8b --- /dev/null +++ b/Outlook2013TodoAddIn/AppointmentsControl.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Outlook2013TodoAddIn/FormRecurringOpen.Designer.cs b/Outlook2013TodoAddIn/FormRecurringOpen.Designer.cs new file mode 100644 index 0000000..4ec929f --- /dev/null +++ b/Outlook2013TodoAddIn/FormRecurringOpen.Designer.cs @@ -0,0 +1,121 @@ +namespace Outlook2013TodoAddIn +{ + partial class FormRecurringOpen + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.rbtnOne = new System.Windows.Forms.RadioButton(); + this.rbtnAll = new System.Windows.Forms.RadioButton(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOK.Location = new System.Drawing.Point(57, 195); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 0; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(192, 195); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 1; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // rbtnOne + // + this.rbtnOne.AutoSize = true; + this.rbtnOne.Checked = true; + this.rbtnOne.Location = new System.Drawing.Point(57, 91); + this.rbtnOne.Name = "rbtnOne"; + this.rbtnOne.Size = new System.Drawing.Size(109, 21); + this.rbtnOne.TabIndex = 2; + this.rbtnOne.TabStop = true; + this.rbtnOne.Text = "Just this one"; + this.rbtnOne.UseVisualStyleBackColor = true; + // + // rbtnAll + // + this.rbtnAll.AutoSize = true; + this.rbtnAll.Location = new System.Drawing.Point(57, 118); + this.rbtnAll.Name = "rbtnAll"; + this.rbtnAll.Size = new System.Drawing.Size(136, 21); + this.rbtnAll.TabIndex = 3; + this.rbtnAll.Text = "The entire series"; + this.rbtnAll.UseVisualStyleBackColor = true; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(57, 12); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.ReadOnly = true; + this.textBox1.Size = new System.Drawing.Size(227, 62); + this.textBox1.TabIndex = 4; + this.textBox1.Text = "This is one appointment in a series. What do you want to open?"; + // + // FormRecurringOpen + // + 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(312, 255); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.rbtnAll); + this.Controls.Add(this.rbtnOne); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOK); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormRecurringOpen"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Open Recurring Item"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.RadioButton rbtnOne; + private System.Windows.Forms.RadioButton rbtnAll; + private System.Windows.Forms.TextBox textBox1; + } +} \ No newline at end of file diff --git a/Outlook2013TodoAddIn/FormRecurringOpen.cs b/Outlook2013TodoAddIn/FormRecurringOpen.cs new file mode 100644 index 0000000..863d159 --- /dev/null +++ b/Outlook2013TodoAddIn/FormRecurringOpen.cs @@ -0,0 +1,22 @@ +using System.Windows.Forms; + +namespace Outlook2013TodoAddIn +{ + public partial class FormRecurringOpen : Form + { + public DialogResult ButtonPressed { get; set; } + + public bool OpenRecurring + { + get + { + return this.rbtnAll.Checked; + } + } + + public FormRecurringOpen() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/Outlook2013TodoAddIn/FormRecurringOpen.resx b/Outlook2013TodoAddIn/FormRecurringOpen.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/Outlook2013TodoAddIn/FormRecurringOpen.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Outlook2013TodoAddIn/ManageTaskPaneRibbon.resx b/Outlook2013TodoAddIn/ManageTaskPaneRibbon.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/Outlook2013TodoAddIn/ManageTaskPaneRibbon.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Outlook2013TodoAddIn/Outlook2013TodoAddIn.csproj b/Outlook2013TodoAddIn/Outlook2013TodoAddIn.csproj new file mode 100644 index 0000000..72e91f8 --- /dev/null +++ b/Outlook2013TodoAddIn/Outlook2013TodoAddIn.csproj @@ -0,0 +1,274 @@ + + + + + + {BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Debug + AnyCPU + {EF0CD4A2-56E1-4C98-BE40-ED2D969F16A8} + Library + false + Outlook2013TodoAddIn + Outlook2013TodoAddIn + v4.5 + VSTO40 + False + true + publish\ + + en + 1.0.0.4 + true + true + 7 + days + Outlook2013TodoAddIn + + + Outlook2013TodoAddIn + + 3 + + + + False + Microsoft .NET Framework 4.5 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 4.5 + true + + + + + Outlook + + + + true + full + false + bin\Debug\ + false + $(DefineConstants);DEBUG;TRACE + 4 + + + + pdbonly + true + bin\Release\ + false + $(DefineConstants);TRACE + 4 + + + + + + + + + + + + + + + + + + + + + + + + True + + + True + + + + + False + true + + + False + true + + + False + + + + + + Form + + + FormRecurringOpen.cs + + + Code + + + UserControl + + + AppointmentsControl.cs + + + Component + + + TodoRibbonAddIn.cs + + + FormRecurringOpen.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + AppointmentsControl.cs + + + TodoRibbonAddIn.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + Code + + + ThisAddIn.cs + + + ThisAddIn.Designer.xml + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + true + + + Outlook2013TodoAddIn_TemporaryKey.pfx + + + B6559589A18A516E837FF896B50FFF8050D46FFB + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Outlook2013TodoAddIn/Outlook2013TodoAddIn_TemporaryKey.pfx b/Outlook2013TodoAddIn/Outlook2013TodoAddIn_TemporaryKey.pfx new file mode 100644 index 0000000000000000000000000000000000000000..947e724eda4230a45ae9840a7069dafa96616c68 GIT binary patch literal 1732 zcmY*YX;hQf7QGq#C{rjD@<5ptP>}eA0DzQ{qh z!W{H<*b>tFKaE_D!+yk$?RKMKeq^B0I!Y`DU8oU?#WCgW#_S}|OF@LmVmV!A!suAf zI49S4cdpmqL4|DUagZRWt#(VF%nDBE*JcVX=DUH%>i9tA*<0J=pWzh#j&;u0)W@@D zK4rs^5ZWdkkF(aAIzi<_44xNA>{<{h9cC69q70H}UYd{T_RcSn3Ojyl&%gOx6yj>~ znDVJI@AkvfRP7$kaMq8k&uT5T+wZvZj+!Z?`+ha@<*eS5wil-j_-405n|pBI?_FF zljeM6&*h9)nMA&$p@WpB&PNNS$4ckw$S(TWy6&Q}g5j;2=u0Rng#1posRAv475UosT|gD*bucTcb#LrEe_{;i;bYH~*&Ty&4f! zwa;$2nsALjxvnmYVlU7s%=r4<{w1euOV4E}c%0s-*h*5FV=v9t*+-P93R5|ibx-@w zKk(SawY*h7OG@>+bAx$bJ9*lQ*KbHXv3tk+f%LgCIiaD%<^XKVr|%j)!*&SH@^!=*quUB@9(|e(5`f!W15j;l~sEQi{9I+l1fAVEo!;2Xo8RIJi#!v^rOlB z_K78H*o7lYgV)MzOAA(IngP+esH+h;y&@ct+T}vojy3T(vvnN%y%AS z&*sHSG8V0Vxq5Nyz1U-D!6}(yDkvWJh7_f095)i3(wePzTXn)$x>0NxO|*k0G-{h= zmybe1%;g++15#wcQ#btu>c;y^TDfq0OJ zfDV#?E!d0X56lS=i*!_^P6i1G7mxHTa0saxe{9);us`Phg>*+i3}7Kn6#n^o9SAY! z4+vF)Mgio=|4Tvr&92Y~yH>{WF8D{oz8~zG!9gE9gMFydwq=gjM(72&XGqTS9@jVA ztMFOV?OO7Q7F+aGOodb*KE3S9$&1BGJ5^*NyYE7oiT{WXj6=FegdjHIt12Ko)p3;UlAWUA) z^_pH2;xb=U{=;u#+~=M^`n-I(3pa~T*)9kr37wi&d&4KHbsl;o)2BCW6;{Z6T&dpL%CRSN2ZGR2H^UBoS0H46*P ziwwq#FU^0axtmDhXC9(ao5kXFfv`)rBt6(W;ZZ`CaBT4DL|HETlD0-lofsDDh7MVp z-|X`oT3dOs>43#y-a#?r5jyPdjRzf7{j{5HCZ}JvlN>&}UKBp1hriNgbGq{}yN6sy@k98&IXbPFp*A zkG)DMsf^1XwZm|wBjj0bx8%i2^*4aIKc2PjFP@E%sTq)~-GuKIrc~0`iRj literal 0 HcmV?d00001 diff --git a/Outlook2013TodoAddIn/Properties/AssemblyInfo.cs b/Outlook2013TodoAddIn/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0773445 --- /dev/null +++ b/Outlook2013TodoAddIn/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Outlook2013TodoAddIn")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Outlook2013TodoAddIn")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("88026d93-9414-4884-9d7e-6cb7f8274093")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Outlook2013TodoAddIn/Properties/Resources.Designer.cs b/Outlook2013TodoAddIn/Properties/Resources.Designer.cs new file mode 100644 index 0000000..4e6f799 --- /dev/null +++ b/Outlook2013TodoAddIn/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Outlook2013TodoAddIn.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Outlook2013TodoAddIn.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap todoIcon { + get { + object obj = ResourceManager.GetObject("todoIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Outlook2013TodoAddIn/Properties/Resources.resx b/Outlook2013TodoAddIn/Properties/Resources.resx new file mode 100644 index 0000000..6641111 --- /dev/null +++ b/Outlook2013TodoAddIn/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\2012-11-20_1546.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Outlook2013TodoAddIn/Properties/Settings.Designer.cs b/Outlook2013TodoAddIn/Properties/Settings.Designer.cs new file mode 100644 index 0000000..3fd554d --- /dev/null +++ b/Outlook2013TodoAddIn/Properties/Settings.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18033 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Outlook2013TodoAddIn.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Visible { + get { + return ((bool)(this["Visible"])); + } + set { + this["Visible"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("285")] + public int Width { + get { + return ((int)(this["Width"])); + } + set { + this["Width"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("3")] + public decimal NumDays { + get { + return ((decimal)(this["NumDays"])); + } + set { + this["NumDays"] = value; + } + } + } +} diff --git a/Outlook2013TodoAddIn/Properties/Settings.settings b/Outlook2013TodoAddIn/Properties/Settings.settings new file mode 100644 index 0000000..93b26d9 --- /dev/null +++ b/Outlook2013TodoAddIn/Properties/Settings.settings @@ -0,0 +1,15 @@ + + + + + + True + + + 285 + + + 3 + + + \ No newline at end of file diff --git a/Outlook2013TodoAddIn/ThisAddIn.Designer.cs b/Outlook2013TodoAddIn/ThisAddIn.Designer.cs new file mode 100644 index 0000000..f44a259 --- /dev/null +++ b/Outlook2013TodoAddIn/ThisAddIn.Designer.cs @@ -0,0 +1,286 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18010 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 414 +namespace Outlook2013TodoAddIn { + + + /// + [Microsoft.VisualStudio.Tools.Applications.Runtime.StartupObjectAttribute(0)] + [global::System.Security.Permissions.PermissionSetAttribute(global::System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")] + public sealed partial class ThisAddIn : Microsoft.Office.Tools.Outlook.OutlookAddInBase { + + internal Microsoft.Office.Tools.CustomTaskPaneCollection CustomTaskPanes; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + private global::System.Object missing = global::System.Type.Missing; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + internal Microsoft.Office.Interop.Outlook.Application Application; + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public ThisAddIn(global::Microsoft.Office.Tools.Outlook.Factory factory, global::System.IServiceProvider serviceProvider) : + base(factory, serviceProvider, "AddIn", "ThisAddIn") { + Globals.Factory = factory; + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + protected override void Initialize() { + base.Initialize(); + this.Application = this.GetHostItem(typeof(Microsoft.Office.Interop.Outlook.Application), "Application"); + Globals.ThisAddIn = this; + global::System.Windows.Forms.Application.EnableVisualStyles(); + this.InitializeCachedData(); + this.InitializeControls(); + this.InitializeComponents(); + this.InitializeData(); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + protected override void FinishInitialization() { + this.InternalStartup(); + this.OnStartup(); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + protected override void InitializeDataBindings() { + this.BeginInitialization(); + this.BindToData(); + this.EndInitialization(); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void InitializeCachedData() { + if ((this.DataHost == null)) { + return; + } + if (this.DataHost.IsCacheInitialized) { + this.DataHost.FillCachedData(this); + } + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void InitializeData() { + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void BindToData() { + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + private void StartCaching(string MemberName) { + this.DataHost.StartCaching(this, MemberName); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + private void StopCaching(string MemberName) { + this.DataHost.StopCaching(this, MemberName); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + private bool IsCached(string MemberName) { + return this.DataHost.IsCached(this, MemberName); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void BeginInitialization() { + this.BeginInit(); + this.CustomTaskPanes.BeginInit(); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void EndInitialization() { + this.CustomTaskPanes.EndInit(); + this.EndInit(); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void InitializeControls() { + this.CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void InitializeComponents() { + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + private bool NeedsFill(string MemberName) { + return this.DataHost.NeedsFill(this, MemberName); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + protected override void OnShutdown() { + this.CustomTaskPanes.Dispose(); + base.OnShutdown(); + } + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + internal sealed partial class Globals { + + /// + private Globals() { + } + + private static ThisAddIn _ThisAddIn; + + private static global::Microsoft.Office.Tools.Outlook.Factory _factory; + + private static ThisRibbonCollection _ThisRibbonCollection; + + private static ThisFormRegionCollection _ThisFormRegionCollection; + + internal static ThisAddIn ThisAddIn { + get { + return _ThisAddIn; + } + set { + if ((_ThisAddIn == null)) { + _ThisAddIn = value; + } + else { + throw new System.NotSupportedException(); + } + } + } + + internal static global::Microsoft.Office.Tools.Outlook.Factory Factory { + get { + return _factory; + } + set { + if ((_factory == null)) { + _factory = value; + } + else { + throw new System.NotSupportedException(); + } + } + } + + internal static ThisRibbonCollection Ribbons { + get { + if ((_ThisRibbonCollection == null)) { + _ThisRibbonCollection = new ThisRibbonCollection(_factory.GetRibbonFactory()); + } + return _ThisRibbonCollection; + } + } + + internal static ThisFormRegionCollection FormRegions { + get { + if ((_ThisFormRegionCollection == null)) { + _ThisFormRegionCollection = new ThisFormRegionCollection(Globals.ThisAddIn.GetFormRegions()); + } + return _ThisFormRegionCollection; + } + } + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "11.0.0.0")] + internal sealed partial class ThisRibbonCollection : Microsoft.Office.Tools.Ribbon.RibbonCollectionBase { + + /// + internal ThisRibbonCollection(global::Microsoft.Office.Tools.Ribbon.RibbonFactory factory) : + base(factory) { + } + + internal ThisRibbonCollection this[Microsoft.Office.Interop.Outlook.Inspector inspector] { + get { + return this.GetRibbonContextCollection(inspector); + } + } + + internal ThisRibbonCollection this[Microsoft.Office.Interop.Outlook.Explorer explorer] { + get { + return this.GetRibbonContextCollection(explorer); + } + } + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal sealed partial class ThisFormRegionCollection : Microsoft.Office.Tools.Outlook.FormRegionCollectionBase { + + /// + public ThisFormRegionCollection(System.Collections.Generic.IList list) : + base(list) { + } + + internal WindowFormRegionCollection this[Microsoft.Office.Interop.Outlook.Explorer explorer] { + get { + return ((WindowFormRegionCollection)(Globals.ThisAddIn.GetFormRegions(explorer, typeof(WindowFormRegionCollection)))); + } + } + + internal WindowFormRegionCollection this[Microsoft.Office.Interop.Outlook.Inspector inspector] { + get { + return ((WindowFormRegionCollection)(Globals.ThisAddIn.GetFormRegions(inspector, typeof(WindowFormRegionCollection)))); + } + } + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal sealed partial class WindowFormRegionCollection : Microsoft.Office.Tools.Outlook.FormRegionCollectionBase { + + /// + public WindowFormRegionCollection(System.Collections.Generic.IList list) : + base(list) { + } + } +} diff --git a/Outlook2013TodoAddIn/ThisAddIn.Designer.xml b/Outlook2013TodoAddIn/ThisAddIn.Designer.xml new file mode 100644 index 0000000..9143365 --- /dev/null +++ b/Outlook2013TodoAddIn/ThisAddIn.Designer.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Outlook2013TodoAddIn/ThisAddIn.cs b/Outlook2013TodoAddIn/ThisAddIn.cs new file mode 100644 index 0000000..b1f1a36 --- /dev/null +++ b/Outlook2013TodoAddIn/ThisAddIn.cs @@ -0,0 +1,133 @@ +using Microsoft.Win32; +using System; +using System.Linq; +using Office = Microsoft.Office.Core; + +namespace Outlook2013TodoAddIn +{ + public partial class ThisAddIn + { + private AppointmentsControl appControl; + + public Microsoft.Office.Tools.CustomTaskPane ToDoTaskPane { get; set; } + + //private Dictionary inspectorWrappersValue = new Dictionary(); + //private Outlook.Inspectors inspectors; + + //void Inspectors_NewInspector(Outlook.Inspector Inspector) + //{ + // if (Inspector.CurrentItem is Outlook.MailItem) + // { + // inspectorWrappersValue.Add(Inspector, new InspectorWrapper(Inspector)); + // } + //} + + //public Dictionary InspectorWrappers + //{ + // get + // { + // return inspectorWrappersValue; + // } + //} + + private void ThisAddIn_Startup(object sender, System.EventArgs e) + { + //inspectors = this.Application.Inspectors; + //inspectors.NewInspector += + // new Outlook.InspectorsEvents_NewInspectorEventHandler( + // Inspectors_NewInspector); + + //foreach (Outlook.Inspector inspector in inspectors) + //{ + // Inspectors_NewInspector(inspector); + //} + + appControl = new AppointmentsControl(); + appControl.NumDays = Properties.Settings.Default.NumDays; // Setting the value will load the appointments + + //Properties.Settings.Default.Properties[] + // appControl.Dock = System.Windows.Forms.DockStyle.Right; + ToDoTaskPane = this.CustomTaskPanes.Add(appControl, "Appointments"); + ToDoTaskPane.Visible = Properties.Settings.Default.Visible; + + //ToDoTaskPane.Visible = true; + //ToDoTaskPane.Width = 285; // appControl.Width; + ToDoTaskPane.Width = Properties.Settings.Default.Width; + ToDoTaskPane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight; + ToDoTaskPane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoHorizontal; + ToDoTaskPane.VisibleChanged += ToDoTaskPane_VisibleChanged; + appControl.SizeChanged += appControl_SizeChanged; + + this.AddRegistryNotification(); + } + + private void appControl_SizeChanged(object sender, EventArgs e) + { + Properties.Settings.Default.Width = ToDoTaskPane.Width; + } + + private void ToDoTaskPane_VisibleChanged(object sender, EventArgs e) + { + // Properties.Settings.Default.Visible = ToDoTaskPane.Visible; + TodoRibbonAddIn rbn = Globals.Ribbons.FirstOrDefault(r => r is TodoRibbonAddIn) as TodoRibbonAddIn; + if (rbn != null) + { + rbn.toggleButton1.Checked = ToDoTaskPane.Visible; + } + } + + /// + /// This is NEVER executed anymore + /// http://msdn.microsoft.com/en-us/library/office/ee720183.aspx#OL2010AdditionalShutdownChanges_AddinShutdownChangesinOL2010Beta + /// We MANUALLY add notification to the registry of each user + /// + /// + /// + private void ThisAddIn_Shutdown(object sender, System.EventArgs e) + { + //inspectors.NewInspector -= + // new Outlook.InspectorsEvents_NewInspectorEventHandler( + // Inspectors_NewInspector); + //inspectors = null; + //inspectorWrappersValue = null; + // Can't call these because the object is already disposed. Settings will be set while the app is running + //Properties.Settings.Default.Visible = ToDoTaskPane.Visible; + //Properties.Settings.Default.Width = ToDoTaskPane.Width; + //Properties.Settings.Default.NumDays = appControl.NumDays; + Properties.Settings.Default.Save(); + } + + private void AddRegistryNotification() + { + // http://msdn.microsoft.com/en-us/library/office/ee720183.aspx#OL2010AdditionalShutdownChanges_AddinShutdownChangesinOL2010Beta + // HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Addins\\[RequireShutdownNotification]=dword:0x1 + + string subKey = @"Software\Microsoft\Office\Outlook\Addins\Outlook2013TodoAddIn"; + RegistryKey rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(subKey, true); + + if (rk == null) + { + rk = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(subKey); + } + + if ((int)rk.GetValue("RequireShutdownNotification", 0) == 0) + { + rk.SetValue("RequireShutdownNotification", 1, RegistryValueKind.DWord); // "dword:0x1" + } + } + + #region VSTO generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InternalStartup() + { + this.Startup += new System.EventHandler(ThisAddIn_Startup); + this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown); + } + + #endregion VSTO generated code + } +} \ No newline at end of file diff --git a/Outlook2013TodoAddIn/TodoRibbonAddIn.Designer.cs b/Outlook2013TodoAddIn/TodoRibbonAddIn.Designer.cs new file mode 100644 index 0000000..38a6676 --- /dev/null +++ b/Outlook2013TodoAddIn/TodoRibbonAddIn.Designer.cs @@ -0,0 +1,92 @@ +namespace Outlook2013TodoAddIn +{ + partial class TodoRibbonAddIn : Microsoft.Office.Tools.Ribbon.RibbonBase + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + public TodoRibbonAddIn() + : base(Globals.Factory.GetRibbonFactory()) + { + InitializeComponent(); + } + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.tab1 = this.Factory.CreateRibbonTab(); + this.group1 = this.Factory.CreateRibbonGroup(); + this.toggleButton1 = this.Factory.CreateRibbonToggleButton(); + this.tab1.SuspendLayout(); + this.group1.SuspendLayout(); + // + // tab1 + // + this.tab1.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office; + this.tab1.Groups.Add(this.group1); + this.tab1.Label = "TabAddIns"; + this.tab1.Name = "tab1"; + // + // group1 + // + this.group1.Items.Add(this.toggleButton1); + this.group1.Label = "To-Do AddIn"; + this.group1.Name = "group1"; + // + // toggleButton1 + // + this.toggleButton1.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge; + this.toggleButton1.Image = global::Outlook2013TodoAddIn.Properties.Resources.todoIcon; + this.toggleButton1.Label = "Show To-Do Panel"; + this.toggleButton1.Name = "toggleButton1"; + this.toggleButton1.ShowImage = true; + this.toggleButton1.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.toggleButton1_Click); + // + // TodoRibbonAddIn + // + this.Name = "TodoRibbonAddIn"; + this.RibbonType = "Microsoft.Outlook.Explorer"; + this.Tabs.Add(this.tab1); + this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.TodoRibbonAddIn_Load); + this.tab1.ResumeLayout(false); + this.tab1.PerformLayout(); + this.group1.ResumeLayout(false); + this.group1.PerformLayout(); + + } + + #endregion + + internal Microsoft.Office.Tools.Ribbon.RibbonTab tab1; + internal Microsoft.Office.Tools.Ribbon.RibbonGroup group1; + internal Microsoft.Office.Tools.Ribbon.RibbonToggleButton toggleButton1; + } + + partial class ThisRibbonCollection + { + internal TodoRibbonAddIn TodoRibbonAddIn + { + get { return this.GetRibbon(); } + } + } +} diff --git a/Outlook2013TodoAddIn/TodoRibbonAddIn.cs b/Outlook2013TodoAddIn/TodoRibbonAddIn.cs new file mode 100644 index 0000000..e66c965 --- /dev/null +++ b/Outlook2013TodoAddIn/TodoRibbonAddIn.cs @@ -0,0 +1,16 @@ +using Microsoft.Office.Tools.Ribbon; + +namespace Outlook2013TodoAddIn +{ + public partial class TodoRibbonAddIn + { + private void TodoRibbonAddIn_Load(object sender, RibbonUIEventArgs e) + { + } + + private void toggleButton1_Click(object sender, RibbonControlEventArgs e) + { + Globals.ThisAddIn.ToDoTaskPane.Visible = this.toggleButton1.Checked; + } + } +} \ No newline at end of file diff --git a/Outlook2013TodoAddIn/TodoRibbonAddIn.resx b/Outlook2013TodoAddIn/TodoRibbonAddIn.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/Outlook2013TodoAddIn/TodoRibbonAddIn.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Outlook2013TodoAddIn/app.config b/Outlook2013TodoAddIn/app.config new file mode 100644 index 0000000..1dc6f0b --- /dev/null +++ b/Outlook2013TodoAddIn/app.config @@ -0,0 +1,21 @@ + + + + +
+ + + + + + True + + + 285 + + + 3 + + + + \ No newline at end of file