Folgendes habe ich bisher getan:
var fields = typeof (Settings.Lookup).GetFields();
Console.WriteLine(fields[0].GetValue(Settings.Lookup));
// Compile error, Class Name is not valid at this point
Und das ist meine statische Klasse:
public static class Settings
{
public static class Lookup
{
public static string F1 ="abc";
}
}
propsanstelle vonfieldseinen zukünftigen Entwickler verwirren kann. Eigenschaften sind ihre eigenen Dinge, und Felder sind es definitiv nicht.