Displaying Notifications


You can send a pop-up notification display to a SideShow device using the ShowNotification method.

 Icon icon = new Icon(@"C:\Program Files\FlashlightMemo\flashlight.ico"); memoGadget.ShowNotification(    1,                                 // Notification ID    "Alarm Triggered",                 // Notification heading    "Intruder Sector 7G",              // Notification body    icon,                              // Notification icon    new TimeSpan(0, 0, 20));           // display duration 

This code creates a notification that remains on the display for 20 seconds (the size of the TimeSpan) or until the user cancels it. The final parameter could instead be a DateTime value that gives the time at which the notification would cancel. You can give the message a particular icon design to give the user more detail about the event described by the notification. Figure 8-12 shows the form that the notification would take on the display of a target device.

image from book
Figure 8-12: A notification display.

You can revoke a notification, or all notifications, on connected SideShow devices by calling the methods RevokeNotification or RevokeAllNotifications. You must give the RevokeNotification method the ID number of the notification that you want revoked.




Embedded Programming with the Microsoft .Net Micro Framework
Embedded Programming with the Microsoft .NET Micro Framework
ISBN: 0735623651
EAN: 2147483647
Year: 2007
Pages: 118

Similar book on Amazon
Getting Started with the Internet of Things: Connecting Sensors and Microcontrollers to the Cloud (Make: Projects)
Getting Started with the Internet of Things: Connecting Sensors and Microcontrollers to the Cloud (Make: Projects)
Expert .NET Micro Framework (Expert's Voice in .NET)
Expert .NET Micro Framework (Expert's Voice in .NET)
Netduino Plus
Netduino Plus
Getting Started with Netduino
Getting Started with Netduino

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net