Freigeben über


VCCLCompilerTool.KeepComments-Eigenschaft

Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob Kommentare aus dem Quellcode unterdrückt werden sollen. KeepComments macht die Funktionalität der Compileroption /C (Kommentare bei der Vorverarbeitung beibehalten) verfügbar.

Namespace:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

Syntax

'Declaration
Property KeepComments As Boolean
bool KeepComments { get; set; }
property bool KeepComments {
    bool get ();
    void set (bool value);
}
abstract KeepComments : bool with get, set
function get KeepComments () : boolean 
function set KeepComments (value : boolean)

Eigenschaftswert

Typ: Boolean
true, wenn das Entfernen von Kommentaren aus dem Quellcode unterdrückt wird, andernfalls false.

Beispiele

Siehe Gewusst wie: Kompilieren von Beispielcode für die Erweiterbarkeit von Projektmodellen zu Informationen darüber, wie dieses Beispiel kompiliert und ausgeführt wird.

Im folgenden Beispiel wird die Eigenschaft KeepComments in der integrierten Entwicklungsumgebung (IDE):

' add reference to Microsoft.VisualStudio.VCProjectEngine.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim prj As VCProject
        Dim cfgs, tools As IVCCollection
        Dim cfg As VCConfiguration
        Dim tool As VCCLCompilerTool
        prj = DTE.Solution.Projects.Item(1).Object
        cfgs = prj.Configurations
        cfg = cfgs.Item(1)
        tool = cfg.Tools("VCCLCompilerTool")
        tool.GeneratePreprocessedFile = preprocessOption.preprocessYes
        tool.KeepComments = True
    End Sub
End Module

.NET Framework-Sicherheit

Siehe auch

Referenz

VCCLCompilerTool Schnittstelle

Microsoft.VisualStudio.VCProjectEngine-Namespace