Custom Bake behaviour for a Grasshopper Component

I’m making a set of components in Grasshopper and as part of it I am generating extrusions from curves. I’d like to implement a custom bake behaviour inside of the component so that when selecting Bake from the menu it bakes the modified curve that the component creates. I haven’t been able to bake anything from any of my components yet and I haven’t found any code or samples that would indicate how, does anyone have any ideas on how to implement this?

If its a component, override the BakeGeometry() methods.

If its a parameter, either implement the IGH_BakeAwareObject interface, or override the BakeGeometry() method if you’re deriving from Param_Geometry