FindType.DumpEvents C# (CSharp) Method

DumpEvents() private method

private DumpEvents ( Type aType ) : void
aType Type
return void
  private void DumpEvents(Type aType)
  {
    if ( !ShowEvents )
      return;
         
    EventInfo[] eInfo = aType.GetEvents( );
         
    myWriter.WriteLine("Events:");
    bool found = false;
      
    if ( eInfo.Length != 0 )
    {                                                    
      for ( int i=0; i < eInfo.Length; i++ )
      {        
        //
        // Only display events declared in this type.
        //          
        if ( eInfo[i].DeclaringType == aType )
        {
          found = true;
          myWriter.WriteLine("  {0}", eInfo[i]);
        }
      }
    }
      
    if ( !found )
    {
      myWriter.WriteLine("  (none)");
    }    
  }