ProvideToolboxItemConfigurationAttribute Class
Registers a VSPackage as supplying a particular implementation of IConfigureToolboxItem. Used in conjunction with ProvideAssemblyFilterAttribute.
Namespace: Microsoft.VisualStudio.Shell
Assemblies: Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
Syntax
'宣言
<AttributeUsageAttribute(AttributeTargets.Class, Inherited := True, AllowMultiple := True)> _
Public NotInheritable Class ProvideToolboxItemConfigurationAttribute _
Inherits RegistrationAttribute
'使用
Dim instance As ProvideToolboxItemConfigurationAttribute
[AttributeUsageAttribute(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
public sealed class ProvideToolboxItemConfigurationAttribute : RegistrationAttribute
[AttributeUsageAttribute(AttributeTargets::Class, Inherited = true, AllowMultiple = true)]
public ref class ProvideToolboxItemConfigurationAttribute sealed : public RegistrationAttribute
[<SealedAttribute>]
[<AttributeUsageAttribute(AttributeTargets.Class, Inherited = true, AllowMultiple = true)>]
type ProvideToolboxItemConfigurationAttribute =
class
inherit RegistrationAttribute
end
public final class ProvideToolboxItemConfigurationAttribute extends RegistrationAttribute
Remarks
Attribute Context
Applies to |
Classes providing VSPackages by implementing IVsPackage, Package. |
Repeatable |
No |
Required attributes |
ProvideAssemblyFilterAttribute (applied to the class implementing IConfigureToolboxItem. |
Invalid attributes |
None |
A specific instance of ProvideToolboxItemConfigurationAttribute is defined for each instance of IConfigureToolboxItem.
When this attribute is applied to a class that implements IVsPackage or Package, it informs Visual Studio that this VSPackage supplies an implementation of IConfigureToolboxItem.
A VSPackage can have more than one instance of ProvideToolboxItemConfigurationAttribute applied to it.
Examples
In the example below, the Package ItemConfiguration implementation is registered as providing the class ToolboxConfig to support an implementation of IConfigureToolboxItem.
using MSVSIP = Microsoft.VisualStudio.Shell;
[assembly:ComVisible(true)]
namespace Vsip.ItemConfiguration
{
/////////////////////////////////////////////////////////////////////////////
// Walkthrough1
[MSVSIP.ProvideToolboxItemsAttribute(110)]
[MSVSIP.DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\8.0")]
[MSVSIP.InstalledProductRegistration(100, 102, "1.0", IconResId = 400)]
[MSVSIP.RegisterLoadKey("Standard", "1.0", "Package Name", "Company", 1)]
[MSVSIP.ProvideMenuResource(1000, 1)]
[ProvideToolboxItemConfigurationAttribute(typeof(ToolboxConfig))]
[GuidAttribute("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")]
public class ItemConfiguration : MSVSIP.Package
Inheritance Hierarchy
System.Object
System.Attribute
Microsoft.VisualStudio.Shell.RegistrationAttribute
Microsoft.VisualStudio.Shell.ProvideToolboxItemConfigurationAttribute
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
ProvideToolboxItemConfigurationAttribute Members
Microsoft.VisualStudio.Shell Namespace
ProvideAssemblyFilterAttribute