private void StartAd()
        {
            if (adWindow != null)
            {
                foreach (var wind in adWindow)
                {
                    wind?.Close();
                }
            }

            adWindow = new AdWindow[2];
            for (int i = 0; i < 2; i++)
            {
                if (adWindow[i] == null)
                {
                    adWindow[i] = new AdWindow(this)
                    {
                        Top  = this.Top + (330 * i) + 70,
                        Left = this.Left + 240
                    };

                    adWindow[i].Show();
                }
            }
        }
 private void StartAd()
 {
     if (_adWindow != null)
     {
         return;
     }
     _adWindow         = new AdWindow(this);
     _adWindow.Closed += AdWindowOnClosed;
     _adWindow.Top     = Top + 400;
     _adWindow.Left    = Left + 240;
     _adWindow.Show();
 }
Example #3
0
 private void StartAd()
 {
     for (int i = 0; i < 2; i++)
     {
         if (adWindow[i] == null)
         {
             adWindow[i]         = new AdWindow(this);
             adWindow[i].Closed += AdWindowOnClosed;
             adWindow[i].Top     = this.Top + (330 * i) + 70;
             adWindow[i].Left    = this.Left + 240;
             adWindow[i].Show();
         }
     }
 }
        private void StartAd()
        {
            {
                adWindow = new AdWindow[2];
                for (int i = 0; i < 2; i++)
                {
                    if (adWindow[i] == null)
                    {
                        adWindow[i] = new AdWindow(this);
                        adWindow[i].Closed += AdWindowOnClosed;
                        adWindow[i].Top = this.Top + (330 * i) + 70;
                        adWindow[i].Left = this.Left + 240;
                        adWindow[i].Show();
                    }
                }

            }
        }
 private void AdWindowOnClosed(object sender, EventArgs eventArgs)
 {
     _adWindow.Closed -= AdWindowOnClosed;
     _adWindow         = null;
 }