Home Notices Documents Classes Download Others Rice
Classes  >  preference  >  Clear(string)
preference class : Clear(string) method

Description

Clears a entry specified by argument.

Syntax

preferenceInstance.Clear(string prefName)

Arguments

ClassNameDescription
stringprefNameA preference name.

Return value

None.

Sample code

1:

preference pref = new preference();

2:

pref.Set("some.preference.entry", "some value"); // It makes new entry;

3:

proxy retProxy = pref.Get("some.preference.entry"); // The return value is proxy.

4:

string strVal = retProxy.Entity; // The strVal is "some value".

5:

pref.Clear("some.preference.entry"); // It clears the entry.

Notes

If the entry is not exist, a RtypeException will be thrown.

If the entry has not created by user, this method will return the value to default.

If the entry was created by user, this method will remove the entry.

Links for reference

None.

Copyright © Rice All rights reserved.