示例#1
0
 private void Reset()
 {
     Search         = "";
     FindIndicator  = "";
     SelectedTarget = NavigationTargets.First();
     _matchingTargets.Clear();
     Refresh();
 }
示例#2
0
        public void GotoPrevFound()
        {
            int ixFound = _matchingTargets.IndexOf(SelectedTarget);

            if (ixFound > 0)
            {
                SelectedTarget = _matchingTargets[ixFound - 1];
                Refresh();
            }
        }
示例#3
0
        public void GotoNextFound()
        {
            int ixFound = _matchingTargets.IndexOf(SelectedTarget);

            if (ixFound >= 0 && ixFound + 1 < _matchingTargets.Count)
            {
                SelectedTarget = _matchingTargets[ixFound + 1];
                Refresh();
            }
        }
示例#4
0
 private void sm_WaitingForKey_OnEntryFrom_Char(char c)
 {
     // add char to search string
     // find best match
     //Console.WriteLine( "" );
     //Console.WriteLine( "pressed " + c );
     _matchingTargets = NavigationTargets.FindAll(x => x.Target.ToUpper().StartsWith(Search + c));
     if (_matchingTargets.Count > 0)
     {
         NavigationTarget found = _matchingTargets.First();
         //Console.WriteLine( "found " + found.Target );
         Search        += c;
         SelectedTarget = found;
         Refresh();
     }
     //Console.WriteLine( "sm_OnEntry_Char() exit: " + Search );
 }
示例#5
0
 private void sm_WaitingForKey_OnEntryFrom_Backspace()
 {
     if (Search == "")
     {
         return;
     }
     // remove las char from search string
     Search = Search.Substring(0, Search.Length - 1);
     //Console.WriteLine( Search );
     if (Search == "")
     {
         SelectedTarget = NavigationTargets.First();
         Refresh();
     }
     else
     {
         // find best match if we still have a search string
         _matchingTargets = NavigationTargets.FindAll(x => x.Target.ToUpper().StartsWith(Search));
         Debug.Assert(_matchingTargets.Count > 0);
         SelectedTarget = _matchingTargets.First();
         Refresh();
     }
 }