title: C# loop on each event internal to declaring class
body: <p>I've seen code like this someplace.</p>
  
  <p>Ideally I'd like a loop like this to accommodate this Func event type.</p>
  
  <pre><code>public static event Func&lt;RecentDirectories, DirectoryInfo, Exception, bool&gt; ContinueOnExceptionEvent;
  
  /// &lt;summary&gt;
  /// Determine if the loop should continue on a general exception not already handled
  /// in the loop's catch statement.
  /// &lt;/summary&gt;
  /// &lt;param name="dir"&gt;&lt;/param&gt;
  /// &lt;param name="e"&gt;&lt;/param&gt;
  /// &lt;returns&gt;True continues loop, false rethrows the exception&lt;/returns&gt;
  protected virtual bool TryContinueOnException(DirectoryInfo dir, Exception ex)
  {
      if (!Aborted) // check if thread aborted before doing event
      {
          if (null != ContinueOnExceptionEvent)
          {
              // foreach line doesn't compile because 
              // ContinueOnExceptionEvent doesn't have a GetEnumerator()
              foreach (var e in ContinueOnExceptionEvent)
              {
                  if (e(this, dir, ex))
                  {
                      return true;
                  }
              }
          }
      }
  
      return false;
  }
  </code></pre>
  
  <p>How do I get the foreach to get all the events and iterate on them?</p>