I don\'t even know if it\'s called an alias, but let me continue anyway.
You know how the System.String type in C# is sorta \"aliased\" with \"string\"? In Visual S
string
is a convenience offered by the C# language to refer to the actual CLR type System.String
.
You can achieve similar results with a using
directive. At the top of the file where you'd like the name shortened, add this line:
using ShortName = Namespace.ReallyLongClassNameGoesHereOhGodWhy;
Then you can say ShortName myVar = new ShortName();
Note that you have to do this on a per file basis. You can't get the same coverage as string
with a single declaration.
You create an alias using:
using alias = LongClassName;
That alias is visible in the namespace where you declared it.
You can add a using
directive at the top of your file:
using Rppr = MyProjectNs.RelocatedPlantProductReleaseItem;
But it (only) works per file, not for a Project.
Try
using Rppr = SomeNamespace.RelocatedPlantProductReleaseItem;
Reference
try to add the following with your other usings
using Rppr = YourItemsNamespace.RelocatedPlantProductReleaseItem;
Use a using directive
using Rppr = Namespace.To.RelocatedPlantProductReleaseItem;
EDIT Op clarified to ask for a global solution.
There is no typedef
style equivalent in C# which can create a global replacement of a type name. You'll need to use a using directive in every file you want to have this abbreviation or go for the long version of the name.