There is no automation in the Class View, but maybe this helps you:
http://blogs.msdn.com/craigskibo/archive/2003/09/22/51662.aspx

Signature
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
>I have added a menuitem in the context menu to the
> Class View. Please, how can I know whether project or namespace is
> selected?
>
> Thanks, Olga.