Exemplo n.º 1
0
 // does the fingers list contain name already?
 private bool usedName(List<FingerNameClass.FingerName> nms, FingerNameClass.FingerName name)
 {
     foreach (FingerNameClass.FingerName fn in nms)
         if (fn == name)
         {
             return true;
         }
     return false;
 }
Exemplo n.º 2
0
 // move backwards through fingers list labeling unknown fingers
 private void labelPrev(List<FingerNameClass.FingerName> nms, int i, FingerNameClass.FingerName name)
 {
     FingerNameClass fnc = new FingerNameClass();
     i--;
     while ((i >= 0) && (name != FingerNameClass.FingerName.UNKNOWN))
     {
         if (nms.ElementAt(i) == FingerNameClass.FingerName.UNKNOWN)
         { // unknown finger
             name = fnc.getPrev(name);
             if (!usedName(nms, name))
             {
                 nms.RemoveAt(i);
                 nms.Insert(i, name);
             }
         }
         else
         { // finger is named already
             name = nms.ElementAt(i);
         }
         i--;
     }
 }