/// <summary> /// Loads the areas from farm configuration using the configuration manager provided. /// </summary> /// <param name="configMgr">The configuration manager to use to load the areas</param> /// <returns>the list containing areas loaded</returns> private static IList <DiagnosticsArea> LoadAreas(IConfigManager configMgr) { Validation.ArgumentNotNull(configMgr, "configName"); IPropertyBag bag = configMgr.GetPropertyBag(ConfigLevel.CurrentSPFarm); if (configMgr.ContainsKeyInPropertyBag(Constants.AreasConfigKey, bag)) { return(configMgr.GetFromPropertyBag <DiagnosticsAreaCollection>(Constants.AreasConfigKey, bag)); } else { return(new DiagnosticsAreaCollection()); } }
public int GetSiteCacheInterval() { int interval = -1; if (SharePointEnvironment.CanAccessFarmConfig) { var bag = Manager.GetPropertyBag(ConfigLevel.CurrentSPFarm); if (bag != null && Manager.ContainsKeyInPropertyBag(GetSiteCacheIntervalConfigKey(), bag)) { interval = Manager.GetFromPropertyBag <int>(GetSiteCacheIntervalConfigKey(), bag); } } return(interval); }
private List <TypeMapping> GetTypeMappingsList() { if (!manager.ContainsKeyInPropertyBag(GetConfigKey(), SPFarm.Local)) { return(new List <TypeMapping>()); } List <TypeMapping> typeMappings = manager.GetFromPropertyBag <List <TypeMapping> >(GetConfigKey(), SPFarm.Local); if (typeMappings == null) { return(new List <TypeMapping>()); } return(typeMappings); }