1

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?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Paul
  • 35,689
  • 11
  • 93
  • 122

2 Answers2

3

This should help you out

if(codeClass.ClassKind == vsCMClassKind.vsCMClassKindPartialClass)
{
   // It is a partial class
}
Phill Duffy
  • 2,805
  • 3
  • 33
  • 45
0

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

Mosty Mostacho
  • 42,742
  • 16
  • 96
  • 123
BALKANGraph
  • 2,031
  • 1
  • 15
  • 16
  • ? 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 May 01 '10 at 13:09