I have an application that does the following:
one component looks for changes in a database
For every change, a row is added to a table storing change alert information
Another component looks for alerts
For each alert, an alert form pops up
Previously, I had my code only show one alert at a time, and things worked just fine. Now, I'm changing my code to allow multiple alert forms to open at the same time.
while(true)
{
DB = //pseudocode: database object
Var ResultAlert =
from a in DB.Alerts
where a.Status == 0;
foreach(var RowAlert in ResultAlert)
{
AlertForm f = new AlertForm(RowAlert.Id);
f.Show();
}
Thread.Sleep(1000);
}
So as you can see, this code will check for new alerts every second, which is all well and good, but it could potentially open repeat alert forms each second. What I want to know is how to detect which forms are open (with corresponding alertIds) so I can only open new alert windows.