ArcGIS Runtime SDK for WPF - Library Reference
LocalGeometryService Class
Members  Example  See Also 
ESRI.ArcGIS.Client.Local Namespace : LocalGeometryService Class

The LocalGeometryService class represents a Geometry Service hosted by the LocalServer.

Object Model

LocalGeometryService Class

Syntax

Visual Basic (Declaration) 
Public NotInheritable Class LocalGeometryService 
   Inherits LocalService
C# 
public sealed class LocalGeometryService : LocalService 

Remarks

Geometry Services are a special type of service not based on any specific geographic resource such as a Map Package but instead provide access to sophisticated and frequently used geometric operations which can be perform on individually specified geometries. To access these operations, the LocalGeometryService should be used in conjunction with the use of a GeometryService Task which references the underlying LocalGeometryService via the UrlGeometryService.

Example

The following example demonstrates starting a LocalGeometryService by using the static method GetServiceAsync. Once the service has started the code creates a new GeometryService task instance, sets the Url property and registers event handlers for the BufferCompleted event and the task Failed event. The following example demonstrates using the task extension GeometryService.InitializeWithLocalServiceAsync:
C#Copy Code
LocalGeometryService.GetServiceAsync(localGeometryService =>
    {
        // Create a new GeometryService task instance.
        GeometryService geometryTask;
        geometryTask = new GeometryService();
        
        // Set the Url property to the Url of the LocalGeometryService.
        geometryTask.Url = localGeometryService.UrlGeometryService;
        
        // Register event handlers for the BufferCompleted and Failed events.
        geometryTask.BufferCompleted += GeometryService_BufferCompleted;
        geometryTask.Failed += GeometryService_Failed;
    });
VB.NETCopy Code
LocalGeometryService.GetServiceAsync(Function(localServiceDelegate)
    ' Create a new GeometryService task instance.
    Dim geometryTask As GeometryService
    geometryTask = New GeometryService()
    
    ' Set the Url property to the Url of the LocalGeometryService.
    geometryTask.Url = localServiceDelegate.UrlGeometryService
    
    ' Register event handlers for the BufferCompleted and Failed events.
    geometryTask.BufferCompleted += GeometryService_BufferCompleted
    geometryTask.Failed += GeometryService_Failed
    
End Function)
C#Copy Code
GeometryService geometryTask = new GeometryService();
geometryTask.InitializeWithLocalServiceAsync(delegateService => 
{
    if (string.IsNullOrEmpty(geometryTask.Url))
    {
        // Check delegateService.Error property.
        return;
    }
    
    // Continue to use geometryTask...
});
VB.NETCopy Code
Dim geometryTask As New GeometryService()
geometryTask.InitializeWithLocalServiceAsync(Function(delegateService) 
    If String.IsNullOrEmpty(geometryTask.Url) Then
        ' Check delegateService.Error property.
        Exit Function
    End If
    
    ' Continue to use geometryTask...
    
End Function)

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.Client.Local.LocalService
      ESRI.ArcGIS.Client.Local.LocalGeometryService

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.