Is it possible to have a method in a base class to modify a derived class' properties? I was thinking something like this:
public class baseclass
{
public void changeProperties(string propertyName, string newValue)
{
try
{
this.propertyName = newValue;
}
catch
{
throw new NullReferenceException("Property doesn't exist!");
}
}
}
Aucun commentaire:
Enregistrer un commentaire