Table of Contents

Class AppSettings

Namespace
VpnHood.AppLib.App.Settings
Assembly
VpnHood.AppLib.App.dll

Represents the app's settings as the storage keeps them, in settings.json: the person's settings and what the app notes for itself.

public class AppSettings
Inheritance
AppSettings
Inherited Members

Properties

ClientId

Gets or sets the install's ID as an older settings file keeps it, or null: the app moves it to the device-only storage, which a backup does not carry, and clears it here.

[Obsolete("Migration (2026-10): drop a few months after it ships, with VpnHoodApp.MigrateInstallId.")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ClientId { get; set; }

Property Value

string

ConfigTime

Gets or sets the time of the last save, in UTC, taken before the file is written, at the clock's full precision, which a UI compares between two reads of the state to see a change (ConfigTime).

public DateTime ConfigTime { get; set; }

Property Value

DateTime

IsNotificationRequested

Gets or sets a value indicating whether the app has made its one request for notifications, at a connect, whatever came of it.

public bool IsNotificationRequested { get; set; }

Property Value

bool

IsStartupTrackerSent

Gets or sets a value indicating whether the app has made its one report of its first start to the trackers, set before the report is sent; a report that fails is not sent again.

public bool IsStartupTrackerSent { get; set; }

Property Value

bool

UserReview

Gets or sets the person's last review of the app, or null for none.

public UserReview? UserReview { get; set; }

Property Value

UserReview

UserSettings

Gets or sets the person's settings.

public UserSettings UserSettings { get; set; }

Property Value

UserSettings

Version

Gets or sets the file's format version. The default is 2.

public int Version { get; set; }

Property Value

int

Methods

Save()

Saves the settings, setting off their application first (Save()).

public void Save()

Exceptions

UnauthorizedAccessException

The process may not write the file.

InvalidOperationException

The settings are not the app's own, read by its settings service.

IOException

The file could not be written.