Skip to content

Commit

Permalink
local to private function
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-Morgan committed Jun 19, 2024
1 parent fbdf66b commit cd956bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Speckle.Connectors.Rhino7.Bindings;

public class RhinoSelectionBinding : ISelectionBinding
{
private readonly RhinoIdleManager _idleManager;
private readonly TopLevelExceptionHandler _topLevelExceptionHandler;
private const string SELECTION_EVENT = "setSelection";

Expand All @@ -20,17 +21,18 @@ public RhinoSelectionBinding(
TopLevelExceptionHandler topLevelExceptionHandler
)
{
_idleManager = idleManager;
_topLevelExceptionHandler = topLevelExceptionHandler;
Parent = parent;

RhinoDoc.SelectObjects += OnSelectionChange;
RhinoDoc.DeselectObjects += OnSelectionChange;
RhinoDoc.DeselectAllObjects += OnSelectionChange;
}

void OnSelectionChange(object o, EventArgs eventArgs)
{
idleManager.SubscribeToIdle(() => _topLevelExceptionHandler.CatchUnhandled(UpdateSelection));
}
void OnSelectionChange(object o, EventArgs eventArgs)
{
_idleManager.SubscribeToIdle(() => _topLevelExceptionHandler.CatchUnhandled(UpdateSelection));
}

private void UpdateSelection()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public static void AddConnectorUtils(this SpeckleContainerBuilder builder)
builder.AddSingleton<CancellationManager>();
builder.AddScoped<ReceiveOperation>();

// POC: will likely need refactoring with our reporting pattern.
//TODO: Logger will likely be removed from Core, we'll plan to figure out the config later...
var serilogLogger = SpeckleLog.Logger;

Expand Down

0 comments on commit cd956bd

Please sign in to comment.