public OptionsView()
        {
            InitializeComponent();

            viewModel           = mainGrid.DataContext as OptionsViewModel;
            globalEventProvider = new GlobalEventProvider();
            //makes sure all up keys are parsed, before resetting with the debounced down key event
            globalKeyUpEventHandler = globalEventProvider.CreateDebounceKeyEventHandler(Global_OnKeyUp, TimeSpan.FromMilliseconds(300));

            AttachGlobalKeyListener();
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();
            GlobalEventProvider actHook = new GlobalEventProvider();

            ClientSize = new Size(w, h);
            Srn        = Screen.PrimaryScreen;
            tempHeight = Srn.Bounds.Width;
            tempWidth  = Srn.Bounds.Height;
            Resolution.CResolution ChangeRes = new Resolution.CResolution(FixHeight, FixWidth);
            Cursor.Hide();
            folder_check();
            recyclebin_desktop_area.Visible = false;
            Rectangle    r  = new Rectangle(0, 0, defaultaccountpic.Width, defaultaccountpic.Height);
            GraphicsPath gp = new GraphicsPath();
            int          d  = 15;

            gp.AddArc(r.X, r.Y, d, d, 180, 90);
            gp.AddArc(r.X + r.Width - d, r.Y, d, d, 270, 90);
            gp.AddArc(r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90);
            gp.AddArc(r.X, r.Y + r.Height - d, d, d, 90, 90);
            recyclebin_desktop_area.Location = new Point(recyclebin_desktop_icon.Size.Width - 20, recyclebin_desktop_icon.Size.Height - 10);
            recyclebin_desktop_text.Location = new Point(recyclebin_desktop_icon.Location.X / 2 + 5, recyclebin_desktop_icon.Location.Y + 50);
            defaultaccountpic.Region         = new Region(gp);
            defaultaccountpic.Click         += new EventHandler(loginUser);
            defaultaccountlabel.Click       += new EventHandler(loginUser);
            start.Click                         += new EventHandler(start_Click);
            start.MouseHover                    += new EventHandler(start_Hover);
            start.MouseLeave                    += new EventHandler(start_MouseLeave);
            taskbar.Click                       += new EventHandler(start_close);
            defaultbackground.Click             += new EventHandler(start_clickoff);
            clock_tick.Tick                     += new EventHandler(clock_Tick);
            clock_tick.Interval                  = 1;
            startmenu_shutdownbutton.Click      += new EventHandler(startmenu_shutdownbutton_Click);
            startmenu_shutdownbutton.MouseEnter += new EventHandler(startmenu_shutdownbutton_MouseEnter);
            startmenu_shutdownbutton.MouseLeave += new EventHandler(startmenu_shutdownbutton_MouseLeave);
            actHook.KeyDown                     += new KeyEventHandler(hotkey_handler);
            recyclebin_desktop_area.Click       += new EventHandler(recyclebin_desktop_Click);
            recyclebin_desktop_area.DoubleClick += new EventHandler(recyclebin_desktop_DoubleClick);
            recyclebin_desktop_icon.Click       += new EventHandler(recyclebin_desktop_Click);
            recyclebin_desktop_icon.DoubleClick += new EventHandler(recyclebin_desktop_DoubleClick);
            recyclebin_desktop_text.Click       += new EventHandler(recyclebin_desktop_Click);
            recyclebin_desktop_text.DoubleClick += new EventHandler(recyclebin_desktop_DoubleClick);
            defaultbackground.Click             += new EventHandler(deselect_desktop_icons);
            loginshutdown.Click                 += new EventHandler(login_shutdownbutton_Click);
            loginshutdown.Visible                = false;
            boot();
        }
Пример #3
0
 public HookManager()
 {
     _provider          = new Gma.UserActivityMonitor.GlobalEventProvider();
     _provider.KeyDown += _provider_KeyDown;
     _provider.KeyUp   += _provider_KeyUp;
 }