IdentityReferenceCollection.Translate Method

Definition

Converts the objects in the IdentityReferenceCollection collection to the specified type.

Overloads

Translate(Type)

Converts the objects in the collection to the specified type. Calling this method is the same as calling Translate(Type, Boolean) with the second parameter set to false, which means that exceptions will not be thrown for items that fail conversion.

Translate(Type, Boolean)

Converts the objects in the collection to the specified type and uses the specified fault tolerance to handle or ignore errors associated with a type not having a conversion mapping.

Translate(Type)

Converts the objects in the collection to the specified type. Calling this method is the same as calling Translate(Type, Boolean) with the second parameter set to false, which means that exceptions will not be thrown for items that fail conversion.

public:
 System::Security::Principal::IdentityReferenceCollection ^ Translate(Type ^ targetType);
public System.Security.Principal.IdentityReferenceCollection Translate (Type targetType);
member this.Translate : Type -> System.Security.Principal.IdentityReferenceCollection
Public Function Translate (targetType As Type) As IdentityReferenceCollection

Parameters

targetType
Type

The type to which items in the collection are being converted.

Returns

A IdentityReferenceCollection collection that represents the converted contents of the original collection.

Remarks

Order is preserved in the returned collection, That is, the first item in the returned collection corresponds to the first item in the source collection, and so on, for each item in the collection.

The items in the source collection are not required to be of the same type.

Applies to

Translate(Type, Boolean)

Converts the objects in the collection to the specified type and uses the specified fault tolerance to handle or ignore errors associated with a type not having a conversion mapping.

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.IdentityReferenceCollection
Public Function Translate (targetType As Type, forceSuccess As Boolean) As IdentityReferenceCollection

Parameters

targetType
Type

The type to which items in the collection are being converted.

forceSuccess
Boolean

A Boolean value that determines how conversion errors are handled.

If forceSuccess is true, conversion errors due to a mapping not being found for the translation result in a failed conversion and exceptions being thrown.

If forceSuccess is false, types that failed to convert due to a mapping not being found for the translation are copied without being converted into the collection being returned.

Returns

A IdentityReferenceCollection collection that represents the converted contents of the original collection.

Remarks

Order is preserved in the returned collection, That is, the first item in the returned collection corresponds to the first item in the source collection, and so on, for each item in the collection.

The items in the source collection are not required to be of the same type.

Applies to