Remove, clear, or delete preferences¶
This operation covers the three in-memory reset paths on clsPreferences: removing a single key, clearing a scope's items, and deleting every loaded record. None of the three persist the change — Persist preferences must follow.
| Field | Value |
|---|---|
| Operation ID | OP-PRES-004 |
| Trigger | Consuming code calls Remove, Clear, or Delete |
| Inputs | Key and/or scope |
| Outputs | Mutated in-memory Preference records |
| Primary components | clsPreferences.Remove (two overloads), clsPreferences.Clear, clsPreferences.Delete |
| Entry point | SAIF.Presentation/clsPreferences.vb |
Steps¶
Remove(inKey)/Remove(inKey, inScope):- Logs entry via
clsLogTrace.MethodBegin(). - Exits silently on a
Nothingkey (BR-PRES-006). - Lower-cases the key (BR-PRES-007).
- Locates the matching
Preferencerecord and removes the item when present; a missing key is a silent no-op (BR-PRES-016). Clear(scope): locates thePreferencerecord for the current application + resolved page key and clears all of its items (BR-PRES-017).Delete(): clears the items of every loadedPreferencerecord, regardless of application or page (BR-PRES-018).- None of the three persist the change — Persist preferences must be called explicitly (BR-PRES-019).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Remove / Clear / Delete called]) --> D1{Which operation?}
D1 -->|Remove| R1[Key is Nothing?]
R1 -->|Yes| REnd([No-op])
R1 -->|No| R2[Lower-case key, locate record, remove item if present]
D1 -->|Clear scope| C1[Locate record for application + page key]
C1 --> C2[Clear all items in that record]
D1 -->|Delete| E1[Clear items in every loaded record]
R2 --> EndMem([In-memory records mutated])
C2 --> EndMem
E1 --> EndMem
EndMem --> Note[Save must be called to persist]
Failure and edge-case behavior¶
- Removing a key that is not present is a silent no-op (BR-PRES-016).
Delete()affects every loaded application/page record for the user, not just the current application — callers must be careful about scope when callingDelete().
Related documentation¶
Sources¶
SAIF.Presentation/clsPreferences.vb