diff --git a/Core/Core/Core.csproj b/Core/Core/Core.csproj index 275dcc12cc..caaa2ab93a 100644 --- a/Core/Core/Core.csproj +++ b/Core/Core/Core.csproj @@ -51,7 +51,6 @@ - diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSelectionBinding.cs b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSelectionBinding.cs index ddc096b629..157bad2797 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSelectionBinding.cs +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSelectionBinding.cs @@ -7,8 +7,8 @@ namespace Speckle.Connectors.ArcGIS.Bindings; public class ArcGISSelectionBinding : ISelectionBinding { - public string Name { get; } = "selectionBinding"; - public IBridge Parent { get; set; } + public string Name => "selectionBinding"; + public IBridge Parent { get; } public ArcGISSelectionBinding(IBridge parent) { @@ -22,7 +22,7 @@ public ArcGISSelectionBinding(IBridge parent) private void OnSelectionChanged(MapViewEventArgs args) { SelectionInfo selInfo = GetSelection(); - Parent?.Send(SelectionBindingEvents.SET_SELECTION, selInfo); + Parent.Send(SelectionBindingEvents.SET_SELECTION, selInfo); } public SelectionInfo GetSelection() diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSelectionBinding.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSelectionBinding.cs index b52fcba337..760256fe55 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSelectionBinding.cs +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSelectionBinding.cs @@ -9,9 +9,8 @@ public class AutocadSelectionBinding : ISelectionBinding { private const string SELECTION_EVENT = "setSelection"; - private readonly List _visitedDocuments = new(); + public string Name { get; } = "selectionBinding"; - public string Name { get; set; } = "selectionBinding"; public IBridge Parent { get; } @@ -26,9 +25,9 @@ public AutocadSelectionBinding(IBridge parent) Application.DocumentManager.DocumentActivated += (sender, e) => OnDocumentChanged(e.Document); } - private void OnDocumentChanged(Document document) => TryRegisterDocumentForSelection(document); + private void OnDocumentChanged(Document? document) => TryRegisterDocumentForSelection(document); - private void TryRegisterDocumentForSelection(Document document) + private void TryRegisterDocumentForSelection(Document? document) { if (document == null) { @@ -49,13 +48,13 @@ private void TryRegisterDocumentForSelection(Document document) private void OnSelectionChanged() { SelectionInfo selInfo = GetSelection(); - Parent?.Send(SELECTION_EVENT, selInfo); + Parent.Send(SELECTION_EVENT, selInfo); } public SelectionInfo GetSelection() { // POC: Will be addressed to move it into AutocadContext! https://spockle.atlassian.net/browse/CNX-9319 - Document doc = Application.DocumentManager.MdiActiveDocument; + Document? doc = Application.DocumentManager.MdiActiveDocument; List objs = new(); List objectTypes = new(); if (doc != null) diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json index 6fdd69eb66..8fd5af7998 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json @@ -251,14 +251,6 @@ "Serilog": "2.4.0" } }, - "Serilog.Enrichers.GlobalLogContext": { - "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "IIZcj5mAUVhIl/NTA+YI2KC+sPDzcwvs0ZMHH42jsPfl1a4LVX7ohVpw5UK+e3GxuV3Nv239Il5oM2peUIl44g==", - "dependencies": { - "Serilog": "2.12.0" - } - }, "Serilog.Exceptions": { "type": "Transitive", "resolved": "8.4.0", @@ -529,7 +521,6 @@ "Sentry.Serilog": "[3.33.0, )", "Serilog": "[2.12.0, )", "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Enrichers.GlobalLogContext": "[3.0.0, )", "Serilog.Exceptions": "[8.4.0, )", "Serilog.Sinks.Console": "[4.1.0, )", "Serilog.Sinks.Seq": "[5.2.2, )", diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bridge/IBridge.cs b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bridge/IBridge.cs index 1bdcd6e364..3b26e58d82 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bridge/IBridge.cs +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bridge/IBridge.cs @@ -36,8 +36,13 @@ public interface IBridge /// Action to run on main thread. public void RunOnMainThread(Action action); + /// + /// Bridge was not associated with a binding public void Send(string eventName); + /// + /// data to store + /// public void Send(string eventName, T data) where T : class; } diff --git a/DUI3-DX/Sdk/Speckle.Connectors.Utils/NotNullExtensions.cs b/DUI3-DX/Sdk/Speckle.Connectors.Utils/NotNullExtensions.cs index a34d6dd671..59d9f2b3c0 100644 --- a/DUI3-DX/Sdk/Speckle.Connectors.Utils/NotNullExtensions.cs +++ b/DUI3-DX/Sdk/Speckle.Connectors.Utils/NotNullExtensions.cs @@ -5,6 +5,7 @@ namespace Speckle.Connectors.Utils; public static class NotNullExtensions { + /// public static async Task NotNull( this Task task, [CallerArgumentExpression(nameof(task))] string? message = null @@ -19,6 +20,7 @@ public static async Task NotNull( return x; } + /// public static async Task NotNull( this Task task, [CallerArgumentExpression(nameof(task))] string? message = null @@ -33,6 +35,11 @@ public static async Task NotNull( return x.Value; } + /// the object to check for null + /// see + /// type + /// A non null value + /// was null public static T NotNull([NotNull] this T? obj, [CallerArgumentExpression(nameof(obj))] string? paramName = null) where T : class { @@ -43,6 +50,7 @@ public static T NotNull([NotNull] this T? obj, [CallerArgumentExpression(name return obj; } + /// public static T NotNull([NotNull] this T? obj, [CallerArgumentExpression(nameof(obj))] string? paramName = null) where T : struct {