FindType.DumpProperties C# (CSharp) Method

DumpProperties() private method

private DumpProperties ( Type aType ) : void
aType Type
return void
  private void DumpProperties(Type aType)
  {
    if ( !ShowProperties )
      return;
         
    PropertyInfo[] pInfo = aType.GetProperties();
    myWriter.WriteLine("Properties");
      
    bool found = false;
      
    if ( pInfo.Length != 0 )
    {                                                       
      PropertyInfo curInfo = null;
                                   
      for ( int i=0; i < pInfo.Length; i++ )
      {
        curInfo = pInfo[i];
         
        //
        // Only display properties declared in this type.
        //          
        if ( curInfo.DeclaringType != aType )
        {
          continue;
        }
            
        found = true;
            
        String flags = null;
                   
        if ( curInfo.CanRead && curInfo.CanWrite )
        {
          flags = "get; set;";
        }
        else if ( curInfo.CanRead )
        {
          flags = "get";
        }
        else if ( curInfo.CanWrite )
        {
          flags = "set";
        }
           
        myWriter.WriteLine("  {0,-10} '{1}' ", curInfo, 
          flags);
      }
    }
      
    if ( !found )
    {
      myWriter.WriteLine("  (none)");
    }                 
  }