Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は一連のプロパティを持っています。privateそれらのいくつかにはセッターがあり、いくつかにはinternalセッターがあります。実行時にプロパティのセッターが存在するかどうかを確認する方法はありますinternalか?
private
internal
リフレクションを使用してこの情報を取得できます。
var myType = obj.GetType(); var setMethod = myType.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) .GetSetMethod(true); bool isInternalSetter = setMethod != null && setMethod.IsAssembly;