Writing a Facebook event synchroniser for Outlook 2007+ Part 1
Rather that trying to release and explain my other apps I thought I would write a event sync for outlook that uses WPF for the UI. I will be doing my best to use the MVVM pattern as well.
Requirements:
- Visual Studio 2008 SP1
- .net 3.5 SP1
- Facebook Developer Toolkit 2.1
- Continuous LINQ (I think I will use this)
- Umbrella Extensions
- My Outlook toolkit I have created
Credits:
- Microsoft Outlook/CRM integration Sample
- Adrian Brown’s Calendar monitor, which I have adapted into a generic folder monitor.
Steps:
- Create a new Outlook 2007 Add-in.
- Add the following References:
PresentationCore
PresentationFramework
WindowsBase
WindowsFormsIntegration (needed to host a WPF control in a outlook inspector)
JakeOutlookToolkit - Add this code to your ThisAddIn_Startup method.
if (System.Windows.Application.Current == null) new System.Windows.Application { ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown };
WPF requires the Application to be instantiated, it is a singleton so it only needs to be instantiated on load then you can reference it anywhere by using Application.Current.The shutdown mode was added because if I showed a WPF window, then the user closed it Outlook would crash the next time you tried to show a WPF window.
What’s in the toolkit
The toolkit is a collection of classes I have put together and modified for my own use. It contains:
- An Outlook folder monitor (with add, modified and deleted events you can subscribe to)
- ItemAdapter, provides a common wrapper for outlook items, AppointmentItems, MailItems etc only have a single common interface (ItemEvents_10_Event), the ItemAdapter gives you Save, Delete, Display, OnOpen, OnWrite, OnClose events and properties which reduces casting and allows us to be more generic with our outlook app.
- Menu, CommandBar, CommandBarManager. A really nice way to work with office toolbars, it automatically subscribes to new explorers and attaches any registered command bar etc. Very handy.
- And a few other little things that I find useful.
We now have the shell of our app, I will be aiming to get this app done this weekend.
I will attach the source of the project once I finish the next part.
| Print article | This entry was posted by Jake Ginnivan on July 25, 2009 at 1:40 pm, and is filed under Development. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |