do not cause SelectionChanged to be handled (again) while we are currently processing a selection change

This commit is contained in:
Michael Becker 2021-08-11 23:53:31 -04:00
parent df32d49b11
commit bb6bb8b60a
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C

View File

@ -432,8 +432,14 @@ namespace UniversalEditor.UserInterface
((EditorApplication)Application.Instance).OnEditorChanged(e);
}
private bool __inhibit_SelectionChanged = false;
private void dckContainer_SelectionChanged(object sender, EventArgs e)
{
if (__inhibit_SelectionChanged)
return;
__inhibit_SelectionChanged = true;
Editor editor = null;
try
{
@ -462,6 +468,8 @@ namespace UniversalEditor.UserInterface
_OnEditorChanged(new EditorChangedEventArgs(this, _prevEditor, editor));
}
_prevEditor = editor;
__inhibit_SelectionChanged = false;
}
private void UpdateMenuItems()