My question is whether I can assign a static class to another variable (and of what type would that be) ?
Say I have
public static class AClassWithALongNameIDontWantTotType{
public static bool methodA() { stuff }
}
and then I have
class B{
}
Can I make it so that inside of class B
I can reassign this class to something with a shorter name, like:
SomeType a = AClassWithALongNameIDontWantTotType
and then be able to do
a.methodA()
?
I can get out a function by doing something like
Func<bool> a = AClassWithALongNameIDontWantTotType.methodA()
but I would prefer to have the whole class.
Thanks!
If you want this purely for the purpose of avoiding typing long names, you can use an alias
using a = SomeNamespace.AClassWithALongNameIDontWantToType;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With