Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# - shorten function calls

I have a .dll file from which I call functions in another program, however calling a single function ends up looking like this:

Example:

KeySim.KeySim.Basic.KEY_E();

I cannot modify the nesting of the classes as the program ceases to work. I was wondering if there was any other way to shorten the code calling the functions

Note:

Keysim is the namespace, Keysim is the main class and Basic is a nested class

like image 611
David Searle Avatar asked Dec 20 '22 02:12

David Searle


1 Answers

Try using Alias with the using keyword:

using Basic = KeySim.KeySim.Basic;

Then you should be able to call your function as:

Basic.KEY_E();
like image 97
Ludovic Feltz Avatar answered Dec 26 '22 00:12

Ludovic Feltz