IdentityReferenceCollection.Translate 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将 IdentityReferenceCollection 集合中的对象转换为指定类型。
重载
| Translate(Type) | 将集合中的对象转换为指定类型。 调用此方法与调用 Translate(Type, Boolean) 相同,第二个参数设置为  | 
| Translate(Type, Boolean) | 将集合中的对象转换为指定类型,并使用指定的容错来处理或忽略与没有转换映射的类型关联的错误。 | 
Translate(Type)
将集合中的对象转换为指定类型。 调用此方法与调用 Translate(Type, Boolean) 相同,第二个参数设置为 false,这意味着不会为转换失败的项引发异常。
public:
 System::Security::Principal::IdentityReferenceCollection ^ Translate(Type ^ targetType);public System.Security.Principal.IdentityReferenceCollection Translate (Type targetType);member this.Translate : Type -> System.Security.Principal.IdentityReferenceCollectionPublic Function Translate (targetType As Type) As IdentityReferenceCollection参数
- targetType
- Type
将集合中的项转换为的类型。
返回
表示原始集合的转换内容 IdentityReferenceCollection 集合。
注解
顺序在返回的集合中保留,也就是说,返回集合中的第一项对应于源集合中的第一项,依此表示集合中每个项。
源集合中的项不需要属于同一类型。
适用于
Translate(Type, Boolean)
将集合中的对象转换为指定类型,并使用指定的容错来处理或忽略与没有转换映射的类型关联的错误。
public:
 System::Security::Principal::IdentityReferenceCollection ^ Translate(Type ^ targetType, bool forceSuccess);public System.Security.Principal.IdentityReferenceCollection Translate (Type targetType, bool forceSuccess);member this.Translate : Type * bool -> System.Security.Principal.IdentityReferenceCollectionPublic Function Translate (targetType As Type, forceSuccess As Boolean) As IdentityReferenceCollection参数
- targetType
- Type
将集合中的项转换为的类型。
- forceSuccess
- Boolean
一个布尔值,用于确定如何处理转换错误。
如果 forceSuccesstrue,则由于找不到转换映射而导致转换失败并引发异常,导致转换错误。
如果 forceSuccessfalse,则由于未找到转换映射而无法转换的类型将被复制,而不会转换为要返回的集合。
返回
表示原始集合的转换内容 IdentityReferenceCollection 集合。
注解
顺序在返回的集合中保留,也就是说,返回集合中的第一项对应于源集合中的第一项,依此表示集合中每个项。
源集合中的项不需要属于同一类型。