コード例 #1
0
        private bool IsEqualGeneric(IOccurence occurence)
        {
            var reference         = ((ReferenceOccurence)occurence).PrimaryReference;
            var elementTypeParams = TypeParameterUtil.GetResolvedTypeParams(reference.CurrentResolveResult.Result);

            return(new GenericSequenceEqualityComparer().Equals(elementTypeParams, _originTypeParams));
        }
コード例 #2
0
ファイル: RequestUtil.cs プロジェクト: emilol/Teapot
        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));
        }
コード例 #3
0
ファイル: RequestUtil.cs プロジェクト: emilol/Teapot
        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));
        }
コード例 #4
0
 private static IEnumerable <IEnumerable <IDeclaredType> > GetTypeParametersFromTypes(IEnumerable <IDeclaredType> types)
 {
     return(types.Select(x => TypeParameterUtil.GetResolvedTypeParams(x.Resolve())));
 }