Navigating the Notification Sample Application Source Code

Navigating the Notification Sample Application Source Code

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The following files contain the source code for the Notification Sample Application: WebDavAccessor.cs, MainForm.vb, and Settings.vb. WebDavAccessor.cs is installed with the Exchange Server 2003 Software Development Kit (SDK) in the following directory: \Program Files\Exchange SDK\SDK\Samples\Notification\NotificationSampleWebDav\. MainForm.vb and Settings.vb are installed with the Exchange Server 2003 SDK in the following directory: \Program Files\Exchange SDK\SDK\Samples\Notification\NotificationSample\.

WebDavAccessor is a Microsoft® C# class library used to subscribe to a resource in an Exchange store and poll the Microsoft Exchange server for event notifications. The Settings Microsoft Visual Basic® .NET form is used to display user settings such as User Name, Password, and Domain, and utilizes the WebDavAccessor class to create and remove subscriptions on resources. A timer event also uses the WebDavAccessor class to poll the Exchange server periodically for event notifications. If a notification occurs, an event is raised in the MainForm form, which displays an icon to alert the user of the notification. The MainForm form is used to handle the system tray icon, the context menu, and the notification events generated by the Settings form.

The functions and subprocedures related to notifications are listed by source file in the following tables.

WebDavAccessor.cs

Function Description
Subscribe(string Uri, WebDavAccessor.SubscriptionNotifyType NotifyType) Calls the Action function, which subscribes to the resource at the URI for the notification.
Unsubscribe(string Uri, string subscriptionID) Calls the Action function, which removes the subscription with the subscription ID on the resource at the URI.
Poll(string Uri, string subscriptionID) Calls the Action function, which polls the Exchange server for any events that may have fired on the subscription specified by the subscription ID.
Action(string Uri, string Method, string NotificationType, string SubscriptionID) Makes the WebDAV method request on the URI.

Settings.vb

Subprocedure/Function Description
PollTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PollTimer.Tick The event handler for the PollTimer.Tick event. Uses the WebDavAccessor class to poll the Exchange server for events.
Subscribe() Uses the WebDavAccessor class to subscribe to a resource in the Exchange server.
Unsubscribe() Uses the WebDavAccessor class to remove the current subscription on a resource.
SetAuthentication() As Boolean Sets the credentials in the WebDavAccessor class, which are used to authenticate the user on the Exchange server.

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.