Package.GetAutomationObject Method
Gets the automation object for the VSPackage.
Namespace: Microsoft.VisualStudio.Shell
Assemblies: Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
Syntax
'Déclaration
Protected Overridable Function GetAutomationObject ( _
name As String _
) As Object
'Utilisation
Dim name As String
Dim returnValue As Object
returnValue = Me.GetAutomationObject(name)
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: 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualStudio.Shell Namespace