When you add Content Types with Synchronous (such as ItemAdding and ItemUpdating) or Asynchronous (such as ItemAdded and ItemUpdate) Event Receivers to a document library for example, you will sometimes notice some unwanted behaviour. Whenever the Content Type is added to the document library and Content Types is enabled, it will hit these Event Receivers immediatly. This is because the template behind the content type is also added in the hidden folder ‘Forms’. A simple codeline in the Event Receiver Methods can skip further method execution:
If properties.AfterUrl.StartsWith(properties.ListTitle & “/Forms/”) Then Exit Sub