Example #1
0
 public MainWindow()
 {
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     InitializeComponent();
     mListHotkey  = TbHotkey.GetAll();
     mListHideWin = TbHideWin.GetAll();
 }
Example #2
0
 private void SaveHotKey(IWindowEntry win, Key key)
 {
     if (win.hotKey != (int)key)
     {
         win.hotKey = (int)key;
         TbHotkey.updateHotkey(win, string.IsNullOrEmpty(win.ExecutablePath) ? false : true);
         mCallback();
     }
 }
Example #3
0
 private void OnHotkeyUpdateEvent()
 {
     mListHotkey = TbHotkey.GetAll();
     // 把key更新
     foreach (var win in mWins.Windows)
     {
         SetHotkey(win);
     }
 }
Example #4
0
        private void Button_SetExePath_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new Microsoft.Win32.OpenFileDialog();
            var tag    = (sender as Button).DataContext as TbHotKeyEntity;

            dialog.Filter           = "exe file | *.exe";
            dialog.Title            = "设置" + tag.name + "路径";
            dialog.InitialDirectory = tag.executablePath;
            if (dialog.ShowDialog() == true)
            {
                tag.executablePath = dialog.FileName;
                TbHotkey.updateHotkey(tag, true);
                RefreshData();
                mCallback();
            }
        }
Example #5
0
 private void Button_Del_Click(object sender, RoutedEventArgs e)
 {
     TbHotkey.Del((sender as Button).DataContext as TbHotKeyEntity);
     RefreshData();
     mCallback();
 }
Example #6
0
 private void RefreshData()
 {
     dataGrid1.ItemsSource = TbHotkey.GetAll();
 }
 private void SetHotkeyButton_Click(object sender, RoutedEventArgs e)
 {
     TbHotkey.Focusable = true;
     TbHotkey.Focus();
     SetHotkeyButton.Content = ResourceProvider.GetString("LOCPlayState_SettingPressHotkeyPromtButtonLabel");
 }