Hi,
All the alarms on your apps have a timer involved, so you should have the
main timer running on your app that every x seconds/minutes or whatever you
like scans the objects on the calendar (you can reduce the search for example
grabing objects that are set for today only).
Simple example:
Timer YourTimer = new Timer(60000); //Every one minute
YourTimer.Elapsed += new Elapsed(YourAnalizeFunc(...));
YourTimer.Start(); //This will run on its own thread so is async
void YourAnalizeFunc()
{
foreach (YourObj Current in YourCollection)
{
if (Current .DateTime.Now <= DateTime.Now)
{
RaiseTheAlarm(Current);
}
}
}
Other way to implement is having the timer on each object and raise an event
when the time has been reached, this is a good implementation if you have a
small number of objects.
Best regards
Salva
"Jeff" wrote:
Has anyone implemented an alarm like the one used with WindowsMobile
Calendar? I'm writing a program (C#) that allows a user to set
a date and time for meetings, appointments, etc. and have a MessageBox
pop-up when the set dateTime occurs. I don't even know where
to begin and am looking for a point in the right direction. The app is C#
compact framework and the dateTime object is stored in a
SQLCE database.
Any help would be greatly appreciated.
Thank you
Jeff
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/