public void ShowMessages(bool doit = false) { if (!messagesRunning || doit) { messagesRunning = true; if (queue.bol.Count > 0) { BannerObject bo = queue.bol.Dequeue(); if (bo.Pb1ImageLocation != null) { pb1.ImageLocation = bo.Pb1ImageLocation; } else { pb1.Image = bo.Pb1Image; } pb2.Image = bo.Pb2Image; l1.Text = bo.Label1Text; l2.Text = bo.Label2Text; bannerPanel.Location = new Point(bannerPanel.Location.X, bannerPanel.Location.Y - (bannerPanel.Height + 2)); timerEinblenden.Start(); } } }
public void Enqueue(string label1Text, string label2Text, Image pb1Image, Image pb2Image) { BannerObject bo = new BannerObject(label1Text, label2Text, pb1Image, pb2Image); queue.bol.Enqueue(bo); }