public void WorksCorrectlyIfComponentExists()
        {
            const int numOfTries = 50;

            for (int i = 0; i < numOfTries; ++i)
            {
                Point pointInsideRect = new Point(rnd.Next(width), rnd.Next(height));
                Assert.IsTrue(BSManager.ExistsComponentAtPoint(pointInsideRect));
            }
        }
        public void WorksCorrectlyIfNoComponentMatches()
        {
            const int numOfTries = 50;
            int       j;

            for (int i = 0; i < numOfTries; ++i)
            {
                j = rnd.Next(2);
                Point pointOutsideRect = new Point(rnd.Next(width) + width * j, rnd.Next(height) + height * (1 - j));
                Assert.IsFalse(BSManager.ExistsComponentAtPoint(pointOutsideRect));
            }
        }
 private void mainPictureBox_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         contextMenuStrip.Items.Clear();
         if (BSManager.ExistsComponentAtPoint(e.Location))
         {
             contextMenuStrip.Items.Add("Налаштувати", null, new EventHandler((obj, arg) => BSManager.UserDoubleClickedOnPoint(e.Location)));
             contextMenuStrip.Items.Add(new ToolStripSeparator());
         }
         AddGeneralHelpItemToContextMenuStrip(contextMenuStrip, "Це головна робоча область. Перетягніть сюди усі потрібні елементи (із списку елементів " +
                                              "зліва), з'єднайте їх потрібним чином і натисніть кнопку 'Запустити' на панелі згори (або просто клавішу F5). Це призведе до запуску побудованої " +
                                              "схеми на виконання. Для налаштування будь-якого елемента двічі натисніть лівою кнопкою миші на ньому, або один раз правою кнопкою, і виберіть 'Налаштувати'.");
         contextMenuStrip.Show((sender as Control).PointToScreen(e.Location));
     }
 }