private void CollectDirectlyUsedBy(MethodData method) { method.GetReferencedMethods().Cast<IMemberData>().ForEach(this.Collect); this.methodsByBases[method].Cast<IMemberData>().ForEach(this.Collect); var generic = method.GetGenericDefinition(); if (generic != null) this.Collect(generic); var propertyOrEvent = method.DeclaringMember; if (propertyOrEvent != null) this.Collect(propertyOrEvent); }