Esempio n. 1
0
        /// <summary>
        /// Загрузка основного меню в зависимости от настроек
        /// </summary>
        public static void LoadMainMenu()
        {
            try
            {
                if (Variables.FloatMenu)
                {
                    if (MpMainMenuWin == null)
                    {
                        MpMainMenuWin         = new MpFloatMenu();
                        MpMainMenuWin.Closed += mpMainMenuWin_Closed;
                    }

                    if (MpMainMenuWin.IsLoaded)
                    {
                        return;
                    }

                    Application.ShowModelessWindow(Application.MainWindow.Handle, MpMainMenuWin);
                }
                else
                {
                    MpMainMenuWin?.Close();
                }
            }
            catch (Exception exception)
            {
                ExceptionBox.Show(exception);
            }
        }
Esempio n. 2
0
 static void mpMainMenuWin_Closed(object sender, EventArgs e)
 {
     Regestry.SetValue("FloatingMenuTop", MpMainMenuWin.Top.ToString(CultureInfo.InvariantCulture));
     Regestry.SetValue("FloatingMenuLeft", MpMainMenuWin.Left.ToString(CultureInfo.InvariantCulture));
     MpMainMenuWin = null;
 }