예제 #1
0
        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;
                }
            });
        }
예제 #2
0
        public void ReloadAll()
        {
            if (pendingReloadRequest || MainView == null)
            {
                return;
            }

            pendingReloadRequest = true;

            UiThread.RunOnIdle(() =>
            {
                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?.CreateAndAddChildren();
                    }
                    PopOutManager.SaveIfClosed = true;
                    this.DoneReloadingAll?.CallEvents(null, null);
                }

                pendingReloadRequest = false;
            });
        }
 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);
         }
     });
 }