internal ILayoutElement CreateElement(XmlElement Xml, ILayoutElement Parent)
        {
            string Key = Xml.NamespaceURI + "#" + Xml.LocalName;

            if (!elementTypes.TryGetValue(Key, out ILayoutElement E))
            {
                throw new LayoutSyntaxException("Layout element not recognized: " + Key);
            }

            ILayoutElement Result = E.Create(this, Parent);

            Result.FromXml(Xml);

            return(Result);
        }
示例#2
0
        internal ILayoutElement CreateElement(XmlElement Xml, ILayoutElement Parent)
        {
            string Key = Xml.NamespaceURI + "#" + Xml.LocalName;

            if (!elementTypes.TryGetValue(Key, out ILayoutElement E))
            {
                throw new LayoutSyntaxException("Layout element not recognized: " + Key);
            }

            ILayoutElement Result = E.Create(this, Parent);

            Result.FromXml(Xml);

            if (!(Result.IdAttribute is null) &&
                Result.IdAttribute.TryEvaluate(this.session, out string Id) &&
                !string.IsNullOrEmpty(Id))
            {
                this.AddElementId(Id, Result);
            }

            return(Result);
        }