Share via


SideShowGadget.RevokeAllNotifications Method

Revokes all of this gadget's notifications from all of its connected Windows SideShow-compatible devices.

Namespace: Microsoft.SideShow
Assembly: Microsoft.SideShow (in microsoft.sideshow.dll)

Usage

Syntax

'Declaration
Public Sub RevokeAllNotifications
public void RevokeAllNotifications ()
public:
void RevokeAllNotifications ()
public void RevokeAllNotifications ()
public function RevokeAllNotifications ()

Example

The following example code shows how to revoke all of the notifications from all of a gadget's connected Windows SideShow-compatible devices by using a single method call.

private static void SampleRevokeAllNotification()
{
    // Set the gadget's GUID.
    Guid gadgetId = new Guid("{0530B726-F6D5-4a66-900E-3C7673316F3B}");

    // Add the gadget's registry subkey and values.
    GadgetRegistration.Register(
        false,                           // Register gadget for current user only
        gadgetId,                        // Guid for the registry subkey
        ScfSideShowGadget.ScfEndpointId, // Endpoints registry value
        "Example SideShow gadget",       // FriendlyName registry value
        null,                            // StartCommand registry value
        null,                            // Icon registry value, this gadget will use the generic gadget icon.
        false,                           // OnlineOnly registry value
        GadgetCachePolicies.KeepNewest,  // CachePolicy registry value
        null);

    // Construct a Simple Content Format SideShow gadget for the gadget's Guid.
    using (ScfSideShowGadget gadget = new ScfSideShowGadget(gadgetId))
    {
        gadget.ShowNotification(100, "Caption 1", "This is the first notification message");
        gadget.ShowNotification(101, "Caption 2", "This is the second notification message");
        // The first notification is revoked.
        gadget.RevokeNotification(100);
        gadget.ShowNotification(102, "Caption 3", "This is the third notification message");
        Thread.Sleep(10000);
        // All remaining notifications are revoked.
        gadget.RevokeAllNotifications();
    }
    // The code above creates 2 notifications then revokes the first notification. Then a 3rd notification is created. The method RevokeAllNotifications is used to revoke the two remaining notifications.
}

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista Home Premium, Windows Vista Business, Windows Vista Enterprise, Windows Vista Ultimate

Target Platforms

Windows Vista Home Premium, Windows Vista Business, Windows Vista Enterprise, Windows Vista Ultimate

See Also

Reference

SideShowGadget Class
SideShowGadget Members
Microsoft.SideShow Namespace