fork download
  1. using System;
  2. using System.Linq;
  3. using System.Reflection;
  4.  
  5. sealed class Test {
  6. public static void Main() {
  7. var explicitProperties =
  8. from prop in
  9. typeof(SomeClass)
  10. .GetProperties(
  11. BindingFlags.NonPublic
  12. | BindingFlags.Instance
  13. )
  14. let getAccessor = prop.GetGetMethod(true)
  15. where getAccessor.IsFinal && getAccessor.IsPrivate
  16. select prop;
  17.  
  18. foreach (var p in explicitProperties)
  19. Console.WriteLine(p.Name);
  20. }
  21. }
  22.  
  23. sealed class SomeClass : ISomeInterface {
  24. string ISomeInterface.SomeProperty { get; set; }
  25. }
  26.  
  27. interface ISomeInterface {
  28. string SomeProperty { get; set; }
  29. }
Success #stdin #stdout 0.01s 29800KB
stdin
Standard input is empty
stdout
ISomeInterface.SomeProperty