I have a complex type in my program that results in very long line lengths. Here it is:
List<FruitCallback<Fruit>>
Here’s an example of where the line of code is simply too long and confusing:
private static Dictionary<Type, List<FruitCallback<Fruit>>> callbacks = new Dictionary<Type, List<FruitCallback<Fruit>>>();
I can create an alias for it by subclassing it like so:
class FruitCallbacks : List<SomeClass.FruitCallback<Fruit>> { }
But I could of sworn I remember reading somewhere about a way to alias something like this such that an empty class would not be necessary.
You can add a fully qualified
usingstatement to your class file (in the using directives section) to alias the class. It’s a bit verbose.And then you can
MyTypein place ofList<FruitCallback<Fruit>>in your code.Full working example.