Skip to content

Instantly share code, notes, and snippets.

@SitefinityGuru
Created March 5, 2013 04:32
Show Gist options
  • Save SitefinityGuru/5088027 to your computer and use it in GitHub Desktop.
Save SitefinityGuru/5088027 to your computer and use it in GitHub Desktop.
Demonstrates how to check if Sitefinity modules are installed and activated or disabled.
BlogsManager blogMgr = null;
NewsManager newsMgr = null;
EventsManager evMgr = null;
// retrieve the System Configuration
var systemConfig = Config.Get<SystemConfig>();
// blogs
var blogModuleConfig = systemConfig.ApplicationModules[BlogsModule.ModuleName];
if (blogModuleConfig.StartupType != StartupType.Disabled)
blogMgr = BlogsManager.GetManager();
var newsModuleConfig = systemConfig.ApplicationModules[NewsModule.ModuleName];
if (newsModuleConfig.StartupType != StartupType.Disabled)
newsMgr = NewsManager.GetManager();
var eventsModuleConfig = systemConfig.ApplicationModules[EventsModule.ModuleName];
if (eventsModuleConfig.StartupType != StartupType.Disabled)
evMgr = EventsManager.GetManager();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment