Finding the protocol that a component is in (not the top level protocol)

Hi All,

I was wondering if it is possible for a component to determine what protocol/component it is directly in.  This can be different than the top level protocol name that I can pull from the global context.  My use case is for a logging component.  We want to be able to drag a logging component into a protocol and automatically log the usage by the name of that protocol.  It works fine until the logging component is in a protocol and this component is used inside another protocol.  Then the protocol name in the global context is that of the top level protocol that is running.  Is there a way to determine what protocol is directly the parent of a component?  We can do this by manually entering the name of the component in the logging component, but it would be nice if this weren't needed.

My current work is in C#, but if this can work in PilotScript, then that would be great as well.

Thanks!

--Jonathan