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


Gets the component that contains the specified component.


Gets the name of the specified component.


Gets a reference to the component whose name matches the specified name.


Gets all available references to project components.


Gets all available references to components of the specified type.

The IReferenceService interface provides the following methods:

  • The GetReference method returns the component with the specified name, or null 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
Available since 1.1
Return to top