diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs index e7eb76f99d..489e7296bd 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs @@ -59,7 +59,7 @@ public async Task Receive(string modelCardId) modelCard.SelectedVersionId.NotNull(), cts.Token, (status, progress) => - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts.Token) + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts) ) .ConfigureAwait(false); diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs index 2c4671aab5..9ef113e74d 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs @@ -351,7 +351,7 @@ public async Task Send(string modelCardId) mapMembers, sendInfo, (status, progress) => - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts.Token), + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts), cts.Token ) .ConfigureAwait(false); diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs index 517cdfcc6c..b1973d331d 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs @@ -66,7 +66,7 @@ public async Task Receive(string modelCardId) modelCard.SelectedVersionId.NotNull(), cts.Token, (status, progress) => - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts.Token) + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts) ) .ConfigureAwait(false); diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs index 74b41450e6..820fb90097 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs @@ -168,7 +168,7 @@ private async Task SendInternal(string modelCardId) autocadObjects, sendInfo, (status, progress) => - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts.Token), + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts), cts.Token ) .ConfigureAwait(false); diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs index a9b20172b1..ee437aeea2 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs @@ -113,7 +113,7 @@ public async Task Send(string modelCardId) revitObjects, sendInfo, (status, progress) => - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts.Token), + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts), cts.Token ) .ConfigureAwait(false); diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoReceiveBinding.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoReceiveBinding.cs index 3c3d7e9e37..6c78f254df 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoReceiveBinding.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoReceiveBinding.cs @@ -61,7 +61,7 @@ public async Task Receive(string modelCardId) modelCard.SelectedVersionId.NotNull(), cts.Token, (status, progress) => - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts.Token) + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts) ) .ConfigureAwait(false); diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs index adf90f3df0..9005692407 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs @@ -175,7 +175,7 @@ public async Task Send(string modelCardId) rhinoObjects, sendInfo, (status, progress) => - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts.Token), + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts), cts.Token ) .ConfigureAwait(false); diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs index 71abda99dc..c88da91a81 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs @@ -75,12 +75,12 @@ public void SetGlobalNotification(ToastNotificationType type, string title, stri } ); - public void SetModelProgress(string modelCardId, ModelCardProgress progress, CancellationToken ct) + public void SetModelProgress(string modelCardId, ModelCardProgress progress, CancellationTokenSource cts) { // NOTE: To prevent potential race condition // After cancelling operation some parts could still send last progress update which was set progress on UI // after it forced to be undefined. This is the safest way to prevent any case like this. - if (!ct.IsCancellationRequested) + if (!cts.IsCancellationRequested) { Bridge.Send(SET_MODEL_PROGRESS_UI_COMMAND_NAME, new { modelCardId, progress }); }