static void OnGraphicsResourcesRecreate(bool recreate)
        {
            if (!recreate)
            {
                UIRenderDevice.PrepareForGfxDeviceRecreate();
            }

            var it = UIElementsUtility.GetPanelsIterator();

            while (it.MoveNext())
            {
                if (recreate)
                {
                    it.Current.Value.atlas?.Reset();
                }
                else
                {
                    (it.Current.Value.GetUpdater(VisualTreeUpdatePhase.Repaint) as UIRRepaintUpdater)?.DestroyRenderChain();
                }
            }

            if (!recreate)
            {
                UIRenderDevice.FlushAllPendingDeviceDisposes();
            }
            else
            {
                UIRenderDevice.WrapUpGfxDeviceRecreate();
            }
        }
        private static void OnGraphicsResourcesRecreate(bool recreate)
        {
            bool flag = !recreate;

            if (flag)
            {
                UIRenderDevice.PrepareForGfxDeviceRecreate();
            }
            Dictionary <int, Panel> .Enumerator panelsIterator = UIElementsUtility.GetPanelsIterator();
            while (panelsIterator.MoveNext())
            {
                KeyValuePair <int, Panel> current = panelsIterator.Current;
                UIRRepaintUpdater         expr_32 = current.Value.GetUpdater(VisualTreeUpdatePhase.Repaint) as UIRRepaintUpdater;
                RenderChain renderChain           = (expr_32 != null) ? expr_32.renderChain : null;
                if (recreate)
                {
                    if (renderChain != null)
                    {
                        renderChain.AfterRenderDeviceRelease();
                    }
                }
                else if (renderChain != null)
                {
                    renderChain.BeforeRenderDeviceRelease();
                }
            }
            bool flag2 = !recreate;

            if (flag2)
            {
                UIRenderDevice.FlushAllPendingDeviceDisposes();
            }
            else
            {
                UIRenderDevice.WrapUpGfxDeviceRecreate();
            }
        }