コード例 #1
0
        public void NextMatchAdvancesTheIterator()
        {
            _nodeSearcher.SearchByName("folder");
            var match1 = _nodeSearcher.CurrentMatch;
            var match2 = _nodeSearcher.NextMatch();

            Assert.That(match1, Is.Not.EqualTo(match2));
        }
コード例 #2
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);
     }
 }