private void CloseNewDesktop()
        {
            if (originalDesktop != null)
            {
                originalDesktop.Activate();
                processFactory.StartupDesktop = originalDesktop;
                logger.Info($"Switched back to original desktop {originalDesktop}.");
            }
            else
            {
                logger.Warn($"No original desktop found to activate!");
            }

            if (newDesktop != null)
            {
                newDesktop.Close();
                logger.Info($"Closed new desktop {newDesktop}.");
            }
            else
            {
                logger.Warn($"No new desktop found to close!");
            }

            explorerShell.Resume();
        }
Beispiel #2
0
        public static void Init(IDesktop desk, bool show = false)
        {
            IDesktop deskToClose = null;

            if (_desktop != null)
            {
                deskToClose = _desktop;
            }
            _desktop = desk;
            if (show == true)
            {
                _desktop.Show();
            }
            deskToClose?.Close();
        }