Esempio n. 1
0
 private bool[] danhSachKe(DinhDoThi d, int count, List <int> maus)
 {
     bool[] nhan = new bool[Colors.Count];
     for (int i = 0; i < count; i++)
     {
         if (dothi.DinhDoThis[i].Id != d.Id && maTranKe[dothi.DinhDoThis[i].Id, d.Id] && maus[i] != -1)
         {
             nhan[maus[i]] = true;
         }
     }
     return(nhan);
 }
Esempio n. 2
0
 //// Thuat giai
 private void toMau(DinhDoThi d, int index)
 {
     if (index < 0 || index > Colors.Count)
     {
         Random rand = new Random();
         while (true)
         {
             Color c     = Color.FromArgb(255, rand.Next(20, 255), rand.Next(20, 255), rand.Next(20, 255));
             bool  check = Colors.Where(cl => cl.R == c.R && cl.B == c.B && cl.G == c.G) == null;
             if (check)
             {
                 Colors.Add(c);
                 break;
             }
         }
     }
     d.MyColor = Colors[index];
     d.Invalidate();
 }