ProvideOptionPageAttribute Class
Apply this attribute to independent objects to allow users to configure VSPackages through a custom Tools Options page.
Inheritance Hierarchy
System.Object
System.Attribute
Microsoft.VisualStudio.Shell.RegistrationAttribute
Microsoft.VisualStudio.Shell.ProvideOptionDialogPageAttribute
Microsoft.VisualStudio.Shell.ProvideOptionPageAttribute
Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)
Syntax
'Declaration
<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple := True, Inherited := True)> _
Public NotInheritable Class ProvideOptionPageAttribute _
Inherits ProvideOptionDialogPageAttribute
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public sealed class ProvideOptionPageAttribute : ProvideOptionDialogPageAttribute
The ProvideOptionPageAttribute type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean) | Initializes a new instance of ProvideOptionPageAttribute indicating that a particular class implements user configuration support for the VSPackage based on a Tools Options page. | |
ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, Int32) | ||
ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String) | ||
ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, array<String[]) |
Top
Properties
Name | Description | |
---|---|---|
CategoryName | Gets the canonical nonlocalized name of the Tools Options page's category. | |
CategoryResourceID | Gets the category resource ID for a Tools Options page. | |
Keywords | ||
NoShowAllView | Gets or sets whether aggregated Tools Options pages are shown. | |
PageName | Gets the canonical nonlocalized name of the Tools Options page. | |
PageNameResourceId | Gets the name resource ID of the page. (Inherited from ProvideOptionDialogPageAttribute.) | |
PageType | Gets the type of the page. (Inherited from ProvideOptionDialogPageAttribute.) | |
ProfileMigrationType | Sets the profile migration type. | |
ProvidesLocalizedCategoryName | ||
SupportsAutomation | Gets whether a Tools Options page implementation supports automation. | |
SupportsProfiles | Gets or sets whether a Tools Options page implementation uses the Visual Studio settings mechanism to persist its state. | |
TypeId | Gets the current instance of ProvideOptionPageAttribute. (Overrides RegistrationAttribute.TypeId.) |
Top
Methods
Name | Description | |
---|---|---|
Equals | Infrastructure. Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute.) | |
GetHashCode | Returns the hash code for this instance. (Inherited from Attribute.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IsDefaultAttribute | When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute.) | |
Match | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.) | |
Register | Registers the Tools Options page. (Overrides RegistrationAttribute.Register(RegistrationAttribute.RegistrationContext).) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Unregister | Removes the Tools Options page key from the registry. (Overrides RegistrationAttribute.Unregister(RegistrationAttribute.RegistrationContext).) |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
_Attribute.GetIDsOfNames | Maps a set of names to a corresponding set of dispatch identifiers. (Inherited from Attribute.) | |
_Attribute.GetTypeInfo | Retrieves the type information for an object, which can be used to get the type information for an interface. (Inherited from Attribute.) | |
_Attribute.GetTypeInfoCount | Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Inherited from Attribute.) | |
_Attribute.Invoke | Provides access to properties and methods exposed by an object. (Inherited from Attribute.) |
Top
Remarks
Notes for Implementers
Apply the ProvideOptionPageAttribute to classes implementing a VSPackage. This attribute enables to register that a specific independent object provides the VSPackage's users with configuration access through a custom Tools Options page.
Attribute Context
Applies to |
VSPackages allow configuration through custom Tools Options pages implemented either through the Managed Package Framework's DialogPage or by using the Visual Studio SDK code. |
Repeatable |
Yes |
Required attributes |
|
Invalid attributes |
None |
Notes for Callers
This attribute is used only for registration purposes and does not affect the runtime behavior of the code.
The ProvideOptionPageAttribute registers a given class implementing IProfileManager or DialogPage as providing a particular VSPackage support for persisting part or all of VSPackage's state through the Visual Studio settings mechanism. The state information persisted by the implementing class is referred to as a Visual Studio settings category and its defining entry in the registry is referred to as a Custom Settings Point.
Note
When a Managed Package Framework based custom Tools Options page is loaded, the IDE instantiates the object registered by ProvideOptionPageAttribute as implementing it. Managed Package Framework Tools Options page support should be implemented on its own object and not on the VSPackage itself.
For more information on creating and applying instances of ProvideOptionPageAttribute, see the example below and ProvideOptionPageAttribute.
Examples
In the example below, an instance of ProvideOptionPageAttribute is applied to a VSPackage implementation to register the class DesignerOptionsPage, which is derived from DialogPage, as providing the VSPackage with a Tools Options page.
Classes derived from DialogPage are provided with a default implementation of Visual Studio settings functionality, which can be overridden. The IDE makes use of this Visual Studio settings support if, as in the example, ProvideProfileAttribute is applied to the VSPackage implementation. For more information on Visual Studio settings support, see User Settings and Options.
using Microsoft.VisualStudio.Shell;
namespace Example
{
[DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\8.0")]
[ProvideOptionPage(typeof(DesignerOptionsPage), "MyDesigner", "OptionPage", 1000, 1001, true)]
[ProvideProfileAttribute(typeof(DesignerOptionsPage), "MyDesigner", "OptionPage", 1002, 1003, true)]
[ProvideProfileAttribute(typeof(PersistCurrentDesign), "MyDesigner","CurrentDesign", 1004, 1005, false)]
[Guid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")]
public class MyPackage : Package
{
//Implementation here
}
[Guid("YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY")]
internal class DesignerOptionsPage: DialogPage {
//Implementation here
}
[Guid("ZZZZZZZZ-ZZZZ-ZZZZ-ZZZZ-ZZZZZZZZZZZZ")]
internal class PersistCurrentDesign: IProfileManager {
//Implementation here
}
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.VisualStudio.Shell Namespace
Other Resources
Creating Options Pages By Using Managed Package Framework Classes