I have a base class car and some classes of children, such as a car, motorcycle, etc., inherited from the car. In each class of children, there is a Go () function; Now I want to register information about each vehicle when the Go () function is triggered, and in this log I want to know what kind of car it made.
Example:
public class vehicle
{
public void Go()
{
Log("vehicle X fired");
}
}
public class car : vehicle
{
public void Go() : base()
{
}
}
How can I find out in the Log function that the car called me during base ()? Thanks,
Omri
source
share