namespace Scope#{ThisName}Event_#{DelegateName} { typedef void (MYGUICALLBACK *ExportHandle)( #{OriginalTypeName1}); ExportHandle mExportHandle = nullptr; void OnEvent( #{OriginalTypeName1} #{ValueName1}) { mExportHandle( #{ValueName1}); } MYGUIEXPORT void MYGUICALL Export#{ThisName}Event_Delegate#{DelegateName}(ExportHandle _delegate) { mExportHandle = _delegate; } MYGUIEXPORT void MYGUICALL Export#{ThisName}Event_Advise#{DelegateName}(MyGUI::Widget* _widget, bool _advise) { if (_advise) static_cast(_widget)->event#{DelegateName} += MyGUI::newDelegate(OnEvent); else static_cast(_widget)->event#{DelegateName} -= MyGUI::newDelegate(OnEvent); } }