SoapServices.PreLoad 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
根据应用于类型的值 SoapTypeAttribute 预加载指定的类型。
重载
| 名称 | 说明 |
|---|---|
| PreLoad(Assembly) |
从与每种类型关联的信息中找到的信息Type中预先Assembly加载SoapTypeAttribute每个找到的项。 |
| PreLoad(Type) |
根据类型中Type设置的值预加载给定SoapTypeAttribute值。 |
PreLoad(Assembly)
从与每种类型关联的信息中找到的信息Type中预先Assembly加载SoapTypeAttribute每个找到的项。
public:
static void PreLoad(System::Reflection::Assembly ^ assembly);
public static void PreLoad(System.Reflection.Assembly assembly);
[System.Security.SecurityCritical]
public static void PreLoad(System.Reflection.Assembly assembly);
static member PreLoad : System.Reflection.Assembly -> unit
[<System.Security.SecurityCritical>]
static member PreLoad : System.Reflection.Assembly -> unit
Public Shared Sub PreLoad (assembly As Assembly)
参数
- assembly
- Assembly
要 Assembly 调用 PreLoad(Type)的每种类型。
- 属性
例外
即时调用方没有基础结构权限。
示例
下面的代码示例演示如何使用此方法。 该代码示例是 SoapServices 类中的一个较大示例的一部分。
// Register all types in the assembly with the SoapType attribute.
System::Reflection::Assembly^ executingAssembly =
System::Reflection::Assembly::GetExecutingAssembly();
SoapServices::PreLoad( executingAssembly );
// Register all types in the assembly with the SoapType attribute.
System.Reflection.Assembly executingAssembly =
System.Reflection.Assembly.GetExecutingAssembly();
SoapServices.PreLoad(executingAssembly);
注解
当.NET框架分析 XML 流时,它需要知道如何将从流读取的 XML 转换为公共语言运行时类型。 指定 .NET Framework 如何生成和分析 XML 流的信息存储在位于 System.Runtime.Remoting.Metadata 命名空间的自定义属性中。 可通过两种方法在配置文件中指定此信息:通过显式指定映射,或指定要预加载的对象类型。 自定义属性在预加载过程中读取,并且这些属性中的信息可供 SOAP 分析器使用。
适用于
PreLoad(Type)
根据类型中Type设置的值预加载给定SoapTypeAttribute值。
public:
static void PreLoad(Type ^ type);
public static void PreLoad(Type type);
[System.Security.SecurityCritical]
public static void PreLoad(Type type);
static member PreLoad : Type -> unit
[<System.Security.SecurityCritical>]
static member PreLoad : Type -> unit
Public Shared Sub PreLoad (type As Type)
参数
- 属性
例外
即时调用方没有基础结构权限。
示例
下面的代码示例演示如何使用此方法。 该代码示例是 SoapServices 类中的一个较大示例的一部分。
// Register a specific type with the SoapType attribute.
Type^ exampleType = ExampleNamespace::ExampleClass::typeid;
SoapServices::PreLoad( exampleType );
// Register a specific type with the SoapType attribute.
Type exampleType = typeof(ExampleNamespace.ExampleClass);
SoapServices.PreLoad(exampleType);
注解
当.NET框架分析 XML 流时,它需要知道如何将从流读取的 XML 转换为公共语言运行时类型。 指定 .NET Framework 如何生成和分析 XML 流的信息存储在位于 System.Runtime.Remoting.Metadata 命名空间的自定义属性中。 可通过两种方法在配置文件中指定此信息:通过显式指定映射,或指定要预加载的对象类型。 自定义属性在预加载过程中读取,并且这些属性中的信息可供 SOAP 分析器使用。