private void DoReloadAll(GuiWidget drawingWidget, DrawEventArgs e) { UiThread.RunOnIdle(() => { if (MainView != null) { using (new QuickTimer($"ReloadAll_{reloadCount++}:")) { // give the widget a chance to hear about the close before they are actually closed. PopOutManager.SaveIfClosed = false; WidescreenPanel.PreChangePanels.CallEvents(this, null); MainView?.CloseAllChildren(); using (new QuickTimer("ReloadAll_AddElements")) { MainView?.AddElements(); } PopOutManager.SaveIfClosed = true; DoneReloadingAll?.CallEvents(null, null); } MainView.AfterDraw -= DoReloadAll; pendingReloadRequest = false; } }); }
public void ReloadAll(object sender, EventArgs e) { UiThread.RunOnIdle((state) => { // give the widget a chance to hear about the close before they are actually colsed. WidescreenPanel.PreChangePanels.CallEvents(this, null); MainView.CloseAndRemoveAllChildren(); MainView.AddElements(); }); }
public void ReloadAll(object sender, EventArgs e) { UiThread.RunOnIdle(() => { using (new PerformanceTimer("ReloadAll", "Total")) { // give the widget a chance to hear about the close before they are actually closed. PopOutManager.SaveIfClosed = false; WidescreenPanel.PreChangePanels.CallEvents(this, null); MainView.CloseAllChildren(); using (new PerformanceTimer("ReloadAll", "AddElements")) { MainView.AddElements(); } PopOutManager.SaveIfClosed = true; DoneReloadingAll?.CallEvents(null, null); } }); }