fix: recover fixture activation raised during document open
This commit is contained in:
@@ -195,6 +195,16 @@ internal sealed class FirstLimitedApplyAutomationCoordinator
|
||||
document.CommandCancelled += OnCommandCancelled;
|
||||
documentHandlersSubscribed = true;
|
||||
Transition(CoordinatorState.Running, "AutomationRunning");
|
||||
// DocumentActivated can be raised synchronously by Open before the
|
||||
// coordinator receives the returned Document. Confirm the current
|
||||
// active document after assignment so that one missed event cannot
|
||||
// strand the workflow waiting for another startup Idle.
|
||||
if (ReferenceEquals(AcadApplication.DocumentManager.MdiActiveDocument, document))
|
||||
{
|
||||
fixtureDocumentActivated = true;
|
||||
transitions.Add("FixtureDocumentActiveAfterOpen");
|
||||
TryActivateProjectAndVerifyContext();
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex) { FailFromCallback("Start", ex, "AUTOMATION_START_FAILED"); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user