mardi 19 septembre 2017

Is it possible to mirror a method?

for example, there are bunch of overloads of method:

public void MyLongFunctionName(string arg1,...) ...
public void MyLongFunctionName(int arg1,...) ...
//.... many different argument types

To make a shortcut of that long function, i used i.e. my() :

public void my(string arg1,...) ...
public void my(int arg1,...) ...
....

however, is something like this possible to make my() as a shortcut of MyLongFunctionName() , without defining bunch of my() methods (like above) ?

for example, in PHP you can copy function, like :

$my = MyLongFunctionName(arg1, arg2....);
//execute
$my(arg1, arg2....)





Aucun commentaire:

Enregistrer un commentaire