public void UpdateWebAnalyticsSettings(PropertyBag bag) { WebAnalyticsSection configSection = GetWebAnalyticsSection(); configSection.TrackingEnabled = (bool)bag[WebAnalyticsGlobals.trackingEnabled]; configSection.TrackingScript = (string)bag[WebAnalyticsGlobals.trackingScript]; configSection.InsertionPoint = (InsertionPoint)bag[WebAnalyticsGlobals.insertionPoint]; ManagementUnit.Update(); }
internal WebAnalyticsSection GetWebAnalyticsSection() { WebAnalyticsSection section = (WebAnalyticsSection)ManagementUnit.Configuration.GetSection("system.webServer/webAnalytics", typeof(WebAnalyticsSection)); if (section == null) { RaiseException("Failed to read configuration section system.webServer/webAnalytics."); } return(section); }
public PropertyBag GetWebAnalyticsSettings() { PropertyBag bag = new PropertyBag(); WebAnalyticsSection configSection = GetWebAnalyticsSection(); bag[WebAnalyticsGlobals.trackingEnabled] = configSection.TrackingEnabled; bag[WebAnalyticsGlobals.trackingScript] = configSection.TrackingScript; bag[WebAnalyticsGlobals.insertionPoint] = configSection.InsertionPoint; bag[WebAnalyticsGlobals.isLocked] = configSection.IsLocked; return(bag); }
/// <summary> /// Reads the module specific configuration properties /// </summary> /// <param name="context"></param> /// <returns>Boolean indicating the success/failure</returns> private bool ReadModuleConfiguration(HttpContext context) { try { webAnalyticsModuleConfig = (WebAnalyticsSection)WebConfigurationManager.GetSection(context, "system.webServer/webAnalytics", typeof(WebAnalyticsSection)); } catch (Exception) { return(false); } return(true); }