	namespace Scope#{ThisName}Event_#{DelegateName}
	{
		typedef void (MYGUICALLBACK *ExportHandle)(
			Convert<#{OriginalTypeName1}>::Type ,
			Convert<#{OriginalTypeName2}>::Type ,
			Convert<#{OriginalTypeName3}>::Type ,
			Convert<#{OriginalTypeName4}>::Type );
		ExportHandle mExportHandle = nullptr;
		
		void OnEvent(
			#{OriginalTypeName1} #{ValueName1} ,
			#{OriginalTypeName2} #{ValueName2} ,
			#{OriginalTypeName3} #{ValueName3} ,
			#{OriginalTypeName4} #{ValueName4} )
		{
			mExportHandle(
				Convert<#{OriginalTypeName1}>::To( #{ValueName1} ) ,
				Convert<#{OriginalTypeName2}>::To( #{ValueName2} ) ,
				Convert<#{OriginalTypeName3}>::To( #{ValueName3} ) ,
				Convert<#{OriginalTypeName4}>::To( #{ValueName4} ) );
		}
		
		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< MyGUI::#{ThisType}* >(_widget)->event#{DelegateName} += MyGUI::newDelegate(OnEvent);
			else
				static_cast< MyGUI::#{ThisType}* >(_widget)->event#{DelegateName} -= MyGUI::newDelegate(OnEvent);
		}
	}
