Visual Basic (Declaration) | |
---|---|
Public MustInherit NotInheritable Class LocalServer |
C# | |
---|---|
public static class LocalServer |
Before using the the LocalServer the runtime deployment must be licensed with a valid license string. For more information please see the ArcGISRuntime class. Once the license string has been set and the ArcGISRuntime initialized, the recommended approach to start the LocalServer is by calling the asynchronous InitializeAsync method and listening for the InitializeCompleted event or by using the overloaded Initialize(Action) method and passing in an action callback delegate.
Once initialized the InitializationError property should be checked to confirm there were no problems encountered starting the LocalServer. To determine the current state of the LocalServer the Status property will provide a LocalServerStatus value or alternatively the property IsRunning can be used to quickly determine whether the LocalServer is currently running.
Finally, when the LocalServer is no longer required the asynchronous ShutdownAsync method should be called to shutdown the LocalServer and recover any resources being used. Once the LocalServer has shutdown it will trigger the ShutdownCompleted event, or alternatively you can use the overloaded ShutdownAsync(Action) method to provide an action callback delegate.
It is not necessary to work with the LocalServer directly. Instead, creating and starting the individual LocalService classes ( LocalMapService, LocalFeatureService, LocalGeocodeService, LocalGeometryService, and LocalGeoprocessingService) will start the LocalServer if it is not already running.
C# | Copy Code |
---|---|
// Initialize the LocalServer using a lambda expression to handle the callback LocalServer.InitializeAsync(() => { // Check the LocalServer InitializationError property if (LocalServer.InitializationError != null) { // The LocalServer encountered an error or did not start correctly // ... return; } }); |
VB.NET | Copy Code |
---|---|
' Initialize the LocalServer using a lambda expression to handle the callback LocalServer.InitializeAsync(Function() ' Check the LocalServer InitializationError property If LocalServer.InitializationError IsNot Nothing Then ' The LocalServer encountered an error or did not start correctly ' ... Exit Function End If End Function) |
System.Object
ESRI.ArcGIS.Client.Local.LocalServer
Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8