예제 #1
0
        public SynGesturesLogic()
        {
            var a = Assembly.GetEntryAssembly();

            _configPath = Path.Combine(Path.GetDirectoryName(a.Location), "synGesturesData.xml");
            _config     = Configuration.Load(_configPath);

            _actions = new InvokeActionManager(_config);

            _synapticsHelper = new SynapticsHelper(_config);
            if (!_synapticsHelper.Init())
            {
                Application.Exit();
            }
            _synapticsHelper.ActionEvent += ExecuteAction;

            _menu = new ContextMenu();
            _menu.MenuItems.Add("Settings", new EventHandler(tray_settings));
            _menu.MenuItems.Add("-");
            _menu.MenuItems.Add("Exit", new EventHandler(tray_exit));
            _icn = new NotifyIcon
            {
                Visible     = true,
                ContextMenu = _menu,
                Icon        = Resources.tray,
                Text        = "SynGestures"
            };
            //icn.MouseClick += new MouseEventHandler(icn_click);

            SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
        }