Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Obtaining correct method signature
Message
From
31/10/2008 06:28:42
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Obtaining correct method signature
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01358583
Message ID:
01358583
Views:
62
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.Collections.Generic;

public class MainClass
{
    static string GetSignature(Type xTheType, string method)
    {
        var xModule = xTheType.Module;
        var xTheMethod = xTheType.GetMethod(method);
        return xTheMethod.ToString();
    }

    public static void Main()
    {
        // Observed: Void Test(System.Object, System.Collections.Generic.List`1[System.String])
        // Expected: public void Test(object p1, List<string> p2)
        // or some other syntactically correct signature
        Console.WriteLine(GetSignature(typeof(MainClass), "Test"));
    }

    public void Test(object p1, List<string> p2)
    {
    }
}
Andrus
Reply
Map
View

Click here to load this message in the networking platform