| Visual Basic (Declaration) | |
|---|---|
Public Property Properties As NotificationProperties | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As WebNotificationEvent Dim value As NotificationProperties instance.Properties = value value = instance.Properties | |
| C# | |
|---|---|
public NotificationProperties Properties {get; set;} | |
WebNotification has the ability to pass custom properties along with the notification event to the client side. For instance, you may want to send the RowID along with the notification event so you can get the ID in the client side and perform further extensibility. In WebNotification, you can send custom property easily in collection-object friendly approach. WebNotification used Dictionary based type and is able to be serialized perfectly into XML Format.
The following codes snippet demonstrates how you can pass the EmailID value along with the notification event.
WebNotificationEvent evnt = new WebNotificationEvent();
evnt.CaptionText =
"Samples: Outlook 2003";
evnt.Properties["EmailID"] = emailObj.ID;
| C# | Copy Code |
|---|---|
[WebMethod] public WebNotificationEventCollection GetNotifications(WebNotificationEventArgs e) { WebNotificationEventCollection collection = new WebNotificationEventCollection(); WebNotificationEvent evnt = new WebNotificationEvent(); evnt.CaptionText = "Samples"; evnt.ContentText = "Hello world from WebNotification!\nCurrent time is:" + DateTime.Now.ToLongTimeString(); evnt.Properties["CustomerId"] = "ALFKI"; collection.Notifications = new WebNotificationEvent[] { evnt }; return collection; } | |
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2