Partager via


Package.GetAutomationObject Method

Gets the automation object for the VSPackage.

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

Syntax

'Declaration
Protected Overridable Function GetAutomationObject ( _
    name As String _
) As Object
protected virtual Object GetAutomationObject(
    string name
)
protected:
virtual Object^ GetAutomationObject(
    String^ name
)
abstract GetAutomationObject : 
        name:string -> Object  
override GetAutomationObject : 
        name:string -> Object
protected function GetAutomationObject(
    name : String
) : Object

Parameters

  • name
    Type: String

    The name of the automation object to return. If name is nulla null reference (Nothing in Visual Basic), GetAutomationObject returns the default automation object for the VSPackage.

Return Value

Type: Object
An instance of the automation object, or nulla null reference (Nothing in Visual Basic) if no automation support is available.

Exceptions

Exception Condition
NotImplementedException

Thrown by the base implementation of GetAutomationObject.

Remarks

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

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

If name is not nulla null reference (Nothing in Visual Basic), 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.

.NET Framework Security

See Also

Reference

Package Class

Microsoft.VisualStudio.Shell Namespace

Other Resources

Extending the Visual Studio Environment

Automation Object Model Chart