System.Gadget.Settings.ClosingEvent.closeAction property

[The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]

Gets the Settings dialog close request.

This property is read-only.

Syntax


closeAction = System.Gadget.Settings.ClosingEvent.closeAction


Property value

Action that specifies the type of close request.

(commit)

OK button is invoked. All modified settings are confirmed and stored.

(cancel)

Cancel invoked. All modified settings are discarded.

Examples

The following example demonstrates how to store a Settings value when the Settings dialog closes.


// --------------------------------------------------------------------
// Handle the Settings dialog closing event.
// Parameters:
// event - System.Gadget.Settings.ClosingEvent argument.
// --------------------------------------------------------------------
function SettingsClosing(event)
{
    // User hit OK on the settings page.
    if (event.closeAction == event.Action.commit)
    {
        System.Gadget.Settings.writeString(
        "settingsUserEntry", "OK");
    }
    // User hit Cancel on the settings page.
    else if (event.closeAction == event.Action.cancel)
    {
        System.Gadget.Settings.writeString(
                "settingsUserEntry", "CANCEL");
    }
    // Allow the Settings dialog to close.
    event.cancel = false;
}

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

End of client support

Windows 7

End of server support

Windows Server 2008

IDL

Sidebar.idl

DLL

Sidebar.Exe (version 1.00 or later)

 

 

Community Additions

ADD
Show: