コード例 #1
0
 private void txtSearch_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Escape)
         {
             e.Handled = true;
             olvConnections.Focus();
         }
         else if (e.KeyCode == Keys.Up)
         {
             var match = _nodeSearcher.PreviousMatch();
             JumpToNode(match);
             e.Handled = true;
         }
         else if (e.KeyCode == Keys.Down)
         {
             var match = _nodeSearcher.NextMatch();
             JumpToNode(match);
             e.Handled = true;
         }
         else
         {
             tvConnections_KeyDown(sender, e);
         }
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddExceptionStackTrace("txtSearch_KeyDown (UI.Window.ConnectionTreeWindow) failed", ex);
     }
 }
コード例 #2
0
        public void PreviousMatchRollsBackTheIterator()
        {
            _nodeSearcher.SearchByName("con");
            var match1 = _nodeSearcher.CurrentMatch;

            _nodeSearcher.NextMatch();
            var match2 = _nodeSearcher.PreviousMatch();

            Assert.That(match1, Is.EqualTo(match2));
        }