public IEnumerable <MethodSpecifier> GetMethods(ReflectionProviderMethodQuery query)
        {
            IEnumerable <IMethodSymbol> methodSymbols;

            // Check if type is set (no type => get all methods)
            if (!(query.Type is null))
            {
                // Get all methods of the type
                ITypeSymbol type = GetTypeFromSpecifier(query.Type);

                if (type == null)
                {
                    return(new MethodSpecifier[0]);
                }

                methodSymbols = type.GetMethods();
            }
Beispiel #2
0
        public IEnumerable <MethodSpecifier> GetMethods(ReflectionProviderMethodQuery query)
        {
            IEnumerable <IMethodSymbol> methodSymbols;

            // Check if type is set (no type => get all methods)
            if (!(query.Type is null))
            {
                // Get all methods of the type
                ITypeSymbol type = GetTypeFromSpecifier(query.Type);

                if (type == null)
                {
                    return(new MethodSpecifier[0]);
                }

                methodSymbols = type.GetMethods();

                var extensions = extensionMethods.Where(m => type.IsSubclassOf(m.Parameters[0].Type)).ToList();

                // Add applicable extension methods
                methodSymbols = methodSymbols.Concat(extensions);
            }
Beispiel #3
0
 public IEnumerable <MethodSpecifier> GetMethods(ReflectionProviderMethodQuery query)
 => memoizedGetMethods(query);