Пример #1
0
        private void _taskTrayMenu_OnObserveStateChanged(object sender, TaskTrayMenu.ObserveStateChangedEventArgs e)
        {
            AppSettingData.GetInstance().Observered = e.Observerd;
            AppSettingData.GetInstance().Save();

            if (e.Observerd)
            {
                KeymappingHandler.Start();
            }
            else
            {
                KeymappingHandler.Stop();
            }
        }
Пример #2
0
        /// <summary>
        /// application startup event
        /// </summary>
        /// <param name="e"></param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            ShutdownMode  = ShutdownMode.OnExplicitShutdown;
            _taskTrayMenu = new TaskTrayMenu(AppSettingData.GetInstance().ClickCount);
            _taskTrayMenu.SetObserveChecked(AppSettingData.GetInstance().Observered);
            _taskTrayMenu.OnObserveStateChanged += _taskTrayMenu_OnObserveStateChanged;
            _taskTrayMenu.OnClickCountChanged   += _taskTrayMenu_OnClickCountChanged;
            _taskTrayMenu.OnExitClicked         += _taskTrayMenu_OnExitClicked;

            KeymappingHandler.SetUp();
            KeymappingHandler.ClickCount = AppSettingData.GetInstance().ClickCount;
            if (AppSettingData.GetInstance().Observered)
            {
                KeymappingHandler.Start();
            }
        }
Пример #3
0
 private void _taskTrayMenu_OnExitClicked(object sender, EventArgs e)
 {
     KeymappingHandler.Stop();
     base.Shutdown();
 }
Пример #4
0
 /// <summary>
 /// application exit event
 /// </summary>
 /// <param name="e"></param>
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     _taskTrayMenu.Dispose();
     KeymappingHandler.Stop();
 }