Search code examples
.netoxygene

Namespace aliases in Oxygene


Is there a way to use namespace aliases in Oxygene .net?

ie: Whats the Oxygene equivalent of the C# code using someOtherName = System.Timers.Timer; ?


Solution

  • Yes that is possible, just define it like you would define a type. For example:

    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.