VCCodeStruct.IsTemplate Property

Definition

Gets if the object is a template.

C++/CX
public:
 property bool IsTemplate { bool get(); };

Property Value

true if the object is a template; otherwise, false.

Attributes

Examples

This example adds a class, as well as a template parameter to that class, and then displays the value returned by IsTemplate.

[Visual Basic]

Sub IsTemplateClass()  
   Dim vcCM As VCCodeModel  
   Dim vcClass As VCCodeClass  
   vcCM = DTE.Solution.Item(1).CodeModel  
   vcClass = vcCM.AddClass("MyTemplateClass", "MyTemplateClass.h")  
   vcClass.StartPoint().CreateEditPoint().Insert("template <class T> ")  
   vcCM.Synchronize()  
   MsgBox(vcClass.IsTemplate.ToString())  
End Sub  

Applies to

Produkt Versiounen
Visual Studio SDK 2015, 2017, 2019, 2022