Exemplo n.º 1
0
        private void SystemEvents_DisplaySettingsChanging(object sender, EventArgs e)
        {
            var ds = WindySerializationHelpers.LoadDesktopState();

            if (CurrentDesktopLayoutMatches(ds))
            {
                RestoreWindows();
            }
        }
Exemplo n.º 2
0
        private void RestoreHotkeyOnHotkeyPressed(object sender, EventArgs eventArgs)
        {
            var loaded = WindySerializationHelpers.LoadDesktopState();

            if (!CurrentDesktopLayoutMatches(loaded))
            {
                var res =
                    MessageBox.Show(
                        GetString("MessageBoxText_RestoringToNonMatchingScreenLayout"),
                        GetString("MessageBoxTitle_RestoringToNonMatchingScreenLayout"),
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Warning);

                if (res == DialogResult.No)
                {
                    return;
                }
            }

            RestoreWindows();
        }