title: How can I override System.Type.GetProperties()?
body: <p>I would like to override the <a href="https://msdn.microsoft.com/en-us/library/aky14axb(v=vs.110).aspx" rel="nofollow"><code>System.Type.GetProperties()</code></a> method to return one specific property only, depending on logic determined at run time. For example, if I have this class:</p>
  
  <pre><code>class A
  {
      public int PropertyOne { get; set; }
      public int PropertyTwo { get; set; }
  }
  </code></pre>
  
  <p>and if I make this call:</p>
  
  <pre><code>var myProperties = typeof(A).GetProperties();
  </code></pre>
  
  <p>I would expect <code>myProperties</code> to contain only one <code>PropertyInfo</code> object.  This object would contain information about either <code>A.PropertyOne</code> or <code>A.PropertyTwo</code>, but not both, depending on runtime logic.</p>
  
  <p>I tried to create a type that derives from the abstract <code>System.Type</code> and to override <code>GetProperties()</code> in my derived class.  However, I always get a compile-time error:</p>
  
  <blockquote>
    <p>'MyNamespace.MyClass.GetProperties()': cannot override inherited member 'System.Type.GetProperties()' because it is not marked virtual, abstract, or override</p>
  </blockquote>
  
  <p>How can I overcome this error and override <code>GetProperties()</code> successfully?</p>