ProvideOptionPageAttribute ProvideOptionPageAttribute ProvideOptionPageAttribute ProvideOptionPageAttribute ProvideOptionPageAttribute Class

Definition

Apply this attribute to independent objects to allow users to configure VSPackages through a custom Tools Options page.

public ref class ProvideOptionPageAttribute sealed : Microsoft::VisualStudio::Shell::ProvideOptionDialogPageAttribute
public ref class ProvideOptionPageAttribute sealed : Microsoft::VisualStudio::Shell::ProvideOptionDialogPageAttribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
public sealed class ProvideOptionPageAttribute : Microsoft.VisualStudio.Shell.ProvideOptionDialogPageAttribute
type ProvideOptionPageAttribute = class
    inherit ProvideOptionDialogPageAttribute
Public NotInheritable Class ProvideOptionPageAttribute
Inherits ProvideOptionDialogPageAttribute
Inheritance
Attributes

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 Extending 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  
}  

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 DefaultRegistryRootAttribute
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.

Constructors

ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean)
ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, Int32) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, Int32) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, Int32) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, Int32) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, Int32)

Instantiates a new instance of ProvideOptionPageAttribute.

ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String)

Instantiates a new instance of ProvideOptionPageAttribute.

ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String[]) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String[]) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String[]) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String[]) ProvideOptionPageAttribute(Type, String, String, Int16, Int16, Boolean, String[])

Instantiates a new instance of ProvideOptionPageAttribute.

Properties

CategoryDescriptionResourceId CategoryDescriptionResourceId CategoryDescriptionResourceId CategoryDescriptionResourceId CategoryDescriptionResourceId

The ID of a resource containing the localized description of the page's parent category. This property is only used if SupportsAutomation == true and SupportsProfiles == true. The localized description appears in the import/export settings wizard.

CategoryName CategoryName CategoryName CategoryName CategoryName

Gets the canonical nonlocalized name of the Tools Options page's category.

CategoryPackageGuid CategoryPackageGuid CategoryPackageGuid CategoryPackageGuid CategoryPackageGuid

The ID of the package that owns the category under which this page is registered. If this is not set, the package is assumed to be the one to which this attribute is applied. This property is only used if SupportsAutomation == true and SupportsProfiles == true. Generate this from a Guid with Guid.ToString("B").

CategoryResourceID CategoryResourceID CategoryResourceID CategoryResourceID CategoryResourceID

Gets the category resource ID for a Tools Options page.

DescriptionResourceId DescriptionResourceId DescriptionResourceId DescriptionResourceId DescriptionResourceId

The ID of a resource containing the localized description of the page. This property is only used if SupportsAutomation == true and SupportsProfiles == true. The localized description appears in the import/export settings wizard.

Keywords Keywords Keywords Keywords Keywords

Gets the searchable keywords for this options page. Each keyword may be a literal string, a resource name/ID (prefixed with "@"/"#") pointing to a single keyword, or a resource name/ID (prefixed with "@"/"#") pointing to a semicolon-delimited list of keywords.

NoShowAllView NoShowAllView NoShowAllView NoShowAllView NoShowAllView

Gets or sets whether aggregated Tools Options pages are shown.

PageName PageName PageName PageName PageName

Gets the canonical nonlocalized name of the Tools Options page.

PageNameResourceId PageNameResourceId PageNameResourceId PageNameResourceId PageNameResourceId

Gets the name resource ID of the page.

(Inherited from ProvideOptionDialogPageAttribute)
PageType PageType PageType PageType PageType

Gets the type of the page.

(Inherited from ProvideOptionDialogPageAttribute)
ProfileMigrationType ProfileMigrationType ProfileMigrationType ProfileMigrationType ProfileMigrationType

Sets the profile migration type.

ProvidesLocalizedCategoryName ProvidesLocalizedCategoryName ProvidesLocalizedCategoryName ProvidesLocalizedCategoryName ProvidesLocalizedCategoryName

Determines whether the package has the localized resources for the category name.

Sort Sort Sort Sort Sort

The sort order for the option page. Option pages are collated in the following order:

1.  The General page
2.  Pages with a Sort value, sorted from low to high.
3.  Pages without a Sort value, sorted alphabetically.
SupportsAutomation SupportsAutomation SupportsAutomation SupportsAutomation SupportsAutomation

Gets whether a Tools Options page implementation supports automation.

SupportsProfiles SupportsProfiles SupportsProfiles SupportsProfiles SupportsProfiles

Gets or sets whether a Tools Options page implementation uses the Visual Studio settings mechanism to persist its state.

TypeId TypeId TypeId TypeId TypeId

Gets the current instance of ProvideOptionPageAttribute.

VisibilityCmdUIContexts VisibilityCmdUIContexts VisibilityCmdUIContexts VisibilityCmdUIContexts VisibilityCmdUIContexts

A semi-colon-delimited list of UIContext GUIDs. The option page is visible when any UIContext in the list is active. If this is not specified, the option page is always visible.

Methods

GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid)

Gets the registry path (relative to the registry root of the application) of the VSPackage.

(Inherited from RegistrationAttribute)
Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext)

Registers the Tools Options page.

Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext)

Removes the Tools Options page key from the registry.

Applies to