views:

48

answers:

2

I'm introspecting on the code in a project using EnvDTE, and I want to be able to determine if they're a partial class, but it doesn't seem to exist in the namespace. Does anyone know how to do this?

A: 

Hi John,

You can use the C# code model. Check this msdn article

Regards... Muse VSExtensions

Muse VSExtensions
? I've read that article before, but I still don't see where it says anything about determining if the class you're looking at in the code model is a partial or not. The only comment in that article about partials is in relation to how setting elements works (or doesn't) in a partial context.
Paul
A: 

This should help you out

if(codeClass.ClassKind == vsCMClassKind.vsCMClassKindPartialClass)
{
   // It is a partial class
}
Phill Duffy
wow, can't believe I missed that. Thanks!
Paul
my pleasure, there seems to only be a handful of us in this space
Phill Duffy