FieldInfo有一個IsStatic成員,但PropertyInfo沒有。我假設我只是忽略了我需要的東西。 Type type = someObject.GetType();
foreach (PropertyInfo pi in type.GetProperties())
{
// umm... Not sure how to tell if this property is
有鑑於此: Interface IBase {string X {get;set;}}
Interface ISuper {string Y {get;set;}}
class Base : IBase {etc...}
class Super : Base, ISuper {etc...}
void Questionable (Base b) {
Console.Write