Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

System.Gadget.Settings.read method

[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. ]

Retrieves a stored value of unspecified type associated with a gadget Settings key.

Syntax


retVal = System.Gadget.Settings.read(
  strName
)

Parameters

strName [in]

String that specifies the name of the Settings key.

Return value

The value of the Settings key. The data type of the returned value will default to String if it cannot be coerced into one of the following: Boolean, Floating-point, Floating-point, or Integer.

Remarks

Use readString for performance and efficiency reasons if the data type is a String.

There is a 1024 character limit for Settings keys and a 2048 character limit for Settings values; values longer than these limits will be truncated.

Use write or writeString to store Settings values.

The Settings values are unique for each user account, even if the same gadget is used.

Examples

The following example demonstrates how to retrieve a Settings value into a gadget variable.


// --------------------------------------------------------------------
// Handle the Settings dialog closed event.
// event = Event argument.
// --------------------------------------------------------------------
function SettingsClosed(event)
{
    // User hit OK on the settings page.
    if (event.closeAction == event.Action.commit)
    {
        userEntry = 
            System.Gadget.Settings.read("settingsSelectionIndex");
        // Update gadget UI based on user Settings selection.
        UpdateSelection(selectionIndex);
    }
    // User hit Cancel on the settings page.
    else if (event.closeAction == event.Action.cancel)
    {
        SetContentText("canceled");
    }
}

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)

See also

System.Gadget.Settings
readString

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.