class methods

Top  Previous  Next

What is translated > Types > Records, Classes, Interfaces > Class > class methods

Delphi class methods are similar to C# static methods, but there are two differences:

 

 

1.Delphi class methods can be virtual, C# static methods cannot.Therefore Delphi2C# has to use a tricky construction to reproduce this ability of Delphi.
2.In the defining declaration of a class method, the identifier Self represents the class where the method is called. In C# however inside of a static function there is no counterpart to Delphi's Self (this isn't defined her).

 

 

Therefore the two cases have to be distinguished at the translation of Delphi class methods to C# and Delphi's Self-instance requires additional treatment:

 

non virtual class methods

virtual class methods

Self instance

 

 

 



This page belongs to the Delphi2C# Documentation

Delphi2C# home  Content