Converts an enumerable set of ArcGIS Explorer GeographicTransformation objects to a List of ArcGIS Server SOAP GeoTransformation objects.

Namespace:  ESRI.ArcGISExplorer.Geometry

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public static List<TSoap> GeographicTransformationToSoap<TSoap>(
	IEnumerable<GeographicTransformation> transformations
)
Visual Basic (Declaration)
Public Shared Function GeographicTransformationToSoap(Of TSoap) ( _
	transformations As IEnumerable(Of GeographicTransformation) _
) As List(Of TSoap)

Parameters

transformations
Type: System.Collections.Generic..::.IEnumerable<(Of <(GeographicTransformation>)>)

An enumerable set of ArcGIS Explorer GeographicTransformation objects to convert.

Type Parameters

TSoap
The SOAP GeoTransformation Type.

Return Value

A generic List containing SOAP GeoTransformation objects of type TSoap based on the properties of the transformations.

Remarks

Use this method to convert multiple ArcGIS Explorer GeographicTransformation objects into corresponding SOAP objects. You must specify the SOAP GeoTransformation type as the type parameter for this generic method by passing in the SOAP Type defined in your web service reference.

You can also use the ToArray method on the returned List to get an array of SOAP objects, which you may find useful as they are commonly used as parameters in web services.

Examples

The code below shows you how to create an enumerable generic set of ArcGIS Explorer GeographicTransformation objects from the MapDisplay.CurrentGeographicTransformations property, and then convert these objects to a generic List containing SOAP GeoTransformation objects, by using the GeographicTransformationToSoap method. Types are fully-qualified to avoid confusion, with the exception of the SOAP types - you must ensure you have a using/Imports statement to your SOAP web reference namespace or fully-qualify the SOAP types in your own code.
CopyC#
// Remember you will need a using (Imports in Visual Basic) statement to the namespace of the SOAP definitions
// for your web references, e.g. the namespace containing the SpatialReference SOAP type.

// Retrieve the list of ArcGIS Explorer geographic transformations from the MapDisplay and make a generic enumerable list.
GeographicTransformationCollection geoTs = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.CurrentGeographicTransformations;

// Make an enumerable generic list of transformations.
System.Collections.Generic.List<ESRI.ArcGISExplorer.Geometry.GeographicTransformation> xoTransformations = new System.Collections.Generic.List<ESRI.ArcGISExplorer.Geometry.GeographicTransformation>(geoTs.Count);
foreach (ESRI.ArcGISExplorer.Geometry.GeographicTransformation geoT in geoTs)
{
    xoTransformations.Add(geoT);
}

// Convert to SOAP GeographicTransformations subtype with GeographicTransformationToSoap<SOAP Type>.
// All objects to convert must be projected coordinate systems, which convert to the same SOAP type.
System.Collections.Generic.List<GeoTransformation> soapGeoTs = SoapConverter.GeographicTransformationToSoap<GeoTransformation>(xoTransformations);

// You can also convert easily to an array - many web services take arrays of SOAP objects as input parameters.
GeoTransformation[] soapGeoTsArray = soapGeoTs.ToArray();
CopyVB.NET
' Remember you will need a using (Imports in Visual Basic) statement to the namespace of the SOAP definitions
' for your web references, e.g. the namespace containing the SpatialReference SOAP type.


' Retrieve the list of ArcGIS Explorer geographic transformations from the MapDisplay and make a generic enumerable list.
Dim geoTs As GeographicTransformationCollection = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.CurrentGeographicTransformations

' Make an enumerable generic list of transformations.
Dim xoTransformations As System.Collections.Generic.List(Of ESRI.ArcGISExplorer.Geometry.GeographicTransformation) = New System.Collections.Generic.List(Of ESRI.ArcGISExplorer.Geometry.GeographicTransformation)(geoTs.Count)
For Each geoT As ESRI.ArcGISExplorer.Geometry.GeographicTransformation In geoTs
  xoTransformations.Add(geoT)
Next

' Convert to SOAP GeographicTransformations subtype with GeographicTransformationToSoap(Of SOAP Type).
' All objects to convert must be projected coordinate systems, which convert to the same SOAP type.
Dim soapGeoTs As System.Collections.Generic.List(Of GeoTransformation) = SoapConverter.GeographicTransformationToSoap(Of GeoTransformation)(xoTransformations)

' You can also convert easily to an array - many web services take arrays of SOAP objects as input parameters.
Dim soapGeoTsArray As GeoTransformation() = soapGeoTs.ToArray()

See Also