Esempio n. 1
0
 public void ShowImages()
 {
     SuspendLayout();
     pair          = this.mainForm.category.getNewPair();
     pbLeft.Image  = pair.left;
     pbRight.Image = pair.right;
 }
 public ImagePair getNewPair()
 {
     Random random = new Random();
     int num;
     while (true)
     {
         num = random.Next(5);
         if (num != lastRandom1 && num != lastRandom2)
         {
             lastRandom2 = lastRandom1;
             lastRandom1 = num;
             break;
         }
     }
     ImagePair pair = new ImagePair(Name, num + 1);
     return pair;
 }
Esempio n. 3
0
        public ImagePair getNewPair()
        {
            Random random = new Random();
            int    num;

            while (true)
            {
                num = random.Next(5);
                if (num != lastRandom1 && num != lastRandom2)
                {
                    lastRandom2 = lastRandom1;
                    lastRandom1 = num;
                    break;
                }
            }
            ImagePair pair = new ImagePair(Name, num + 1);

            return(pair);
        }
 public void ShowImages()
 {
     SuspendLayout();
     pair = this.mainForm.category.getNewPair();
     pbLeft.Image = pair.left;
     pbRight.Image = pair.right;
 }