Skip to content

Commit

Permalink
added Priority support to Outlook Add-In
Browse files Browse the repository at this point in the history
  • Loading branch information
briandunnington committed Sep 18, 2009
1 parent 16d1492 commit 60ee356
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:"
Expand Down

0 comments on commit 60ee356

Please sign in to comment.