IdentityReferenceCollection.Translate Method (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.

Namespace:   System.Security.Principal
Assembly:  mscorlib (in mscorlib.dll)

[SecurityPermissionAttribute(SecurityAction.Demand, ControlPrincipal = true)]
public IdentityReferenceCollection Translate(
	Type targetType,
	bool forceSuccess


Type: System.Type

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

Type: System.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.

Return Value

Type: System.Security.Principal.IdentityReferenceCollection

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

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.

.NET Framework
Available since 2.0
Return to top