共用方式為


IVsSccManager2.GetSccGlyph Method

This method is called by projects to discover the source control glyphs to use on files and the files' source control status; this is the only way to get status.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'宣告
Function GetSccGlyph ( _
    cFiles As Integer, _
    rgpszFullPaths As String(), _
    <OutAttribute> rgsiGlyphs As VsStateIcon(), _
    <OutAttribute> rgdwSccStatus As UInteger() _
) As Integer
'用途
Dim instance As IVsSccManager2
Dim cFiles As Integer
Dim rgpszFullPaths As String()
Dim rgsiGlyphs As VsStateIcon()
Dim rgdwSccStatus As UInteger()
Dim returnValue As Integer

returnValue = instance.GetSccGlyph(cFiles, _
    rgpszFullPaths, rgsiGlyphs, rgdwSccStatus)
int GetSccGlyph(
    int cFiles,
    string[] rgpszFullPaths,
    VsStateIcon[] rgsiGlyphs,
    uint[] rgdwSccStatus
)
int GetSccGlyph(
    [InAttribute] int cFiles, 
    [InAttribute] array<String^>^ rgpszFullPaths, 
    [OutAttribute] array<VsStateIcon>^ rgsiGlyphs, 
    [OutAttribute] array<unsigned int>^ rgdwSccStatus
)
abstract GetSccGlyph : 
        cFiles:int * 
        rgpszFullPaths:string[] * 
        rgsiGlyphs:VsStateIcon[] byref * 
        rgdwSccStatus:uint32[] byref -> int 
function GetSccGlyph(
    cFiles : int, 
    rgpszFullPaths : String[], 
    rgsiGlyphs : VsStateIcon[], 
    rgdwSccStatus : uint[]
) : int

Parameters

  • cFiles
    Type: System.Int32
    [in] Count of files. It should be greater than 0 if there are files under source code control. Currently, the environment supports only a count of 1.
  • rgpszFullPaths
    Type: array<System.String[]
    [in] Array of paths to files; cannot be nulla null reference (Nothing in Visual Basic).
  • rgdwSccStatus
    Type: array<System.UInt32[]
    [out] Specifies status for corresponding rgpszFullPaths entry. For a list of possible values, see File Status Code Enumerator. This parameter can be nulla null reference (Nothing in Visual Basic).

Return Value

Type: System.Int32
The method returns S_OK if at least one of the files is controlled, S_FALSE if none is controlled.

Remarks

COM Signature

From ivssccmanager2.idl

HRESULT GetSccGlyph(
   [in] int cFiles,
   [in, size_is(cFiles)] const LPCOLESTR rgpszFullPaths[],
   [out, size_is(cFiles)] VsStateIcon rgsiGlyphs[],
   [out, size_is(cFiles)] DWORD rgdwSccStatus[]
);

This method is called by projects to discover the source control glyphs to use on files. When a project first opens at startup, it calls this method to get the glyphs for the project. After startup, the environment provides glyphs to the project using SccGlyphChanged. The glyphs are denoted by the environment's icon index (VsStateIcon enumeration).

How This Method is Used by Projects

The source control status per file is also optionally returned; however, projects are encouraged to use the glyphs, but not to cache source control status. Call this method each time status is needed, rather than maintaining your own record of status bits.

When the project receives the GetProperty method (VSHPROPID_StateIconIndex) call from the environment, it should call GetSccGlyph for the appropriate file or files for the VSITEMID specified in that call. The project does not need to store the returned state icon—the environment will store it. It is important to note that a project is allowed to call GetSccGlyph when called by the environment with GetProperty, but when it is called by SccGlyphChanged, the project is handed the glyphs and does not need to call GetSccGlyph again. The project can immediately pass the given glyphs to the environment using the SetProperty method, unless the parameters to SccGlyphChanged are nulla null reference (Nothing in Visual Basic). In this case, the project should call the environment for all of the VSITEMID s in the project.

Be aware of the following:

  • If a file is under source control, the SCC_STATUS_CONTROLLED flag is set.

  • If the current user checks out a file into the designated working directory, the SCC_STATUS_CHECKEDOUT flag is set.

.NET Framework Security

See Also

Reference

IVsSccManager2 Interface

IVsSccManager2 Members

Microsoft.VisualStudio.Shell.Interop Namespace