I am dynamically generating C # code using CodeDom. I want to declare a type alias in a namespace. Sort of:
namespace MyNameSpace
{
using Timer = System.Threading.Timer;
...
}
I can create a namespace, but I donβt know how to create a type alias. Code so far:
CodeCompileUnit unitCompile = new CodeCompileUnit();
CodeNamespace nsScript = new CodeNamespace("MyNamespace");
unitCompile.Namespaces.Add(nsScript);
How to add "using timer = System.Threading.Timer;" into the namespace?
source
share