Export (0) Print
Expand All

IReferenceService Interface

Provides an interface for obtaining references to objects within a project by name or type, obtaining the name of a specified object, and for locating the parent of a specified object within a designer project.

Namespace:  System.ComponentModel.Design
Assembly:  System (in System.dll)

type IReferenceService =  interface end

The IReferenceService type exposes the following members.

  NameDescription
Public methodGetComponentGets the component that contains the specified component.
Public methodGetNameGets the name of the specified component.
Public methodGetReferenceGets a reference to the component whose name matches the specified name.
Public methodGetReferences()Gets all available references to project components.
Public methodGetReferences(Type)Gets all available references to components of the specified type.
Top

The IReferenceService interface provides the following methods:

  • The GetReference method returns the component with the specified name, or a null reference (Nothing in Visual Basic) if no component with the specified name was found.

  • The GetName method returns the name associated with the specified component.

  • The GetComponent method returns the parent container of the specified component.

  • The GetReferences method returns an array of references to all project components, or all project components of an optionally specified type.

The following example control uses the GetReferences method of the IReferenceService interface to obtain a list of components in the current design mode project of the type of the currently selected component.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft