This documentation is archived and is not being maintained.

SourceControlFiles Property

Visual Studio .NET 2003

Indicates whether files added to the folder will automatically be placed under source code control.

[Visual Basic .NET]
Public Property SourceControlFiles() As Boolean
[Visual Basic 6]
Property Get SourceControlFiles() As Boolean
Property Let SourceControlFiles( _
   ByVal NewValue As Boolean _
) 
[C++]
HRESULT __stdcall get_SourceControlFiles(
   /* [out, retval] */ VARIANT_BOOL* retVal
);
HRESULT __stdcall put_SourceControlFiles(
   /* [in] */ VARIANT_BOOL NewValue
);
[C#]
public bool SourceControlFiles {get; set;}
[JScript .NET]
public function get SourceControlFiles() : Boolean
public function set SourceControlFiles(
   NewValue : Boolean
)

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.

Example

The following sample code uses SourceControlFiles in the development environment:

' 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

See Samples for Project Model Extensibility for information on how to compile and run this sample.

See Also

Applies To: VCFilter Object

Show: