From 60ee35606275d1662d42352f6f3e4de80e930e43 Mon Sep 17 00:00:00 2001 From: briandunnington Date: Fri, 18 Sep 2009 16:16:16 +0000 Subject: [PATCH] added Priority support to Outlook Add-In --- .../ThisApplication.cs | 26 ++++++++++--------- .../GrowlOutlookAddInSetup | 10 +++---- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Growl Extras/Growl Outlook Add-In/GrowlExtras.OutlookAddIn/ThisApplication.cs b/Growl Extras/Growl Outlook Add-In/GrowlExtras.OutlookAddIn/ThisApplication.cs index 2db5198..2d80d1f 100644 --- a/Growl Extras/Growl Outlook Add-In/GrowlExtras.OutlookAddIn/ThisApplication.cs +++ b/Growl Extras/Growl Outlook Add-In/GrowlExtras.OutlookAddIn/ThisApplication.cs @@ -63,9 +63,7 @@ void ThisApplication_NewMailEx(string EntryIDCollection) text = String.Format("You have {0} new messages", ids.Length); Growl.Connector.Notification notification = new Growl.Connector.Notification(this.application.Name, newmail.Name, String.Empty, title, text); - Growl.Connector.CallbackContext callbackContext = new Growl.Connector.CallbackContext(); - callbackContext.Data = "null"; - callbackContext.Type = "multimessage"; + Growl.Connector.CallbackContext callbackContext = new Growl.Connector.CallbackContext("null", "multimessage"); growl.Notify(notification, callbackContext); } else @@ -84,10 +82,13 @@ void ThisApplication_NewMailEx(string EntryIDCollection) title = (String.IsNullOrEmpty(title) ? "[No Subject]" : message.Subject); text = String.Format("From: {0}\n{1}", message.SenderName, body); + Growl.Connector.Priority priority = Growl.Connector.Priority.Normal; + if (message.Importance == Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh) priority = Growl.Connector.Priority.High; + else if (message.Importance == Microsoft.Office.Interop.Outlook.OlImportance.olImportanceLow) priority = Growl.Connector.Priority.Moderate; + Growl.Connector.Notification notification = new Growl.Connector.Notification(this.application.Name, newmail.Name, String.Empty, title, text); - Growl.Connector.CallbackContext callbackContext = new Growl.Connector.CallbackContext(); - callbackContext.Data = id; - callbackContext.Type = "mailmessage"; + notification.Priority = priority; + Growl.Connector.CallbackContext callbackContext = new Growl.Connector.CallbackContext(id, "mailmessage"); growl.Notify(notification, callbackContext); } else if (obj is Outlook.MeetingItem) @@ -101,10 +102,13 @@ void ThisApplication_NewMailEx(string EntryIDCollection) title = (String.IsNullOrEmpty(title) ? "[No Subject]" : message.Subject); text = String.Format("From: {0}\n{1}", message.SenderName, body); + Growl.Connector.Priority priority = Growl.Connector.Priority.Normal; + if (message.Importance == Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh) priority = Growl.Connector.Priority.High; + else if (message.Importance == Microsoft.Office.Interop.Outlook.OlImportance.olImportanceLow) priority = Growl.Connector.Priority.Moderate; + Growl.Connector.Notification notification = new Growl.Connector.Notification(this.application.Name, newmail.Name, String.Empty, title, text); - Growl.Connector.CallbackContext callbackContext = new Growl.Connector.CallbackContext(); - callbackContext.Data = id; - callbackContext.Type = "mailmessage"; + notification.Priority = priority; + Growl.Connector.CallbackContext callbackContext = new Growl.Connector.CallbackContext(id, "mailmessage"); growl.Notify(notification, callbackContext); } } @@ -157,9 +161,7 @@ void ThisApplication_Reminder(object item) // send to growl Growl.Connector.Notification notification = new Growl.Connector.Notification(this.application.Name, reminder.Name, String.Empty, title, reminderMsg); - Growl.Connector.CallbackContext callbackContext = new Growl.Connector.CallbackContext(); - callbackContext.Data = data; - callbackContext.Type = type; + Growl.Connector.CallbackContext callbackContext = new Growl.Connector.CallbackContext(data, type); growl.Notify(notification, callbackContext); } } diff --git a/Growl Extras/Growl Outlook Add-In/GrowlOutlookAddInSetup/GrowlOutlookAddInSetup b/Growl Extras/Growl Outlook Add-In/GrowlOutlookAddInSetup/GrowlOutlookAddInSetup index 4abc510..44f19e2 100644 --- a/Growl Extras/Growl Outlook Add-In/GrowlOutlookAddInSetup/GrowlOutlookAddInSetup +++ b/Growl Extras/Growl Outlook Add-In/GrowlOutlookAddInSetup/GrowlOutlookAddInSetup @@ -393,7 +393,7 @@ { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Growl.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=980c2339411be384, processorArchitecture=x86" + "AssemblyAsmDisplayName" = "8:Growl.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=980c2339411be384, processorArchitecture=MSIL" "ScatterAssemblies" { "_A4954E56AD3AC4E46CF9F686C5BFEBD8" @@ -444,7 +444,7 @@ { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Growl.CoreLibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=13e59d82e007b064, processorArchitecture=x86" + "AssemblyAsmDisplayName" = "8:Growl.CoreLibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=13e59d82e007b064, processorArchitecture=MSIL" "ScatterAssemblies" { "_D12544566D6B7C017F416899A9998313" @@ -588,14 +588,14 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Growl Outlook Add-In" - "ProductCode" = "8:{BA3D1952-1A3C-457D-8B02-0036B117F696}" - "PackageCode" = "8:{A7557050-61A7-4456-B325-4BCABFE40A9A}" + "ProductCode" = "8:{B983A19F-DA56-40CE-86CE-047D599821D1}" + "PackageCode" = "8:{0E11437B-3562-4892-8C8A-DA963ECAD02E}" "UpgradeCode" = "8:{49A7FB61-9235-4718-B57C-A8C2DB8C84C8}" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:FALSE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:1.0.3" + "ProductVersion" = "8:1.0.4" "Manufacturer" = "8:Growl Extras" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:"