1
2
3
4
5
6
7
8
|
foreach (PropertyInfo prop in GetType().GetProperties()) // Gehe durch alle meine eigenen Properties
{
if (prop.PropertyType == typeof(string) && prop.CanWrite) // Wenn es sich um eine beschreibbare string-Property handelt,
{
prop.SetValue(this, string.Empty, null); // dann setze den Wert der Property auf string.Empty (mit null argumente)
}
}
|