Field properties

Top  Previous  Next

What is translated > Properties > Field properties


There are properties in C# similar to properties in Delphi. The Delphi read and write access via properties become to get and set  property accessors in C#. The following example is taken from the Embarcadero documentation:




   THeading = 0..359;

   TCompass = class(TControl)


        FHeading: THeading;

        procedure SetHeading(Value: THeading);


        Property Heading: THeading read FHeading write SetHeading;

       // ...




public class TCompass : TControl


  private int /*0..359*/ FHeading;

  //# private void SetHeading(int /*0..359*/ Value);

  /*property Heading : THeading read FHeading write SetHeading;*/

  public int /*  0..  359*/ Heading




      return FHeading;







       // ...



C# also has e pendant to Delphi's default


This page belongs to the Delphi2C# Documentation

Delphi2C# home  Content