protected override IEnumerable<FilteredRegistrationBase> DoCreateRegistrations(ITreeNode registrationRootElement, IStructuralMatchResult match)
{
var argument = match.GetMatchedElement("argument") as ICSharpArgument;
if (argument == null)
{
yield break;
}
var typeofExpression = argument.Value as ITypeofExpression;
if (typeofExpression != null)
{
var declaredType = typeofExpression.ArgumentType as IDeclaredType;
if (declaredType != null)
{
ITypeElement typeElement = declaredType.GetTypeElement();
if (typeElement != null)
{
// todo possible bug: same as in the generic variant. Currently works the same as As<T>.
yield return new ServiceRegistration(registrationRootElement, typeElement);
}
}
}
}