Simple question that I can't seem to wrap my head around. Say I want to save time/space when working with commonly used System classes and I want to assign an entire class/subclass such as System.Threading.Thread to a variable so that I can use the shortened Variable.ThreadMethod() whenever I want to use a method of the Thread class.
I though it was done with the following:
using test = System.Threading.Thread;
However this throws the "Invalid token 'using' in class, struct or interface declaration."
The context of what I am trying to do is the following:
using test = System.Threading.Thread;
public void Method()
{
test.Sleep(1000); //Same as System.Threading.Thread.Sleep(1000);
}
using System.Threading;and then justThread.Sleep(1000);, or to spell it out in full if necessary. Usingusinglike this is rare, and I wouldn't recommend it (characters are cheap, confusion is not).