Can I open a class from another .net namespace as a class in my namespace?

Is it possible to open a class from another .net namespace as a class in my namespace? I use the class - antlr.collections.AST - as the return type for a function that belongs to a class in my namespace; as a result, the user must have

using antlr.collections;
using myNamespace;

at the top of my files to use my function. Can I make myNamespace.AST an alias for antlr.collections.AST, so the user must have

using myNamespace;

at the top of your files?

+3
source share
6 answers

, . , , antlr.collections.Foo antlr.collections.Bar .

"" ( ), , , antlr.collections.

, , , , . DAL, SubSonic, DAL, SubSonic. (, , .)

- , . - . , , , ... , , , . , .

+4

? :

namespace MyForms {
    class Class1 : Some.Other.Namespace.Class1 {
        // ...
    }
}
+2

, . , ..

, , - .

+2

, .

.

+1

, .

, , , , , , - antir.collections( , , , ). StackOverflow.com, , , "" ?

+1

- antlr.collections.AST.

You can use Adapter for this purpose.

+1
source

Source: https://habr.com/ru/post/1697566/


All Articles