Autodesk Mudbox 2013 SDK Documentation > Event Handling > File Event Handling >

# Writing a File Event Handler Plug-in

To write a file event handler plug-in you have to create a singleton class that derives from Node, and overrides the method Node::OnNodeEvent(). This class would typically have an attribute of type aptr<FileEventNotifier> which acts as an event receiver. You would next connect the attribute to the Kernel::FileEvent transmitter. For example:

    // There will be one global instance of our class, which catches all the file events.
    FileEventHandler g_cHandler;

    // One time initialization. This is a static function.
    void FileEventHandler::Initializer( void )  {
        g_cHandler.m_pEvent.Connect( Kernel()->FileEvent );
    };

For more information see the file event handler example project.