private void InternalStartup() { core = new AddinBootstrapper(Application.Session); OutlookRibbonFactory.SetApplication(Application); RibbonFactory.Current.InitialiseFactory( t => (IRibbonViewModel)core.Resolve(t), CustomTaskPanes); Startup += ThisAddInStartup; Shutdown += ThisAddInShutdown; }