System.Configuration.MgmtConfigurationRecord.Init C# (CSharp) Method

Init() private method

private Init ( IInternalConfigRoot configRoot, IInternalConfigRecord parent, string configPath, string locationSubPath ) : void
configRoot IInternalConfigRoot
parent IInternalConfigRecord
configPath string
locationSubPath string
return void
        private void Init(
                IInternalConfigRoot         configRoot,
                IInternalConfigRecord       parent,
                string                      configPath,
                string                      locationSubPath) {

            base.Init(configRoot, (BaseConfigurationRecord) parent, configPath, locationSubPath);

            if (    IsLocationConfig && 
                    (MgmtParent._locationTags == null || !MgmtParent._locationTags.Contains(_locationSubPath))) {

                // By instantiating a "new" LocationSubPath class, we have implicitly 
                // asked for one to be created
                _flags[ForceLocationWritten] = true;
            }

            // Copy all stream information so that we can model changes to ConfigSource
            InitStreamInfoUpdates();
        }

Usage Example

        private HybridDictionary _streamInfoUpdates; // List of StreamInfo, including the main config file, the configSource this record uses, and
                                                    // new configSource stream added thru API


        static internal MgmtConfigurationRecord Create(
                IInternalConfigRoot         configRoot,
                IInternalConfigRecord       parent,
                string                      configPath,
                string                      locationSubPath) {

            MgmtConfigurationRecord configRecord = new MgmtConfigurationRecord();
            configRecord.Init(configRoot, parent, configPath, locationSubPath);
            return configRecord;
        }