get template of a document

hi,
i develop an addin project. i want to find the template of a 
document when document is opened. i could catch event when a 
document activated with below event handler. 

public void WindowActivated(EnvDTE.Window gotFocus, EnvDTE.Window 
lostFocus){

gotFocus.Document.  

in the event handler, i want to determine template kind of document.
I used gotFocus.Document.Kind property ,but it returns same result 
for different templates.

how can i find out document's template kind
Thanks...


Answer this question

get template of a document

  • Terrence Nevins

    Hello sgunay,

    I didn't know you were posting so much here. I think you will have to put some kind of "identifying mark" in the template, or base it on a special class, and use the codeelement stuff in DTE to see which one it might be.

    Also, regarding some of your previous questions about the root designer. Some of your problems may arise from using usercontrol as your root component. The shape library did not do this, I think. In our root designers we use our own IComponent class as the root component, so we don't have to worry about any conflicts with the MS control code, or MS designer code. Everything works fine.

    Nice to see Shawn Burke posting here now.

    Regards,
    Frank Hileman

  • badandy

    I don't think there is any way to do this.
  • get template of a document