public AspectDefinition[] Match(Type targetType, AspectDefinitionCollection aspects)
{
// TODO: think about caches here...
ArrayList list = new ArrayList();
foreach (AspectDefinition aspect in aspects)
{
IClassMatcher matcher = ObtainClassMatcher(aspect);
if (matcher.Match(targetType, aspect))
{
list.Add(aspect);
}
}
return (AspectDefinition[]) list.ToArray(typeof (AspectDefinition));
}