XmlSerializationReader.ShrinkArray(Array, Int32, Type, Boolean) 方法

定义

确保给定的数组或副本不超过指定的长度。

此 API 支持产品基础结构,不能在代码中直接使用。

protected:
 Array ^ ShrinkArray(Array ^ a, int length, Type ^ elementType, bool isNullable);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("XML serializer relies on dynamic code generation which is not available with Ahead of Time compilation")]
protected Array? ShrinkArray(Array? a, int length, Type elementType, bool isNullable);
protected Array? ShrinkArray(Array? a, int length, Type elementType, bool isNullable);
protected Array ShrinkArray(Array a, int length, Type elementType, bool isNullable);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("XML serializer relies on dynamic code generation which is not available with Ahead of Time compilation")>]
member this.ShrinkArray : Array * int * Type * bool -> Array
member this.ShrinkArray : Array * int * Type * bool -> Array
Protected Function ShrinkArray (a As Array, length As Integer, elementType As Type, isNullable As Boolean) As Array

参数

a
Array

正在检查的数组。

length
Int32

数组的最大长度。

elementType
Type

Type数组的元素。

isNullable
Boolean

true 如果 null 对于数组,如果为输入数组存在,则可以返回;否则返回一个新的较小的数组。

返回

Array现有数组(如果已足够小);否则,包含原始数组的元素的大小length为新的较小数组。

属性

注解

XmlSerializationReader的受保护成员仅供在 .NET Framework XML 序列化基础结构内部使用的派生类使用。

适用于