WorkflowDesignerLoader.Initialize Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes the WorkflowDesignerLoader with any services required by the designer loader host.
protected:
override void Initialize();
protected override void Initialize ();
override this.Initialize : unit -> unit
Protected Overrides Sub Initialize ()
Examples
The following example shows how to override the Initialize method in a derived class to add the services needed for the designer. The services can vary based on the level of service support required by your application.
protected override void Initialize()
{
base.Initialize();
IDesignerLoaderHost host = this.LoaderHost;
if (host != null)
{
host.RemoveService(typeof(IIdentifierCreationService));
host.AddService(typeof(IIdentifierCreationService), new IdentifierCreationService(host));
host.AddService(typeof(IMenuCommandService), new WorkflowMenuCommandService(host));
host.AddService(typeof(IToolboxService), new Toolbox(host));
TypeProvider typeProvider = new TypeProvider(host);
typeProvider.AddAssemblyReference(typeof(string).Assembly.Location);
host.AddService(typeof(ITypeProvider), typeProvider, true);
host.AddService(typeof(IEventBindingService), new EventBindingService());
}
}
Protected Overrides Sub Initialize()
MyBase.Initialize()
Dim host As IDesignerLoaderHost = Me.LoaderHost
If host IsNot Nothing Then
host.RemoveService(GetType(IIdentifierCreationService))
host.AddService(GetType(IIdentifierCreationService), New IdentifierCreationService(host))
host.AddService(GetType(IMenuCommandService), New WorkflowMenuCommandService(host))
host.AddService(GetType(IToolboxService), New Toolbox(host))
Dim typeProvider As New TypeProvider(host)
typeProvider.AddAssemblyReference(GetType(String).Assembly.Location)
host.AddService(GetType(ITypeProvider), typeProvider, True)
host.AddService(GetType(IEventBindingService), New EventBindingService())
End If
End Sub
Applies to
Совместная работа с нами на GitHub
Источник этого содержимого можно найти на GitHub, где также можно создавать и просматривать проблемы и запросы на вытягивание. Дополнительные сведения см. в нашем руководстве для участников.