System.Configuration.Internal.InternalConfigHost.StaticGetStreamNameForConfigSource C# (CSharp) Метод

StaticGetStreamNameForConfigSource() приватный Метод

private StaticGetStreamNameForConfigSource ( string streamName, string configSource ) : string
streamName string
configSource string
Результат string
        static internal string StaticGetStreamNameForConfigSource(string streamName, string configSource) {
            //
            
            if (!Path.IsPathRooted(streamName)) {
                throw ExceptionUtil.ParameterInvalid("streamName");
            }

            // get the path part of the original stream
            streamName = Path.GetFullPath(streamName);
            string dirStream = UrlPath.GetDirectoryOrRootName(streamName);

            // combine with the new config source
            string result = Path.Combine(dirStream, configSource);
            result = Path.GetFullPath(result);

            // ensure the result is in or under the directory of the original source
            string dirResult = UrlPath.GetDirectoryOrRootName(result);
            if (!UrlPath.IsEqualOrSubdirectory(dirStream, dirResult)) {
                throw new ArgumentException(SR.GetString(SR.Config_source_not_under_config_dir, configSource));
            }

            return result;
        }