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

IsStreamUsed() private method

private IsStreamUsed ( string oldStreamName ) : bool
oldStreamName string
return bool
        private bool IsStreamUsed(string oldStreamName) {
            MgmtConfigurationRecord current = this;
            if (IsLocationConfig) {
                //
                // For a location configuration, the input we need to check
                // are the section records and location sections in the file,
                // which are available in the parent record.
                //
                current = MgmtParent;

                //
                // Check whether a file section is using the configsource directive.
                //
                if (current._sectionRecords != null) {
                    foreach (SectionRecord sectionRecord in current._sectionRecords.Values) {
                        if (    sectionRecord.HasFileInput &&
                                StringUtil.EqualsIgnoreCase(sectionRecord.FileInput.SectionXmlInfo.ConfigSourceStreamName, oldStreamName)) {
                            return true;
                        }
                    }
                }
            }

            //
            // Check whether a location is using the configsource directive.
            //
            if (current._locationSections != null) {
                foreach (LocationSectionRecord locationSectionRecord in current._locationSections) {
                    if (StringUtil.EqualsIgnoreCase(locationSectionRecord.SectionXmlInfo.ConfigSourceStreamName, oldStreamName)) {
                        return true;
                    }
                }
            }

            return false;
        }