Share via


ScenarioPreloadRegistrationAttribute Class

Definition

This attribute can be used to associated packages / services with named scenarios such that when the named scenario is signalled to have started the associated packages / services will be eagerly pre-loaded in parallel on a background thread.

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

Remarks

It is important that any packages or services that opt into this perloading have NO UI thread dependencies. That doesn't mean 'uses JTF to get to the UI thread', it means 'never needs to go to the UI thread'. If these eagerly pre-loaded packages / services need to get to the UI thread it will lose the value we get by preloading them as the preload threads work progress will end up blocked on the thread transition, which probably won't be allowed to happen until the UI thread requests the service / package that is preloading. The idea with preloading is that the services / packages are DONE loading by the time the UI thread needs them and thus there is no thread sync / delay in acquiring them.

Constructors

ScenarioPreloadRegistrationAttribute(String, Type[])

Properties

ScenarioName

The named scenario this attribute is registering for its packages/services to preload in.

ScenarioServices

Specifies services that should be preloaded when the scenario ScenarioName becomes active. If this property is not set we will assume you want to preload the package type this attribute is applied to.

TypeId

Override the TypeID property in order to let the RegistrationAttribute derived classes to work with System.ComponentModel.TypeDescriptor.GetAttributes(...). An attribute derived from this one will have to override this property only if it needs a better control on the instances that can be applied to a class.

(Inherited from RegistrationAttribute)

Methods

GetPackageRegKeyPath(Guid)

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

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

Applies to