EventManager.Attach(EventHook.MyEvent) was called and if it is : we look for a EventManager.TriggerEvent(EventHook.MyEvent) to check if the generic version was properly used or not (because there is a non-generic version and a generic one)RegisterCompilationStartAction , RegisterOperationAction with 2 pass (to collects TriggerEvent functions and Attach functions) then displaying the error using RegisterCompilationEndAction