How to get syntactically correct signature which compiles for code template
grneration ?
I tried code below but it creates syntactically incorrect signature.
Andrus.
using System;
using System.Collecti ons.Generic;
public class MainClass
{
static string GetSignature(Ty pe xTheType, string method)
{
var xModule = xTheType.Module ;
var xTheMethod = xTheType.GetMet hod(method);
return xTheMethod.ToSt ring();
}
public static void Main()
{
// Observed: Void Test(System.Obj ect,
System.Collecti ons.Generic.Lis t`1[System.String])
// Expected: public void Test(object p1, List<stringp2)
// or some other syntactically correct signature
Console.WriteLi ne(GetSignature (typeof(MainCla ss), "Test"));
}
public void Test(object p1, List<stringp2)
{
}
}
Comment