protected override IEnumerable<FilteredRegistrationBase> DoCreateRegistrations(ITreeNode registrationRootElement, IStructuralMatchResult match)
{
var arguments = match.GetMatchedElementList("arguments").Cast<ICSharpArgument>();
foreach (var argument in arguments)
{
// match typeof() expressions
var typeOfExpression = argument.Value as ITypeofExpression;
if (typeOfExpression != null)
{
var argumentType = typeOfExpression.ArgumentType as IDeclaredType;
if (argumentType != null)
{
var typeElement = argumentType.GetTypeElement();
if (typeElement == null) // can happen if the typeof() expression is empty
{
yield break;
}
yield return new ServiceRegistration(registrationRootElement, typeElement);
}
}
}
}