From 7177c27b6a2714c7b5bc5d3a3510467b56de0da7 Mon Sep 17 00:00:00 2001 From: gamosoft_cp Date: Thu, 12 Sep 2013 11:07:39 +0000 Subject: [PATCH] Added categories to tooltips --- Outlook2013TodoAddIn/AppointmentsControl.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Outlook2013TodoAddIn/AppointmentsControl.cs b/Outlook2013TodoAddIn/AppointmentsControl.cs index e873920..2dfa066 100644 --- a/Outlook2013TodoAddIn/AppointmentsControl.cs +++ b/Outlook2013TodoAddIn/AppointmentsControl.cs @@ -258,6 +258,25 @@ namespace Outlook2013TodoAddIn // current.UseItemStyleForSubItems = false; current.ToolTipText = String.Format("{0} - {1} {2}", i.Start.ToShortTimeString(), i.End.ToShortTimeString(), i.Subject); + + if (!String.IsNullOrEmpty(i.Categories)) + { + string[] allCats = i.Categories.Split(new char[] { ',' }); + if (allCats != null && allCats.Length != 0) + { + List cs = allCats.Select(cat => cat.Trim()).ToList(); + cs.ForEach(cat => + { + Outlook.Category c = Globals.ThisAddIn.Application.Session.Categories[cat] as Outlook.Category; + if (c != null) + { + current.ToolTipText += Environment.NewLine + " - " + c.Name; + } + }); + } + } + + current.Tag = i; current.Group = grp; switch (i.BusyStatus)