FindMyFiles

FindMyFiles.Services

AppSettings Class

User-scope settings at %APPDATA%\find-my-files\settings.json — UI-owned, deliberately separate from the machine-scope service.json the service owns. A corrupt file degrades to defaults: warn, quarantine as .bad, and the next save starts clean.

public sealed class AppSettings

Inheritance System.Object → AppSettings

Properties

AppSettings.Engine Property

Engine transport: "auto" (pipe probe → FFI fallback), "pipe", or "inproc". CLI flags override this.

public string Engine { get; set; }

Property Value

System.String

AppSettings.FocusedExcludePaths Property

Noise directories excluded in focused mode, each appended as a quoted !path:"…" term. Plain substring match against the full path (engine semantics) — no wildcards needed.

public string[] FocusedExcludePaths { get; set; }

Property Value

System.String[]

AppSettings.FocusedExtensions Property

Extension whitelist applied in focused mode as a single OR-semantics ext:a;b;… term: documents, images, audio, video, archives and launchables — what a person actually goes looking for.

public string[] FocusedExtensions { get; set; }

Property Value

System.String[]

AppSettings.FocusedSearch Property

Focused-search mode (ADR-0019): rewrite queries in the UI with the two lists below before they reach the engine. On by default — the casual user wants a handful of hits, not 10,000; the toolbar toggle flips it per session and persists here.

public bool FocusedSearch { get; set; }

Property Value

System.Boolean

AppSettings.Language Property

UI language: "auto" (follow the OS), "ja", "en", or "zh-Hans". Applied via PrimaryLanguageOverride in the App ctor; the gear menu's switcher persists it here and relaunches to take effect.

public string Language { get; set; }

Property Value

System.String

AppSettings.RegexMode Property

Regex mode (ADR-0023): treat the whole query as one regex. Off by default; the gear-menu toggle flips it and persists here.

public bool RegexMode { get; set; }

Property Value

System.Boolean

AppSettings.RegexScope Property

Which haystack the whole-query regex matches — "name" or "path". Kept independent of RegexMode so the choice survives toggling regex off and back on. Unknown values fall back to "name".

public string RegexScope { get; set; }

Property Value

System.String

AppSettings.ScopeExcludes Property

Absolute subfolder paths pruned from the scope walk (ADR-0025). Each must lie under one of ScopeRoots; the walk skips the matching subtree so it is never indexed. Empty = index everything under the roots.

public string[] ScopeExcludes { get; set; }

Property Value

System.String[]

AppSettings.ScopeRoots Property

Absolute paths of the root folders to index in non-elevated scope mode (ADR-0024). Empty = unconfigured, and the setup screen mainly pushes the admin path (all drives, fastest). One or more entries resolve to EngineChoice.WalkInProc on the next launch, so folder-walk search works on a corporate PC where neither the service nor admin rights are available.

public string[] ScopeRoots { get; set; }

Property Value

System.String[]

AppSettings.SettingsPath Property

Absolute path to the user-scope settings file. Portable by default (<exe>\data\settings.json); falls back to %APPDATA%\find-my-files\settings.json when the app folder is read-only. See AppPaths.

public static string SettingsPath { get; }

Property Value

System.String

Methods

AppSettings.Load() Method

Load settings from SettingsPath, falling back to defaults (and quarantining the file) if it is missing or corrupt.

public static FindMyFiles.Services.AppSettings Load();

Returns

AppSettings
The loaded settings, or a fresh default instance.

AppSettings.Save() Method

Persist the current settings to SettingsPath (snake_case JSON, indented). Best-effort: a write failure is logged, not thrown.

public void Save();