public void BindKeywords() { var toggleModifier1 = Helper.ParseModifier(IniFile.IniReadValue(Consts.ToggleHotkeySectionName, Consts.ModifierKeyName)); var toggleKey = Helper.ParseKey(IniFile.IniReadValue(Consts.ToggleHotkeySectionName, Consts.KeyKeyName)); var saveModifier1 = Helper.ParseModifier(IniFile.IniReadValue(Consts.SaveHotkeySectionName, Consts.ModifierKeyName)); var saveKey = Helper.ParseKey(IniFile.IniReadValue(Consts.SaveHotkeySectionName, Consts.KeyKeyName)); if (saveModifier1 != Modifiers.None && saveKey != Keys.None) { SaveHotKey = new Hotkey(saveModifier1, saveKey); HotkeyBinder.Bind(SaveHotKey).To(HotkeyCallback); } if (toggleModifier1 != Modifiers.None && toggleKey != Keys.None) { ToggleHotKey = new Hotkey(toggleModifier1, toggleKey); HotkeyBinder.Bind(ToggleHotKey).To(ToggleTheWindow); } HotkeyBinder.Bind(Modifiers.None, Keys.Down).To(FoucsToListViewAndDown); HotkeyBinder.Bind(Modifiers.None, Keys.Up).To(FoucsToListViewAndUp); }
//End of the code for the window moving. /// <summary> /// Initial constructor. /// </summary> public FaceSplit() { InitializeComponent(); this.ConfigureFilesDialogs(); this.layoutSettings = new Model.LayoutSettings(); if (!Settings.Default.LayoutSettingsFile.Equals("")) { this.layoutSettings.File = Settings.Default.LayoutSettingsFile; } this.hotkeyBinder = new HotkeyBinder(); this.BindHotkeys(); this.globalHotkeysActive = true; segmentsRectangles = new List <Rectangle>(); watchRectangle = new Rectangle(ZERO, ZERO, DEFAULT_WIDTH, DEFAULT_HEIGHT); this.displayMode = DisplayMode.TIMER_ONLY; this.watchColor = Settings.Default.TimerNotRunningColor; this.segmentWatchColor = Settings.Default.SegmentTimerNotRunningColor; informations = new List <Information>(); this.splitY_start = 0; base.Paint += new PaintEventHandler(this.DrawFaceSplit); base.Size = new Size(DEFAULT_WIDTH, DEFAULT_HEIGHT); base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); watch = new Stopwatch(); segmentWatch = new Stopwatch(); this.ticksTimer.Enabled = true; }
public MainDesktopWindow() { InitializeComponent(); Visibility = Visibility.Hidden; _initFlag = true; _appObjList = new List <List <KeyValuePair <AppObj, Label> > >(); _fileTree = new Tree(); _settingMenu = new SettingMenu(this); _hotKeyBinder = new HotkeyBinder(); _historyQueue = new Queue <string>(); InitImage(SearchIcon, "magnify"); InitImage(SettingGearImg, "gear"); InitAppIcons(); ShowPage(); SearchInput.Focus(); BindUniversalHotKey(); ReadSetting(); ReadHistory(); }