Как создать псевдоним класса System Constants
IDE: C # .net, winforms VS 2010
У меня есть класс SystemConstants.cs
Как показано ниже:
public class SystemConstants
{
//String Constants
public const string Hello = "Hello";
public const string Youth = "Youth";
}
И есть Form1.cs
Теперь в form1.cs
txtbox1.text = SystemConstants.Hello;
txtbox2.text = SystemConstants.Youth;
Теперь я хочу знать, есть ли какие-то, почему вместо того, чтобы писать
SystemConstants.Hello; //I want to avoid writing class name or I want to use alias for class name
Like this SystemConstants alias sc;
txtbox1.text = sc.Hello;