internal void IncrementEvents()
 {
     if (m_events++ >= m_maxEvents)
     {
         throw new InvalidOperationException(TemplateStrings.MaxTemplateEventsExceeded());
     }
 }