Udostępnij za pośrednictwem


Właściwość VCCLCompilerTool.KeepComments —

Pobiera lub ustawia wartość określającą, czy pomijać gazy komentarz z kodu źródłowego.KeepCommentsOpisuje funkcje kompilatora /C (Zachowaj komentarze podczas wstępnego przetwarzania) opcji.

Przestrzeń nazw:  Microsoft.VisualStudio.VCProjectEngine
Zestaw:  Microsoft.VisualStudio.VCProjectEngine (w Microsoft.VisualStudio.VCProjectEngine.dll)

Składnia

'Deklaracja
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)

Wartość właściwości

Typ: System.Boolean
true Jeśli gazy komentarz z kodu źródłowego jest pomijane; w przeciwnym razie false.

Przykłady

Zobacz Jak: kompilowania przykładowy kod do projektu modelu rozszerzalności informacje na temat skompilować i uruchomić ten przykład.

Poniższy przykład modyfikuje KeepComments właściwość w zintegrowane środowisko programistyczne (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

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

VCCLCompilerTool Interfejs

Przestrzeń nazw Microsoft.VisualStudio.VCProjectEngine