Exemplo n.º 1
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();
            }
Exemplo n.º 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);
            }
Exemplo n.º 3
0
 public IEnumerable <MethodSpecifier> GetMethods(ReflectionProviderMethodQuery query)
 => memoizedGetMethods(query);