Skip to content

SAIF.Presentation overview

Documentation context: Packaged Component (NuGet)

SAIF.Presentation is a small VB.NET class library whose entire compiled surface is the clsPreferences user-preference store and its PrefScope enumeration. It wraps the SAIF.Framework.Preferences package with an application/page/web scope model and persists preferences as JSON through the SAIF BOF Oracle data layer.

Purpose

  • Provide a per-user, per-application preference store that consuming presentation components use to remember UI state (for example, saved Infragistics grid column order, widths, sort order, and size) across requests.
  • Load all of a user's stored preferences eagerly on construction, expose scoped indexed read/write access at application, page, or web scope, and persist mutations back through SAIF.Framework.Preferences.PreferenceData when Save() is called.
  • Consumed as a leaf dependency by SAIF.Presentation.Web.Core.Infragistics111 and SAIF.Presentation.Web.Controls.V2.Menu, both of which read and mutate preferences through clsPreferences rather than accessing the underlying framework preference service directly.

Responsibilities

  • Own the PrefScope scope model (AppLevel, PageLevel, WebLevel) and the key-normalization rules (lower-casing) applied to every keyed operation.
  • Derive the effective page name for page-scoped preferences, distinguishing web callers (from HttpContext.Current.Request.Path) from non-web callers (via OverridePage or a reflected call-stack type name).
  • Serialize in-memory preference items to JSON and hand them to the framework preference service for persistence; this library issues no SQL of its own.

Key components

  • clsPreferences: the sole public type. Loads a user's preferences on construction, exposes Item, Add, Remove, Clear, Delete, Count, and OverridePage, and persists changes via Save().
  • PrefScope: a pure enumeration (AppLevel, PageLevel, WebLevel) with no behavior of its own; it parameterizes every lookup and mutator on clsPreferences.

Sources

  • SAIF.Presentation/clsPreferences.vb
  • SAIF.Presentation/SAIF.Presentation.vbproj