Package.GetAutomationObject(String) Method

Definition

Gets the automation object for the VSPackage.

protected:
 virtual System::Object ^ GetAutomationObject(System::String ^ name);
protected:
 virtual Platform::Object ^ GetAutomationObject(Platform::String ^ name);
 virtual winrt::Windows::Foundation::IInspectable GetAutomationObject(std::wstring const & name);
protected virtual object GetAutomationObject (string name);
abstract member GetAutomationObject : string -> obj
override this.GetAutomationObject : string -> obj
Protected Overridable Function GetAutomationObject (name As String) As Object

Parameters

name
String

The name of the automation object to return. If name is null, GetAutomationObject returns the default automation object for the VSPackage.

Returns

An instance of the automation object, or null if no automation support is available.

Exceptions

Thrown by the base implementation of GetAutomationObject.

Remarks

Override GetAutomationObject when your VSPackage extends the DTE Automation object model.

The GetAutomationObject method returns null if name is null, indicating there is no default automation object. (This causes the IVsPackage implementation to return E_NOTIMPL.)

If name is not null, this method searches through the available metadata attributes for an option page with a name that matches the format <Category>.<Name>. If the option page has such a name and indicates that it supports automation, the automation object in the option page is returned.

Applies to