Is there a way in which a C# class can be given multiple names, eg:
class Foo{}
class AlternativeFooName refers to Foo
I want to be able to access Foo through both names, Foo and AlternativeFooName but without having to inherit from Foo.
An application for this would be giving a class a long descriptive name but开发者_运维问答 being able to abbreviate it when it is used, eg:
instead of Foo f= new Foo(); being able to use the following with the same effect: F f= new F();
the using directive applies to classes as well, for example:
using C = System.Console;
You can use a using statement, e.g.:
using Foo = My.Namespace.LongFoo;
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论