ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Core.DeviceLocation Namespace / DeviceLocationService Class / Close Method
Example

In This Topic
    Close Method (DeviceLocationService)
    In This Topic
    Closes the current device location source connection. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void Close()
    Public Sub Close() 
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Close the Current Device Location Source
    //Is there a current device source?
    var src = DeviceLocationService.Instance.GetSource();
    if (src == null)
      return;//no current source
    
    await QueuedTask.Run(() =>
    {
      DeviceLocationService.Instance.Close();
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also