I'm not really sure what you're asking here. Are you asking how to modify your code to run as an EPDM add-in?
If you haven't already done so, I suggest you take a look at the Help. This is publicly available and gives examples of regular Enterprise add-ins and Enterprise Task add-ins. 2015 SOLIDWORKS API Help - Getting Started
You can find additional samples here: https://forum.solidworks.com/community/api/content?filterID=contentstatus%5Bpublished%5D~objecttype~objecttype%5Bdocument%5D