共用方式為


VCFilter.SourceControlFiles Property

Gets or sets a value indicating whether files added to the filter are automatically placed under source code control.

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

Syntax

'宣告
Property SourceControlFiles As Boolean
    Get
    Set
bool SourceControlFiles { get; set; }
property bool SourceControlFiles {
    bool get ();
    void set (bool value);
}
abstract SourceControlFiles : bool with get, set
function get SourceControlFiles () : boolean
function set SourceControlFiles (value : boolean)

Property Value

Type: System.Boolean
true if files are placed under source code control; otherwise, false.

Remarks

By default, all files added to a project under source code control are expected to be automatically added to source code control as well. An exception would be when you want to add generated files, such as the .c files generated by MIDL, to the project to get them built during a build. Such generated files do not belong under source code control.

See How to: Compile Example Code for Project Model Extensibility for information about how to compile and run this example.

Examples

The following example uses SourceControlFiles in the integrated development environment (IDE):

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

Public Module Module1
    Sub Test()
        Dim mycollection As IVCCollection
        Dim filter As VCFilter
        Dim prj As VCProject
        prj = DTE.Solution.Projects.Item(1).Object
        mycollection = prj.Filters
        ' mycollection.Count has count of files
        filter = mycollection.Item(1)
        MsgBox(filter.SourceControlFiles)
    End Sub
End Module

.NET Framework Security

See Also

Reference

VCFilter Interface

Microsoft.VisualStudio.VCProjectEngine Namespace