private void Init(CachedPathData parentData)
 {
     if (!HttpConfigurationSystem.UseHttpConfigurationSystem)
     {
         this._runtimeConfig = null;
     }
     else
     {
         IInternalConfigRecord uniqueConfigRecord = HttpConfigurationSystem.GetUniqueConfigRecord(this._configPath);
         if (uniqueConfigRecord.ConfigPath.Length == this._configPath.Length)
         {
             this._flags[0x10]   = true;
             this._runtimeConfig = new System.Web.Configuration.RuntimeConfig(uniqueConfigRecord);
         }
         else
         {
             this._runtimeConfig = parentData._runtimeConfig;
         }
     }
 }
Esempio n. 2
0
        // Initialize the data
        void Init(CachedPathData parentData)
        {
            // Note that _runtimeConfig will be set to the singleton instance of ErrorRuntimeConfig
            // if a ThreadAbortException is thrown during this method.
            Debug.Assert(_runtimeConfig == RuntimeConfig.GetErrorRuntimeConfig(), "_runtimeConfig == RuntimeConfig.GetErrorRuntimeConfig()");

            if (!HttpConfigurationSystem.UseHttpConfigurationSystem)
            {
                //
                // configRecord may legitimately be null if we are not using the HttpConfigurationSystem.
                //
                _runtimeConfig = null;
            }
            else
            {
                IInternalConfigRecord configRecord = HttpConfigurationSystem.GetUniqueConfigRecord(_configPath);
                Debug.Assert(configRecord != null, "configRecord != null");

                if (configRecord.ConfigPath.Length == _configPath.Length)
                {
                    //
                    // The config is unique to this path, so this make this record the owner of the config.
                    //
                    _flags[FOwnsConfigRecord] = true;
                    _runtimeConfig            = new RuntimeConfig(configRecord);
                }
                else
                {
                    //
                    // The config record is the same as an ancestor's, so use the parent's RuntimeConfig.
                    //
                    Debug.Assert(parentData != null, "parentData != null");
                    _runtimeConfig = parentData._runtimeConfig;
                }
            }
        }