次の方法で共有


DefaultRegistryRootAttribute Class

Defines the default registry root used to register VSPackage information. This class cannot be inherited.

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

Syntax

'宣言
<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple := False, Inherited := True)> _
Public NotInheritable Class DefaultRegistryRootAttribute _
    Inherits Attribute
'使用
Dim instance As DefaultRegistryRootAttribute
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public sealed class DefaultRegistryRootAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class, AllowMultiple = false, Inherited = true)]
public ref class DefaultRegistryRootAttribute sealed : public Attribute
public final class DefaultRegistryRootAttribute extends Attribute

Remarks

When to Call

Apply the attribute DefaultRegistryRootAttribute to your Package-derived class or class that implements IVsPackage to define the default registry root for the package.

Basic Usage

The attribute should be applied to classes implementing the Package class and needing to use an alternate registry root. If not present, the default registry root will be used and this may prevent the package from functioning. The base Package class already provides this attribute for the version of Visual Studio that the package was built for.

The value of the attribute must be a fully qualified registry root, such as Software\Microsoft\VisualStudio\8.0. External registration tools can override the default registry root with their own custom root.

This attribute class is only used to provide data for external registration tools. It does not have any effect on the runtime behavior of the VSPackage. To use DefaultRegistryRootAttribute, place it on class that is derived from Package or that implements IVsPackage.

注意

Visual C# automatically appends the word, Attribute, to the name of any attribute class. In Visual C# code, refer to this attribute as DefaultRegistryRoot.

Samples

You can find implementations of the DefaultRegistryRootAttribute class in the Managed Samples section of the Visual Studio Environment SDK. The standard location for this and all other attributes used for automatic registration is adjacent to the implementation of the Package class in VsPkg.cs, VsPkg.vb, or VsPkg.cpp, depending on the language used in the sample.

Inheritance Hierarchy

System.Object
  System.Attribute
    Microsoft.VisualStudio.Shell.DefaultRegistryRootAttribute

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

Concepts

How to: Register Managed VSPackages

Reference

DefaultRegistryRootAttribute Members

Microsoft.VisualStudio.Shell Namespace