Пример #1
0
        internal ConfigurationLocation(string path, string xmlContent, Configuration parent, bool allowOverride)
        {
            if (!string.IsNullOrEmpty(path))
            {
                switch (path[0])
                {
                case ' ':

                case '/':
                case '\\':
                    throw new ConfigurationErrorsException(
                              "<location> path attribute must be a relative virtual path.  It cannot start with any of ' ' '.' '/' or '\\'.");

                case '.':
                    path = ConfigurationManager.TryAutoDetectConfigFile(Assembly.GetEntryAssembly());
                    break;
                }

                path = path.TrimEnd(PathTrimChars);
            }

            Path          = path;
            XmlContent    = xmlContent;
            _parent       = parent;
            AllowOverride = allowOverride;
        }