/// <summary>The do parse.</summary>
/// <param name="element">The element.</param>
/// <param name="parserContext">The parser context.</param>
/// <param name="builder">The builder.</param>
protected override void DoParse(XmlElement element, ParserContext parserContext, ObjectDefinitionBuilder builder)
{
var connectionFactoryRef = element.GetAttribute(CONNECTION_FACTORY_ATTRIBUTE);
// At least one of 'templateRef' or 'connectionFactoryRef' attribute must be set.
if (string.IsNullOrWhiteSpace(connectionFactoryRef))
{
parserContext.ReaderContext.ReportFatalException(element, "A '" + CONNECTION_FACTORY_ATTRIBUTE + "' attribute must be set.");
}
if (!string.IsNullOrWhiteSpace(connectionFactoryRef))
{
// Use constructor with connectionFactory parameter
builder.AddConstructorArgReference(connectionFactoryRef);
}
var attributeValue = element.GetAttribute(AUTO_STARTUP_ATTRIBUTE);
if (!string.IsNullOrWhiteSpace(attributeValue))
{
builder.AddPropertyValue("AutoStartup", attributeValue);
}
}