public override IEnumerable<IComponentRegistration> GetComponentRegistrations(ITreeNode registrationRootElement)
{
// ReSharper does not currently match generic and non-generic overloads separately, meaning that Register<T> and Register(typeof(T))
// will be both matched with a single pattern Register($arguments$).
// Therefire I am using this pattern to look for both generic and non-generic (with typeof) overloads of the pattern
IStructuralMatchResult match = Match(registrationRootElement);
if (match.Matched)
{
var invocationExpression = match.MatchedElement as IInvocationExpression;
if (invocationExpression == null)
{
yield break;
}
if (invocationExpression.TypeArguments.Any())
{
foreach (var registration in FromGenericArguments(invocationExpression))
{
yield return registration;
}
}
else
{
foreach (var registration in FromArguments(invocationExpression))
{
yield return registration;
}
}
}
}