예제 #1
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();
     }
 }
예제 #2
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();
            }
        }