ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Core.DeviceLocation Namespace / IDeviceLocationService Interface / Close Method
Example

In This Topic
    Close Method (IDeviceLocationService)
    In This Topic
    Closes the current device location connection. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    void Close()
    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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also