开发者

Alias name for Method

开发者 https://www.devze.com 2023-01-15 17:27 出处:网络
Hi there i am creating some classes and methods for my project so that it can be used over and over now the problem is this that is has lots of functions in these dlls. i want to give them some name

Hi there i am creating some classes and methods for my project so that it can be used over and over

now the problem is this that is has lots of functions in these dlls. i want to give them some name as开发者_开发知识库 alias name so that user can easily find and call these function as per their requirements ..

is there any way to call a function with two or more name . if any one please give me ans....

Thanks


In what language?

In C#, creating an alias to a method is as easy as:

public class Demo
{
    public int SomeMethodHere(string argument)
    {
        // Code here.
    }

    public int AliasToSomeMethod(string argument)
    {
        return this.SomeMethodHere(argument);
    }
}


Do the functions need to be overridable?

If not just have another function call the alias that calls the main function.

0

精彩评论

暂无评论...
验证码 换一张
取 消