C # - shortening function calls

I have a file .dll

from which I call functions in another program, however, one function call ends up like this:

Example:

KeySim.KeySim.Basic.KEY_E();

      

I cannot change the nesting of the classes as the program stops working. I was wondering if there is another way to shorten the code calling functions

Note:

Keysim

is namespace, Keysim

is main class, and Basic

is nested class

+3


source to share


1 answer


Try using Alias

with the keyword using

:

using Basic = KeySim.KeySim.Basic;

      



Then you can call your function like this:

Basic.KEY_E();

      

+9


source







All Articles