Package Class

 

Provides a managed implementation of the interfaces required to create a fully functional VSPackage.

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


[PackageRegistrationAttribute]
[ComVisibleAttribute(true)]
public abstract class Package : IVsPackage, IServiceProvider, 
	IOleCommandTarget, IVsPersistSolutionOpts, IServiceContainer, 
	IServiceProvider, IVsUserSettings, IVsUserSettingsMigration, 
	IVsUserSettingsQuery, IVsToolWindowFactory, IVsToolboxItemProvider

NameDescription
System_CAPS_protmethodPackage()

Initializes a new instance of Package.

NameDescription
System_CAPS_pubpropertyApplicationRegistryRoot

Gets the root registry key of the current Visual Studio registry hive.

System_CAPS_pubpropertyUserDataPath

Gets the path to user data storage for Visual Studio.

System_CAPS_pubpropertyUserLocalDataPath

Gets the path to local user data storage for Visual Studio.

System_CAPS_pubpropertyUserRegistryRoot

Gets a registry key that can be used to store user data.

System_CAPS_pubpropertyZombied

Gets a value indicating whether the package in the process of shutdown.

NameDescription
System_CAPS_protmethodAddOptionKey(String)

Adds a user option key name into the list of option keys.

System_CAPS_pubmethodCreateInstance(Guid, Guid, Type)

Creates the specified COM object using the Visual Studio's local registry CLSID object.

System_CAPS_pubmethodCreateTool(Guid)

Enables derived classes to provide an implementation if necessary.

System_CAPS_protmethodCreateToolWindow(Guid, Int32)

Creates a tool window of the specified type with the specified ID.

System_CAPS_protmethodCreateToolWindow(Type, Int32)

Creates a tool window of the specified type with the specified ID.

System_CAPS_protmethodCreateToolWindow(Type, Int32, UInt32)

Creates a tool window of the specified type with the specified ID.

System_CAPS_protmethodDispose(Boolean)

Releases the resources used by the Package object.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodFindToolWindow(Type, Int32, Boolean)

Gets the tool window corresponding to the specified type and ID.

System_CAPS_pubmethodFindWindowPane(Type, Int32, Boolean)

Gets the window pane corresponding to the specified type and ID, and if no window pane of that type exists creates one if told to do so.

System_CAPS_protmethodGetAutomationObject(String)

Gets the automation object for the VSPackage.

System_CAPS_pubmethodGetDialogPage(Type)

Gets the requested dialog page.

System_CAPS_pubmethodSystem_CAPS_staticGetGlobalService(Type)

Gets a service proffered globally by Visual Studio or one of its packages. This is the same as calling GetService() on an instance of a package that proffers no services itself.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetOutputPane(Guid, String)

Gets the requested output window.

System_CAPS_pubmethodGetProviderLocale()

Returns the locale associated with this service provider.

System_CAPS_protmethodGetService(Type)

Gets type-based services from the VSPackage service container.

System_CAPS_protmethodGetToolboxItemData(String, DataFormats.Format)

Gets the content of the data format for the specified toolbox item ID and data format.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodInitialize()

Called when the VSPackage is loaded by Visual Studio.

System_CAPS_protmethodInstantiateToolWindow(Type)

System_CAPS_pubmethodIsLocalService(Type)

Determines whether the specified service type can be retrieved without requiring an RPC transition to the UI thread.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodOnLoadOptions(String, Stream)

Invoked by the package class when there are options to be read out of the solution file.

System_CAPS_protmethodOnSaveOptions(String, Stream)

Invoked by the Package class when there are options to be saved to the solution file.

System_CAPS_pubmethodParseToolboxResource(TextReader, Guid)

Parses an embedded text resource of appropriate format for information about which items should be added to the Toolbox.

System_CAPS_pubmethodParseToolboxResource(TextReader, ResourceManager)

Parses an embedded text resource of appropriate format for information about which items should be added to the Toolbox.

System_CAPS_protmethodQueryClose(Boolean)

Called to ask the package if the shell can be closed.

System_CAPS_protmethodRegisterEditorFactory(IVsEditorFactory)

Registers an editor factory with Visual Studio.

System_CAPS_protmethodRegisterProjectFactory(IVsProjectFactory)

Registers a project factory with Visual Studio.

System_CAPS_pubmethodShowOptionPage(Type)

Displays a specified tools options page.

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubeventToolboxInitialized

Event generated whenever Visual Studio initializes its Toolbox.

System_CAPS_pubeventToolboxUpgraded

Event generated whenever Visual Studio upgrades its Toolbox.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIOleCommandTarget.Exec(Guid, UInt32, UInt32, IntPtr, IntPtr)

Executes a specified command or displays help for a command.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIOleCommandTarget.QueryStatus(Guid, UInt32, OLECMD[], IntPtr)

Queries the object for the status of one or more commands generated by user interface events.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIServiceProvider.QueryService(Guid, Guid, IntPtr)

