Esempio n. 1
0
 private void Search_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         // On enter, copy to the clipboard and move on.
         GiphySearchResult local = null;
         lock (m_resultLock)
         {
             local = m_currentResults;
         }
         if (local != null && local.Data.Length > 0)
         {
             Clippy.SetClipboardContent(local.Data[m_currentResultShown]);
         }
         Close();
     }
     if (e.Key == Key.Right || e.Key == Key.Down)
     {
         ShowNextImage(true);
         e.Handled = true;
     }
     if (e.Key == Key.Left || e.Key == Key.Up)
     {
         ShowNextImage(false);
         e.Handled = true;
     }
 }