internal string Replace(Microsoft.CodeAnalysis.INamedTypeSymbol typeInfo) { if (ReplaceWith.StartsWith("{")) { var args = ReplaceWith.Substring(1, ReplaceWith.Length - 2).Split(' '); switch (args[0]) { case "typeparameter": return(TypeProcessor.ConvertType(typeInfo.TypeArguments.ElementAt(int.Parse(args[1])))); default: throw new Exception("Invalid parameter: " + args[0]); } } else { return(this.ReplaceWith); } }