public void BuildElement(ParsedDeclare element)
        {
            foreach (var builder in declareBuilders)
            {
                if (builder.IsBuildable(element))
                {
                    var e = builder.GetBuiltElement(element, model);
                    if (e == null)
                    {
                        throw new InvalidOperationException(string.Format("Element '{0}' was not pre-built during first stage.", e.Identifier));
                    }

                    BuildElement(element, e);
                    return;
                }
            }

            throw new NotImplementedException(string.Format("'{0}' is not yet supported",
                                                            element.GetType().Name));
        }
示例#2
0
        /// <summary>
        /// Build the elements corresponding to the parsed declare. This does not handle the attributes, which
        /// will be handled by the second stage builder.
        /// </summary>
        /// <returns>The element corresponding to the declared element.</returns>
        /// <param name="element">The parsed declare element.</param>
        public void BuildDeclare(ParsedDeclare element)
        {
            foreach (var builder in declareBuilders)
            {
                if (builder.IsBuildable(element))
                {
                    builder.BuildDeclare(element, model);
                    return;
                }
            }

            throw new BuilderException(string.Format("Parsed element '{0}' is not supported", element.GetType()),
                                       element.Filename, element.Line, element.Col);
        }