How to use the DSldWorksEvents_CommandOpenPreNotifyEventHandler event

Does anybody know how to use the DSldWorksEvents_CommandOpenPreNotifyEventHandler event. How would I register for it (using the 2011 C# API)? The reference doument is showing a code sample:

  swAppSW.CommandOpenPreNotify += this.swAppSW_CommandOpenPreNotify;
            swAppSW.CommandCloseNotify +=
this.swAppSW_CommandCloseNotify;

Where swAppSW is of type SldWorks? Makes no sense to me. SldWorks is a namespace. Can't find CommandOpenPreNotify anywhere in the namespaces.

Any ideas?

SolidworksApi macros