This API supports the product infrastructure and is not intended to be used directly from your code. Internal IServiceProvider implementation.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsPackage.Close()

This API supports the product infrastructure and is not intended to be used directly from your code. Closes and disposes the package.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsPackage.GetAutomationObject(String, Object)

This API supports the product infrastructure and is not intended to be used directly from your code. Gets an automation-friendly object for this package.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsPackage.GetPropertyPage(Guid, VSPROPSHEETPAGE[])

This API supports the product infrastructure and is not intended to be used directly from your code. Proffers access to the Tools menu Options and the property pages of the Customize Toolbox dialog boxes.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsPackage.QueryClose(Int32)

This API supports the product infrastructure and is not intended to be used directly from your code. Called to ask the VSPackage if the Visual Studio shell can be closed.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsPackage.ResetDefaults(UInt32)

This API supports the product infrastructure and is not intended to be used directly from your code. Resets Toolbox defaults.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsPackage.SetSite(IServiceProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. Initializes the VSPackage in the Visual Studio environment.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsPersistSolutionOpts.LoadUserOptions(IVsSolutionPersistence, UInt32)

This API supports the product infrastructure and is not intended to be used directly from your code. Loads user options for a given solution.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsPersistSolutionOpts.ReadUserOptions(IStream, String)

This API supports the product infrastructure and is not intended to be used directly from your code. Reads user options for a given solution.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsPersistSolutionOpts.SaveUserOptions(IVsSolutionPersistence)

This API supports the product infrastructure and is not intended to be used directly from your code. Saves user options for a given solution.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsPersistSolutionOpts.WriteUserOptions(IStream, String)

This API supports the product infrastructure and is not intended to be used directly from your code. Writes user options for a given solution.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsToolboxItemProvider.GetItemContent(String, UInt16, IntPtr)

Gets an item.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsToolWindowFactory.CreateToolWindow(Guid, UInt32)

This API supports the product infrastructure and is not intended to be used directly from your code. Creates a tool window of the specified type with the specified ID.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsUserSettings.ExportSettings(String, IVsSettingsWriter)

This method implements the IVsUserSettings Interface used to manage profiles and import/export settings to XML files.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsUserSettings.ImportSettings(String, IVsSettingsReader, UInt32, Int32)

Retrieves a VSPackage's configuration using the Visual Studio settings mechanism when a user selects the import option of the Import/Export Settings feature on the IDE’s Tools menu. This method is part of the implementation of the IVsUserSettings interface used to manage profiles and import/export settings to XML files.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsUserSettingsMigration.MigrateSettings(IVsSettingsReader, IVsSettingsWriter, String)

Migrates settings from a previous version.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIVsUserSettingsQuery.NeedExport(String, Int32)

Determines whether settings have changed and should be re-exported.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIServiceContainer.AddService(Type, Object)

This API supports the product infrastructure and is not intended to be used directly from your code. Adds the given service to the VSPackage's service container.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIServiceContainer.AddService(Type, Object, Boolean)

This API supports the product infrastructure and is not intended to be used directly from your code. Adds the given service to the VSPackage's service container.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIServiceContainer.AddService(Type, ServiceCreatorCallback)

This API supports the product infrastructure and is not intended to be used directly from your code. Adds the given service to the VSPackage's service container.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIServiceContainer.AddService(Type, ServiceCreatorCallback, Boolean)

Adds the given service to the service container by means of the specified ServiceCreatorCallback.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIServiceContainer.RemoveService(Type)

This API supports the product infrastructure and is not intended to be used directly from your code. Removes the given service type from the service container.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIServiceContainer.RemoveService(Type, Boolean)

This API supports the product infrastructure and is not intended to be used directly from your code. Removes the given service type from the service container, and optionally promotes the removal of the service to parent service containers.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIServiceProvider.GetService(Type)

Gets the service of the specified type.

NameDescription
System_CAPS_pubmethodQueryService(Guid)

Overloaded. Gets a service exposed by a service provider based on its service type.(Defined by PackageUtilities.)

System_CAPS_pubmethodQueryService<TService>()

Overloaded. Gets a service exposed by a service provider based on its service type.(Defined by PackageUtilities.)

The Package class provides a managed implementation of several of the most useful VSIP interfaces. You can create the basic functionality of a VSPackage with relatively little code by deriving from the Package class, overriding some of its methods, and attaching registration attribute classes. The Package class does not provide direct registration support, but it can use attribute classes to supply the necessary registration information to external tools such as RegPkg.exe.

The Package class offers the following services by default. (You can replace them by asking the VSPackage for IServiceContainer, removing them, and adding your own services in their place.)

  • Package

    The package offers itself as a service.

  • IServiceContainer

    Provides the ability to add and remove services. Any service added with "promote" set to true is proffered to Visual Studio through IProfferService. This makes the service global to all VSPackages within Visual Studio. (This service is available only if the VSPackage has already been loaded.)

In addition to these services, Package uses the service architecture of Visual Studio to provide access to any service available through the global service provider.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: