Monobjc.Tools.Generator.Parsers.Sgml.ElementDecl.CanContain C# (CSharp) Method

CanContain() public method

Tests whether this element can contain another specified element.
public CanContain ( string name, SgmlDtd dtd ) : bool
name string The name of the element to check for.
dtd SgmlDtd The DTD to use to do the check.
return bool
        public bool CanContain(string name, SgmlDtd dtd)
        {
            // return true if this element is allowed to contain the given element.
            if (this.m_exclusions != null)
            {
                foreach (string s in this.m_exclusions)
                {
                    if (string.Equals(s, name, StringComparison.OrdinalIgnoreCase))
                    {
                        return false;
                    }
                }
            }

            if (this.m_inclusions != null)
            {
                foreach (string s in this.m_inclusions)
                {
                    if (string.Equals(s, name, StringComparison.OrdinalIgnoreCase))
                    {
                        return true;
                    }
                }
            }
            return this.m_contentModel.CanContain(name, dtd);
        }