private bool IsEqualGeneric(IOccurence occurence) { var reference = ((ReferenceOccurence)occurence).PrimaryReference; var elementTypeParams = TypeParameterUtil.GetResolvedTypeParams(reference.CurrentResolveResult.Result); return(new GenericSequenceEqualityComparer().Equals(elementTypeParams, _originTypeParams)); }
internal static SearchDeclaredElementUsagesRequest CreateRequest(IDataContext context, ICollection <DeclaredElementInstance> elements, ICollection <DeclaredElementInstance> initialTargets) { var searchDomain = SearchDomainContextUtil.GetSearchDomainContext(context) .GetDefaultDomain().SearchDomain; var typeParams = TypeParameterUtil.GetTypeParametersFromContext(context); return(new SearchGenericUsagesRequest(elements, initialTargets, searchDomain, typeParams)); }
public static SearchImplementationsRequest CreateRequest(IDataContext dataContext, DeclaredElementTypeUsageInfo element, DeclaredElementTypeUsageInfo initialTarget) { var originTypeElement = TypeParameterUtil.GetOriginTypeElement(dataContext, initialTarget); var searchDomain = SearchDomainContextUtil.GetSearchDomainContext(dataContext) .GetDefaultDomain().SearchDomain; var typeParams = TypeParameterUtil.GetTypeParametersFromContext(dataContext); return(new SearchGenericImplementationsRequest(element, originTypeElement, searchDomain, typeParams)); }
private static IEnumerable <IEnumerable <IDeclaredType> > GetTypeParametersFromTypes(IEnumerable <IDeclaredType> types) { return(types.Select(x => TypeParameterUtil.GetResolvedTypeParams(x.Resolve()))); }