Partager via


IVsSccManager2.GetSccGlyph(Int32, String[], VsStateIcon[], UInt32[]) Method

Definition

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.

public:
 int GetSccGlyph(int cFiles, cli::array <System::String ^> ^ rgpszFullPaths, cli::array <Microsoft::VisualStudio::Shell::Interop::VsStateIcon> ^ rgsiGlyphs, cli::array <System::UInt32> ^ rgdwSccStatus);
public:
 int GetSccGlyph(int cFiles, Platform::Array <Platform::String ^> ^ rgpszFullPaths, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VsStateIcon> ^ rgsiGlyphs, Platform::Array <unsigned int> ^ rgdwSccStatus);
int GetSccGlyph(int cFiles, std::Array <std::wstring const &> const & rgpszFullPaths, std::Array <Microsoft::VisualStudio::Shell::Interop::VsStateIcon> const & rgsiGlyphs, std::Array <unsigned int> const & rgdwSccStatus);
public int GetSccGlyph (int cFiles, string[] rgpszFullPaths, Microsoft.VisualStudio.Shell.Interop.VsStateIcon[] rgsiGlyphs, uint[] rgdwSccStatus);
abstract member GetSccGlyph : int * string[] * Microsoft.VisualStudio.Shell.Interop.VsStateIcon[] * uint32[] -> int
Public Function GetSccGlyph (cFiles As Integer, rgpszFullPaths As String(), rgsiGlyphs As VsStateIcon(), rgdwSccStatus As UInteger()) As Integer

Parameters

cFiles
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
String[]

[in] Array of paths to files; cannot be null.

rgsiGlyphs
VsStateIcon[]

[out] Array of icons corresponding to rgpszFullPaths; cannot be null. See VsStateIcon for additional information.

rgdwSccStatus
UInt32[]

[out] Specifies status for corresponding rgpszFullPaths entry. For a list of possible values, see File Status Code Enumerator. This parameter can be null.

Returns

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 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.

Applies to