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)); }
/// <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); }
public ParsedGenerator ChangeSource(string newSource) { var newGenerator = new ParsedGenerator(Method, newSource, _genericParameters, _services); return(newGenerator); }