You can look up for prefixed members, using reflection, by placing an asterisk after the prefix:
MemberInfo[] members = typeof(A).GetMember("hidden*", BindingFlags.NonPublic | BindingFlags.Instance); // members now contains three members: hiddenFlag1, hiddenFlag2 and hiddenMethod // ... public class A { private bool hiddenFlag1; private bool hiddenFlag2; private void hiddenMethod() { } private void reallyHiddenMethod() { } }
Cool. I didn’t know that.
Of course, it’s not VERY useful, other than encouraging building pseudo-interfaces (“Every method dealing with customers starts with ‘CU’!”) which are probably a bad idea, but still. Cool.
Very cool indeed!
Sometimes you just find the darnedest things in Reflector… :)