in src/dotnet/JetBrains.PresentationAssistant/BasePopupWindow.cs [28:57]
protected BasePopupWindow(LifetimeDefinition lifetimeDefinition, IPopupWindowContext context,
PopupWindowMutex mutex, HideFlags hideFlags)
{
this.lifetimeDefinition = lifetimeDefinition;
lifetime = lifetimeDefinition.Lifetime;
Context = context;
Mutex = mutex;
HideMethod = FormHideMethod.Visibility;
this.hideFlags = hideFlags;
lifetime.OnTermination(() =>
{
if (!Visible)
{
CloseWindowCore();
return;
}
void Handle(object sender, EventArgs args)
{
CloseWindowCore();
Closed -= Handle;
}
Closed += Handle;
HideWindow();
});
}