Initializes a new instance of a ComReferenceNode for a given root project node and a VSCOMPONENTSELECTORDATA structure that refers to a COM component, initializing the reference node's properties.
Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)
Syntax
'宣言
Public Sub New ( _
root As ProjectNode, _
selectorData As VSCOMPONENTSELECTORDATA _
)
'使用
Dim root As ProjectNode
Dim selectorData As VSCOMPONENTSELECTORDATA
Dim instance As New ComReferenceNode(root, selectorData)
public ComReferenceNode(
ProjectNode root,
VSCOMPONENTSELECTORDATA selectorData
)
public:
ComReferenceNode(
ProjectNode^ root,
VSCOMPONENTSELECTORDATA selectorData
)
public function ComReferenceNode(
root : ProjectNode,
selectorData : VSCOMPONENTSELECTORDATA
)
Parameters
root
Type: Microsoft.VisualStudio.Package.ProjectNodeThe root project node.
selectorData
Type: Microsoft.VisualStudio.Shell.Interop.VSCOMPONENTSELECTORDATAThe selector data that refers to the component.
Exceptions
| Exception | Condition |
|---|---|
| [System.NotSupportedException] | selectorData is not of type VSCOMPONENTTYPE_Project or VSCOMPONENTTYPE_ComPlus (i.e. a COM project). |
| [System.ArgumentException] | The registry path for the COM component is null or empty. |
Remarks
This method sets the COM reference node's name, GUID, and major/minor version numbers from the selector data, and the LCID to [System.Globalization.CultureInfo.InvariantCulture]. The GUID must refer to a registered type library. This method sets the installed path from the registry entry for the COM component.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.