ParameterImportBuilder.Import 方法
定义
定义一个参数作为一个导入的参数。Defines a parameter as an imported parameter.
重载
| Import<T>() |
定义指定参数作为一个导入的参数。Defines the specified parameter as an imported parameter. |
| Import<T>(Action<ImportBuilder>) |
定义指定参数作为具有指定配置导入的参数。Defines the specified parameter as an imported parameter that has the specified configuration. |
Import<T>()
定义指定参数作为一个导入的参数。Defines the specified parameter as an imported parameter.
public:
generic <typename T>
T Import();
public T Import<T> ();
member this.Import : unit -> 'T
Public Function Import(Of T) () As T
类型参数
- T
要定义的参数的类型。The type of the parameter to define.
返回
- T
但此方法应只引用并未调用默认的TDefault of T, but this method should only be referenced and never invoked.
适用于
Import<T>(Action<ImportBuilder>)
定义指定参数作为具有指定配置导入的参数。Defines the specified parameter as an imported parameter that has the specified configuration.
public:
generic <typename T>
T Import(Action<System::ComponentModel::Composition::Registration::ImportBuilder ^> ^ configure);
public T Import<T> (Action<System.ComponentModel.Composition.Registration.ImportBuilder> configure);
member this.Import : Action<System.ComponentModel.Composition.Registration.ImportBuilder> -> 'T
Public Function Import(Of T) (configure As Action(Of ImportBuilder)) As T
类型参数
- T
要定义的参数的类型。The type of the parameter to define.
参数
- configure
- Action<ImportBuilder>
一个包含导入的参数的配置信息的对象。An object that contains configuration information for the imported parameter.
返回
- T
但此方法应只引用并未调用默认的TDefault of T, but this method should only be referenced and never invoked.
例外
configure 为 null。configure is null.