예제 #1
0
        public MethodItem Make(PathInfo searchPath, TypeMethodInfo genericMethod)
        {
            var newMethod    = genericMethod.MakeGenericMethod(searchPath);
            var newGenerator = new ParsedGenerator(newMethod, SourceCode, _genericParameters, _services);

            return(new MethodItem(newGenerator, newMethod));
        }
예제 #2
0
        /// <summary>
        /// Adds the method defined by its raw C# source code (those that doesn't contain
        /// any additional brackets,..)
        /// </summary>
        /// <param name="methodPath">The method path.</param>
        /// <param name="rawCode">The raw code.</param>
        /// <param name="description">The description of method signature.</param>
        /// <returns>TestingAssembly.</returns>
        public TestingAssembly AddMethodRaw(string methodPath, string rawCode, MethodDescription description)
        {
            var methodInfo        = buildDescription(description, methodPath);
            var genericParameters = new PathInfo(methodPath).GenericArgs;

            var method = new ParsedGenerator(methodInfo, rawCode, genericParameters, TypeServices);

            addMethod(method, methodInfo, description.Implemented);

            return(this);
        }
예제 #3
0
        public ParsedGenerator ChangeSource(string newSource)
        {
            var newGenerator = new ParsedGenerator(Method, newSource, _genericParameters, _services);

            return(newGenerator);
        }