ProvideOptionPageAttribute Constructor (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.
Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public Sub New ( _
pageType As Type, _
categoryName As String, _
pageName As String, _
categoryResourceID As Short, _
pageNameResourceID As Short, _
supportsAutomation As Boolean _
)
[BrowsableAttribute(false)]
public ProvideOptionPageAttribute(
Type pageType,
string categoryName,
string pageName,
short categoryResourceID,
short pageNameResourceID,
bool supportsAutomation
)
[BrowsableAttribute(false)]
public:
ProvideOptionPageAttribute(
Type^ pageType,
String^ categoryName,
String^ pageName,
short categoryResourceID,
short pageNameResourceID,
bool supportsAutomation
)
[<BrowsableAttribute(false)>]
new :
pageType:Type *
categoryName:string *
pageName:string *
categoryResourceID:int16 *
pageNameResourceID:int16 *
supportsAutomation:bool -> ProvideOptionPageAttribute
public function ProvideOptionPageAttribute(
pageType : Type,
categoryName : String,
pageName : String,
categoryResourceID : short,
pageNameResourceID : short,
supportsAutomation : boolean
)
Parameters
pageType
Type: System.TypeThe Type of the class implementing the Tools Options page.
categoryName
Type: System.StringThe canonical nonlocalized name of the Tools Options page category.
pageName
Type: System.StringThe canonical nonlocalized name of the Tools Options page subcategory.
categoryResourceID
Type: System.Int16The localized resource ID of the Tools Options page category.
pageNameResourceID
Type: System.Int16The localized resource ID of the Tools Options page subcategory.
supportsAutomation
Type: System.BooleanIf true, the Tools Options page can be accessed through the Visual Studio automation mechanism.
Remarks
If automation is supported, the canonical nonlocalized category and subcategory names are used to obtain a Tools Options page's Properties collection. For more information, see Using Options Pages.
Tools Options page registration information is created under the registry entries
ToolsOptionsPages
AutomationProperties (if automation support is requested)
These are found under HKLM\Software\Microsoft\VisualStudio\<Version> where <Version> is the version of Visual Studio, for example 8.0.
The registry entries for the Tools Options pages are:
ToolsOptionsPages\<categoryName>
ToolsOptionsPages\<categoryName>\@=#<categoryResourceID>
ToolsOptionsPages\<categoryName>\Package={"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"}
ToolsOptionsPages\<categoryName>\<pageName>
ToolsOptionsPages\<categoryName>\<pageName>\@=#<pageNameResourceID>
ToolsOptionsPages\<categoryName>\<pageName>\Package={"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"}
ToolsOptionsPages\<categoryName>\<pageName>\Page={"YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY"}
ToolsOptionsPages\<categoryName>\<pageName>\NoShowAllView=0/1
If Automation Support is specified, the registry entries for AutomationProperties are:
AutomationProperties\<categoryName>\<pageName>
AutomationProperties\<categoryName>\<pageName>\Name=<categoryName>.<pageName>
AutomationProperties\<categoryName>\<pageName>\Package={"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"}
AutomationProperties\<categoryName>\<pageName>\ProfileSave=0/1
Examples
The example below shows the registration of the page named "DesignerOptionsPage" as providing the "MyPackage" Package with ToolsOptions page support. The VSPackage and category GUIDs are obtained by the attribute by reflection.
The registry entries for DesignerOptionsPage are:
ToolsOptionsPages\MyDesigner
ToolsOptionsPages\MyDesigner\@=#1002
ToolsOptionsPages\MyDesigner\Package={"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"}
ToolsOptionsPages\MyDesigner\OptionPage
ToolsOptionsPages\MyDesigner\OptionPage\@=#1003
ToolsOptionsPages\MyDesigner\OptionPage\Package={"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"}
ToolsOptionsPages\MyDesigner\OptionPage\Page={"YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY"}
Note The key ToolsOptionsPages\MyDesigner\NoShowAllView is not set, because the property NoShowAllView is initialized to false.
Since the SupportsAutomation property is true, these additional registry values are set:
AutomationProperties\MyDesigner\OptionPage
AutomationProperties\MyDesigner\OptionPage\Name=MyDesigner.OptionPage
AutomationProperties\MyDesigner\OptionPage\Package={"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"}
AutomationProperties\MyDesigner\OptionPage\ProfileSave=1
Note The key ToolsOptionsPages\MyDesigner\ProfileSave is present and set to 1 since the SupportsProfiles property is set to true.
using Microsoft.VisualStudio.Shell;
namespace Example
{
[DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\8.0")]
[ProvideOptionPage(typeof(DesignerOptionsPage), " MyDesigner", "OptionPage", 1000, 1001, true,
NoShowAllValue = false, ProfileSave = true)]
[ProvideProfileAttribute(typeof(DesignerOptionsPage), "MyDesigner", "OptionPage", 1002, 1003, true)]
[Guid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")]
public class MyPackage : Package
{
//Implementation here
}
[Guid("YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY")]
internal class DesignerOptionsPage: DialogPage {
//Implementation here
}
.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
ProvideOptionPageAttribute Class