Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Obtaining correct method signature
Message
De
31/10/2008 06:28:42
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Obtaining correct method signature
Versions des environnements
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01358583
Message ID:
01358583
Vues:
61
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
Répondre
Fil
Voir

Click here to load this message in the networking platform