Exemplo n.º 1
0
 public HttpCapabilitiesDefaultProvider() : this(RuntimeConfig.GetAppConfig().BrowserCaps)
 {
     if (RuntimeConfig.GetAppConfig().BrowserCaps != null)
     {
         _userAgentCacheKeyLength = RuntimeConfig.GetAppConfig().BrowserCaps.UserAgentCacheKeyLength;
     }
     if (_userAgentCacheKeyLength == 0)
     {
         _userAgentCacheKeyLength = _defaultUserAgentCacheKeyLength;
     }
 }
 private static void EnsureConfig()
 {
     if (s_config == null)
     {
         lock (s_initLock)
         {
             if (s_config == null)
             {
                 MachineKeySection machineKey = RuntimeConfig.GetAppConfig().MachineKey;
                 machineKey.ConfigureEncryptionObject();
                 s_config     = machineKey;
                 s_compatMode = machineKey.CompatibilityMode;
             }
         }
     }
 }
Exemplo n.º 3
0
        HealthMonitoringSectionHelper()
        {
            // Handle config exceptions so we can still log messages to the event log.
            try {
                _section = RuntimeConfig.GetAppConfig().HealthMonitoring;
            }
            catch (Exception e) {
                // If InitializationException has not already been set, then this exception
                // is happening because the <healthMonitoring> section has an error.
                // By setting InitializationException, we allow the exception to be displayed in the response.
                // If InitializationException is already set, ignore this exception so we can
                // display the original in the response.
                if (HttpRuntime.InitializationException == null)
                {
                    HttpRuntime.InitializationException = e;
                }
                _section = RuntimeConfig.GetAppLKGConfig().HealthMonitoring;
                // WOS 1965670: if we fail to get the section throw the previous error
                if (_section == null)
                {
                    throw;
                }
            }

            _enabled = _section.Enabled;

            if (!_enabled)
            {
                return;
            }

            // First run some basic sanity check
            BasicSanityCheck();

            // Init some class members
            _ruleInfos = new ArrayList();
            _customEvaluatorInstances          = new Hashtable();
            _providerInstances                 = new ProviderInstances(_section);
            _cachedMatchedRulesForCustomEvents = new Hashtable(new WebBaseEventKeyComparer());
            _cachedMatchedRules                = new ArrayList[WebEventCodes.GetEventArrayDimensionSize(0),
                                                               WebEventCodes.GetEventArrayDimensionSize(1)];

            BuildRuleInfos();

            _providerInstances.CleanupUninitProviders();
        }