Esempio n. 1
0
 private void SaveHotkeyOnHotkeyPressed(object sender, EventArgs eventArgs)
 {
     try
     {
         WindySerializationHelpers.SaveDesktopState();
         WindySerializationHelpers.SaveWindows();
         PopulateSavedWindows();
         _trayIcon.ShowBalloonTip(5000, GetString("TipTitle_WindowLayoutSaved"), GetString("TipText_WindowLayoutSaved"), ToolTipIcon.Info);
     }
     catch (Exception ex)
     {
         _trayIcon.ShowBalloonTip(10000,
                                  GetString("TipTitle_CouldntSaveWindows"),
                                  string.Format(GetString("TipText_CouldntSaveWindows"), ex.Message, ex.GetType()),
                                  ToolTipIcon.Error);
     }
 }
Esempio n. 2
0
        public WindyApplicationContext()
        {
            Initialize();

            this.ThreadExit                      += Application_ApplicationExit;
            Application.ApplicationExit          += Application_ApplicationExit;
            SystemEvents.DisplaySettingsChanging += SystemEvents_DisplaySettingsChanging;

            _trayIcon.Visible     = true;
            _trayIcon.MouseClick += (sender, args) =>
            {
                // show only on a deliberate left click and not when they mash the mouse buttons or something
                if (args.Button == MouseButtons.Left)
                {
                    ShowWindyIsRunningTip();
                }
            };

            WindySerializationHelpers.SaveDesktopState();
            ShowWindyIsRunningTip();
        }