Bagikan melalui


IVsSolution.GetItemOfProjref Method

Returns a hierarchy and hierarchy item pair for the specified project reference string.

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

Syntax

'Declaration
Function GetItemOfProjref ( _
    pszProjref As String, _
    <OutAttribute> ByRef ppHierarchy As IVsHierarchy, _
    <OutAttribute> ByRef pitemid As UInteger, _
    <OutAttribute> ByRef pbstrUpdatedProjref As String, _
    <OutAttribute> puprUpdateReason As VSUPDATEPROJREFREASON() _
) As Integer
int GetItemOfProjref(
    string pszProjref,
    out IVsHierarchy ppHierarchy,
    out uint pitemid,
    out string pbstrUpdatedProjref,
    VSUPDATEPROJREFREASON[] puprUpdateReason
)
int GetItemOfProjref(
    [InAttribute] String^ pszProjref, 
    [OutAttribute] IVsHierarchy^% ppHierarchy, 
    [OutAttribute] unsigned int% pitemid, 
    [OutAttribute] String^% pbstrUpdatedProjref, 
    [OutAttribute] array<VSUPDATEPROJREFREASON>^ puprUpdateReason
)
abstract GetItemOfProjref : 
        pszProjref:string * 
        ppHierarchy:IVsHierarchy byref * 
        pitemid:uint32 byref * 
        pbstrUpdatedProjref:string byref * 
        puprUpdateReason:VSUPDATEPROJREFREASON[] byref -> int 
function GetItemOfProjref(
    pszProjref : String, 
    ppHierarchy : IVsHierarchy, 
    pitemid : uint, 
    pbstrUpdatedProjref : String, 
    puprUpdateReason : VSUPDATEPROJREFREASON[]
) : int

Parameters

  • pszProjref
    Type: System.String
    [in] Pointer to the existing project item reference string, if applicable. Can be nulla null reference (Nothing in Visual Basic).
  • pitemid
    Type: System.UInt32%
    [out] Pointer to the item identifier referred to by the project reference. For a list of enumerated pitemid values, see VSITEMID.
  • pbstrUpdatedProjref
    Type: System.String%
    [out] Pointer to the updated project reference string.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsSolution::GetItemOfProjref(
   [in] LPCOLESTR pszProjref,
   [out] IVsHierarchy **ppHierarchy,
   [out] VSITEMID *pitemid,
   [out] BSTR *pbstrUpdatedProjref,
   [out] VSUPDATEPROJREFREASON *puprUpdateReason
);

During a drag-and-drop or cut-and-paste operation, the environment places a set of project references on the clipboard for the source item in the operation. This method is used by the target in these operations to change the project references from the clipboard back into hierarchy and hierarchy item pairs. The target can then notify the source that it has incorporated these items.

The following is a description of how the GetItemOfProjref method is used to support drag-and-drop operations:

The CF_VSPROJECTITEMS and CF_VSPROJECTS clipboard formats use the DROPFILES structure in the same manner as CF_HDROP or CF_PRINTERS. The data that follows the DROPFILES structure is a double-NULL-terminated list of Projref strings. The consumer of the drop operation can use the Microsoft Windows API. DragQueryFile to examine the data in the DROPFILES structure. CF_VSPROJECTS format is offered when the Projref strings identify projects as a whole, that is, *pitemid == VSITEMID_ROOT. The CF_VSPROJECTITEMS format is offered when the Projref strings identify one or more individual project items. Either CF_VSPROJECTS or CF_VSPROJECTITEMS should be offered, but never both.

.NET Framework Security

See Also

Reference

IVsSolution Interface

Microsoft.VisualStudio.Shell.Interop Namespace