Microsoft.Web.Administration.ConfigurationElementSchema.FindSchema C# (CSharp) Method

FindSchema() private method

private FindSchema ( string path ) : ConfigurationElementSchema
path string
return ConfigurationElementSchema
        internal ConfigurationElementSchema FindSchema(string path)
        {
            var index = path.IndexOf(Path, StringComparison.Ordinal);
            if (index != 0)
            {
                return null;
            }

            if (this.Path.Length != 0)
            {
                if (path.Length != this.Path.Length && path[this.Path.Length] != '/')
                {
                    return null;
                }
            }

            if (path == Path)
            {
                return this;
            }

            foreach (ConfigurationElementSchema child in ChildElementSchemas)
            {
                var result = child.FindSchema(path);
                if (result != null)
                {
                    return result;
                }
            }

            return this.CollectionSchema?.FindSchema(path);
        }
    }