共用方式為


VCCodeClass.IsTemplate Property

Definition

Gets a value indicating whether the VCCodeClass object is a template.

public:
 property bool IsTemplate { bool get(); };
public:
 property bool IsTemplate { bool get(); };
[System.Runtime.InteropServices.DispId(588)]
public bool IsTemplate { [System.Runtime.InteropServices.DispId(588)] get; }
[<System.Runtime.InteropServices.DispId(588)>]
[<get: System.Runtime.InteropServices.DispId(588)>]
member this.IsTemplate : bool
Public ReadOnly Property IsTemplate As Boolean

Property Value

true if the VCCodeClass 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  

Remarks

See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

Applies to