IVsSccManager2.GetSccGlyph Method (Int32, String, VsStateIcon, UInt32)
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.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int GetSccGlyph( int cFiles, string rgpszFullPaths, VsStateIcon rgsiGlyphs, uint rgdwSccStatus )
[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.
[in] Array of paths to files; cannot be null.
[out] Array of icons corresponding to rgpszFullPaths; cannot be null. See VsStateIcon for additional information.
[out] Specifies status for corresponding rgpszFullPaths entry. For a list of possible values, see File Status Code Enumerator. This parameter can be null.
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).
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 null. 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.