TypeProvider(IServiceProvider) 构造函数

定义

初始化 TypeProvider 类的新实例。Initializes a new instance of the TypeProvider class.

public:
 TypeProvider(IServiceProvider ^ serviceProvider);
public TypeProvider (IServiceProvider serviceProvider);
new System.Workflow.ComponentModel.Compiler.TypeProvider : IServiceProvider -> System.Workflow.ComponentModel.Compiler.TypeProvider
Public Sub New (serviceProvider As IServiceProvider)

参数

serviceProvider
IServiceProvider

此实例的包装的 IServiceProviderThe encapsulated IServiceProvider for this instance.

示例

下面的代码示例演示如何创建 TypeProvider 类的新实例。The following code example shows how to create a new instance of the TypeProvider class. 此代码示例摘自 WorkflowLoader.cs 文件中的 BasicDesignerHosting SDK 示例。This code example is part of the BasicDesignerHosting SDK Sample from the WorkflowLoader.cs file. 有关详细信息,请参阅基本设计器宿主For more information, see Basic Designer Hosting.

TypeProvider typeProvider = new TypeProvider(host);
typeProvider.AddAssemblyReference(typeof(string).Assembly.Location);
Dim typeProvider As TypeProvider = New TypeProvider(host)
typeProvider.AddAssemblyReference(GetType(String).Assembly.Location)

适用于