From 1d305c78578041d6f56e407a6d85c4df7a393463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuzhan=20Koral?= <45078678+oguzhankoral@users.noreply.github.com> Date: Thu, 6 Jun 2024 19:14:47 +0300 Subject: [PATCH] Use Map on GetDocumentInfo instead Project (#3484) --- .../Bindings/BasicConnectorBinding.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs index b49d2a77f2..bfa36dfc87 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs @@ -1,5 +1,4 @@ using System.Reflection; -using ArcGIS.Desktop.Core; using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Mapping; using Speckle.Connectors.ArcGIS.HostApp; @@ -41,7 +40,15 @@ public BasicConnectorBinding(DocumentModelStore store, ArcGISSettings settings, public string GetConnectorVersion() => Assembly.GetAssembly(GetType()).NotNull().GetVersion(); - public DocumentInfo GetDocumentInfo() => new(Project.Current.URI, Project.Current.Name, Project.Current.Name); + public DocumentInfo? GetDocumentInfo() + { + if (MapView.Active is null) + { + return null; + } + + return new DocumentInfo(MapView.Active.Map.URI, MapView.Active.Map.Name, MapView.Active.Map.Name); + } public DocumentModelStore GetDocumentState() => _store;