次の方法で共有


Package.GetAutomationObject Method

Gets the automation object for the VSPackage.

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

Syntax

'宣言
Protected Overridable Function GetAutomationObject ( _
    name As String _
) As Object
protected virtual Object GetAutomationObject(
    string name
)

Parameters

  • name
    Type: System.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: System.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