/// <summary> /// Ensure the prototype is well-formed. /// </summary> private MarkupControlInstance VerifyPrototype(MarkupNode node) { if (node is MarkupControlInstance) { return (MarkupControlInstance) node; } if (node is MarkupElementCollection) { // There should be only one non-whitespace node in the collection. try { MarkupElement element = ((MarkupElementCollection) node) .Single(item => !item.IsWhiteSpace()); if (element is MarkupControlInstance) { return (MarkupControlInstance) element; } } catch (InvalidOperationException) { } } throw new CompilerException( "A control's <prototype> must be a single instance of a QuickUI control class."); }
private string EmitBaseClassProperty(string propertyName, MarkupNode propertyValue, int indentLevel) { return Template.Format( "{Tabs}\"{PropertyName}\": {PropertyValue}", new { Tabs = Tabs(indentLevel), PropertyName = propertyName, PropertyValue = propertyValue.JavaScript(indentLevel) }); }