有没有办法在 Oxygene .net 中使用命名空间别名?
即:C# 代码的 Oxygene 等价物是什么
using someOtherName = System.Timers.Timer;
?
是的,这是可能的,只需像定义类型一样定义它。例如:
namespace ConsoleApplication37;
interface
type
ConsoleApp = class
public
class method Main(args: array of String);
end;
someOtherName = System.Timers.Timer;
implementation
class method ConsoleApp.Main(args: array of String);
begin
var t1 := new someOtherName;
end;
end.