Ejemplo n.º 1
0
        public MethodInspector(MethodDeclarationSyntax methodNode)
        {
            _methodName = methodNode.Identifier.Text;
            _returnType = new TypeInspector(methodNode.ReturnType).ShortName;

            var methodParams = new Dictionary<string, string>();
            foreach (ParameterSyntax parameterNode in methodNode.ParameterList.Parameters)
            {
                string name = parameterNode.Identifier.Text;
                string type = new TypeInspector(parameterNode.Type).ShortName;
                methodParams[name] = type;
            }
            _methodParams = new ReadOnlyDictionary<string, string>(methodParams);
        }
Ejemplo n.º 2
0
        public MethodInspector(MethodDeclarationSyntax methodNode)
        {
            _methodName = methodNode.Identifier.Text;
            _returnType = new TypeInspector(methodNode.ReturnType).ShortName;

            var methodParams = new Dictionary <string, string>();

            foreach (ParameterSyntax parameterNode in methodNode.ParameterList.Parameters)
            {
                string name = parameterNode.Identifier.Text;
                string type = new TypeInspector(parameterNode.Type).ShortName;
                methodParams[name] = type;
            }
            _methodParams = new ReadOnlyDictionary <string, string>(methodParams);
        }
Ejemplo n.º 3
0
        public MethodInspector(IMethodSymbol methodSymbol)
        {
            _methodName = methodSymbol.Name;
            INamedTypeSymbol returnTypeSymbol = methodSymbol.ReturnType as INamedTypeSymbol;
            _returnType = new TypeInspector(returnTypeSymbol).ShortName;

            var methodParams = new Dictionary<string, string>();
            foreach (IParameterSymbol parameter in methodSymbol.Parameters)
            {
                string name = parameter.Name;
                string type = new TypeInspector(parameter.Type).ShortName;
                methodParams[name] = type;
            }
            _methodParams = new ReadOnlyDictionary<string, string>(methodParams);
        }
Ejemplo n.º 4
0
        public MethodInspector(IMethodSymbol methodSymbol)
        {
            _methodName = methodSymbol.Name;
            INamedTypeSymbol returnTypeSymbol = methodSymbol.ReturnType as INamedTypeSymbol;

            _returnType = new TypeInspector(returnTypeSymbol).ShortName;

            var methodParams = new Dictionary <string, string>();

            foreach (IParameterSymbol parameter in methodSymbol.Parameters)
            {
                string name = parameter.Name;
                string type = new TypeInspector(parameter.Type).ShortName;
                methodParams[name] = type;
            }
            _methodParams = new ReadOnlyDictionary <string, string>(methodParams);
        }