Skip to content

Commit

Permalink
D ui3 299 arc gis not opening saved model cards (#3532)
Browse files Browse the repository at this point in the history
* resurrect DocumentStore subscriptions

* read metadata from existing map

* don't break DI if Map is still not loaded
  • Loading branch information
KatKatKateryna authored Jun 26, 2024
1 parent 85c2ff6 commit 473711f
Showing 1 changed file with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,31 @@ ITopLevelExceptionHandler topLevelExceptionHandler
)
: base(serializerOption, true)
{
ActiveMapViewChangedEvent.Subscribe(a => topLevelExceptionHandler.CatchUnhandled(() => OnMapViewChanged(a)));
ProjectSavingEvent.Subscribe(_ =>
{
topLevelExceptionHandler.CatchUnhandled(OnProjectSaving);
return Task.CompletedTask;
});
ProjectClosingEvent.Subscribe(_ =>
ActiveMapViewChangedEvent.Subscribe(a => topLevelExceptionHandler.CatchUnhandled(() => OnMapViewChanged(a)), true);
ProjectSavingEvent.Subscribe(
_ =>
{
topLevelExceptionHandler.CatchUnhandled(OnProjectSaving);
return Task.CompletedTask;
},
true
);
ProjectClosingEvent.Subscribe(
_ =>
{
topLevelExceptionHandler.CatchUnhandled(OnProjectClosing);
return Task.CompletedTask;
},
true
);

// in case plugin was loaded into already opened Map, read metadata from the current Map
if (IsDocumentInit == false && MapView.Active != null)
{
topLevelExceptionHandler.CatchUnhandled(OnProjectClosing);
return Task.CompletedTask;
});
IsDocumentInit = true;
ReadFromFile();
OnDocumentChanged();
}
}

private void OnProjectClosing()
Expand Down

0 comments on commit 473711f

Please sign in to comment.