private void PopupInCiteControl_PreviewKeyDown(object sender, KeyEventArgs e) { if (Key.Enter == e.Key) { if (KeyboardTools.IsCTRLDown()) { ButtonCiteApart_Click(null, null); } else { ButtonCiteTogether_Click(null, null); } e.Handled = true; } else if (Key.S == e.Key && KeyboardTools.IsCTRLDown()) { ButtonSnippet_Click(null, null); e.Handled = true; } else if (Key.F5 == e.Key) { ButtonRefresh_Click(null, null); e.Handled = true; } else if (Key.Escape == e.Key) { instance.ObjCheckKeepOpen.IsChecked = false; chw.Close(); e.Handled = true; } else if (Key.Up == e.Key) { try { --ObjPDFDocuments.SelectedIndex; ObjPDFDocuments.ScrollIntoView(ObjPDFDocuments.SelectedItem); e.Handled = true; } catch (Exception ex) { Logging.Error(ex, "Key UP"); } } else if (Key.Down == e.Key) { try { ++ObjPDFDocuments.SelectedIndex; ObjPDFDocuments.ScrollIntoView(ObjPDFDocuments.SelectedItem); e.Handled = true; } catch (Exception ex) { Logging.Error(ex, "Key DOWN"); } } }
private void LinkedDocumentsControl_PreviewKeyDown(object sender, KeyEventArgs e) { if (Key.Enter == e.Key) { LinkSelectedDocument(); e.Handled = true; } else if (Key.Escape == e.Key) { ObjSearchBox.Clear(); e.Handled = true; } else if (Key.Up == e.Key) { try { --ObjPDFDocuments.SelectedIndex; ObjPDFDocuments.ScrollIntoView(ObjPDFDocuments.SelectedItem); e.Handled = true; } catch (Exception ex) { Logging.Error(ex, "Key UP"); } } else if (Key.Down == e.Key) { try { ++ObjPDFDocuments.SelectedIndex; ObjPDFDocuments.ScrollIntoView(ObjPDFDocuments.SelectedItem); e.Handled = true; } catch (Exception ex) { Logging.Error(ex, "Key DOWN"); } } }