FileSurfer 1.1.4
Modern Windows File Explorer
Loading...
Searching...
No Matches
FileSurfer.FileSurferSettings Class Reference
Collaboration diagram for FileSurfer.FileSurferSettings:

Static Public Member Functions

static void LoadSettings ()
static void ImportSettings (SettingsRecord settings)
 Loads and sanitizes settings from the SettingsRecord object and applies them to the current session.
static void UpdateQuickAccess (IEnumerable< FileSystemEntryViewModel > quickAccess)
 Update Quick Access list with the specified FileSystemEntryViewModels.
static void SaveSettings ()
 Saves the current settings to the settings file if any changes have been made.

Static Public Attributes

const long ShowDialogLimitB = 250 * 1024 * 1024
static readonly string SettingsFilePath = SettingsFileDir + "\\settings.json"
 The full path to settings.json.

Properties

static SettingsRecord DefaultSettings [get]
 Returns the default set of settings for the FileSurfer app.
static SettingsRecord CurrentSettings [get]
 Returns the current settings in the form of SettingsRecord.
static string NewImageName [get, set]
 Default name for the pasted image files.
static string NewFileName [get, set]
 Default name for newly created files.
static string NewDirectoryName [get, set]
 Default name for newly created directories.
static string ThisPCLabel [get, set]
 What "This PC" 'directory' will be called.
static string NotepadApp [get, set]
 The application, the 'Open in Notepad' context menu option will open.
static bool OpenInLastLocation [get, set]
 Specifies if the app should reopen files or folders in their last accessed location.
static string OpenIn [get, set]
 Specifies the default location where FileSurfer opens.
static bool UseDarkMode [get, set]
 Indicates whether the application uses a dark theme.
static DisplayMode DisplayMode [get, set]
 Defines the view mode for displaying files and folders.
static SortBy DefaultSort [get, set]
 Specifies the default sorting method for files and folders.
static int FileSizeUnitLimit [get, set]
 Numerical limit before FileSurfer uses the next byte unit.
static int FileSizeUnitLimitLowerBound [get]
static int FileSizeUnitLimitUpperBound [get]
static bool SortReversed [get, set]
 Indicates whether file and folder sorting should be reversed.
static bool ShowSpecialFolders [get, set]
 Determines if special folders (like "Documents" or "Downloads") should be displayed in the sidebar.
static bool ShowProtectedFiles [get, set]
 Controls whether files with protection settings are shown in directory contents and searching.
static bool ShowHiddenFiles [get, set]
 Specifies if hidden files are shown in directory contents and searching.
static bool TreatDotFilesAsHidden [get, set]
 Decides if files starting with a dot '.
static bool GitIntegration [get, set]
 Enables or disables Git integration features within the application.
static bool ShowUndoRedoErrorDialogs [get, set]
 Determines if error dialogs should be shown for undo/redo operations.
static bool AutomaticRefresh [get, set]
 Indicates whether the file explorer should automatically refresh at intervals.
static int AutomaticRefreshInterval [get, set]
 Sets the interval (in milliseconds) for automatic refreshing of the file explorer.
static int AutomaticRefreshIntervalLowerBound [get]
static int AutomaticRefreshIntervalUpperBound [get]
static bool AllowImagePastingFromClipboard [get, set]
 Specifies if images stored in the system clipboard can be pasted directly into directories.
static List< string > QuickAccess [get, set]
 List of directories and files added by the user for quick access.

Static Private Member Functions

static FileSurferSettings ()
static TEnum SafeParseEnum< TEnum > (string? enumValueName)
static string SanitizeName (string? fileName, char[] invalidChars, string defaultName)
static T ClampValue< T > (T value, T lowerBound, T upperBound)

Static Private Attributes

static readonly char[] InvalidFileNameChars = Path.GetInvalidFileNameChars()
static readonly char[] InvalidPathChars = Path.GetInvalidPathChars()
static readonly JsonSerializerOptions SerializerOptions
static readonly string SettingsFileDir
static string _previousSettingsJson = string.Empty

Detailed Description

Provides application-wide settings management for the FileSurfer application.

Handles the loading, saving, and updating of user preferences and settings.

Constructor & Destructor Documentation

◆ FileSurferSettings()

FileSurfer.FileSurferSettings.FileSurferSettings ( )
staticprivate

Member Function Documentation

◆ ClampValue< T >()

T FileSurfer.FileSurferSettings.ClampValue< T > ( T value,
T lowerBound,
T upperBound )
inlinestaticprivate
Type Constraints
T :IComparable<T> 

◆ ImportSettings()

void FileSurfer.FileSurferSettings.ImportSettings ( SettingsRecord settings)
inlinestatic

Loads and sanitizes settings from the SettingsRecord object and applies them to the current session.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadSettings()

void FileSurfer.FileSurferSettings.LoadSettings ( )
inlinestatic

Loads settings from the settings file and applies them to the current session.

If the settings file does not exist or is invalid, default settings are used and settings.json is rewritten.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SafeParseEnum< TEnum >()

TEnum FileSurfer.FileSurferSettings.SafeParseEnum< TEnum > ( string? enumValueName)
staticprivate
Type Constraints
TEnum :struct 
TEnum :Enum 

◆ SanitizeName()

string FileSurfer.FileSurferSettings.SanitizeName ( string? fileName,
char[] invalidChars,
string defaultName )
staticprivate
Here is the caller graph for this function:

◆ SaveSettings()

void FileSurfer.FileSurferSettings.SaveSettings ( )
inlinestatic

Saves the current settings to the settings file if any changes have been made.

Here is the caller graph for this function:

◆ UpdateQuickAccess()

void FileSurfer.FileSurferSettings.UpdateQuickAccess ( IEnumerable< FileSystemEntryViewModel > quickAccess)
static

Update Quick Access list with the specified FileSystemEntryViewModels.

Parameters
quickAccess
Here is the caller graph for this function:

Member Data Documentation

◆ _previousSettingsJson

string FileSurfer.FileSurferSettings._previousSettingsJson = string.Empty
staticprivate

◆ InvalidFileNameChars

readonly char [] FileSurfer.FileSurferSettings.InvalidFileNameChars = Path.GetInvalidFileNameChars()
staticprivate

◆ InvalidPathChars

readonly char [] FileSurfer.FileSurferSettings.InvalidPathChars = Path.GetInvalidPathChars()
staticprivate

◆ SerializerOptions

readonly JsonSerializerOptions FileSurfer.FileSurferSettings.SerializerOptions
staticprivate
Initial value:
=
new()
{
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = true,
UnmappedMemberHandling = JsonUnmappedMemberHandling.Skip,
AllowTrailingCommas = true,
}

◆ SettingsFileDir

readonly string FileSurfer.FileSurferSettings.SettingsFileDir
staticprivate
Initial value:
=
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\FileSurfer"

◆ SettingsFilePath

readonly string FileSurfer.FileSurferSettings.SettingsFilePath = SettingsFileDir + "\\settings.json"
static

The full path to settings.json.

◆ ShowDialogLimitB

const long FileSurfer.FileSurferSettings.ShowDialogLimitB = 250 * 1024 * 1024
static

Property Documentation

◆ AllowImagePastingFromClipboard

bool FileSurfer.FileSurferSettings.AllowImagePastingFromClipboard
staticgetset

Specifies if images stored in the system clipboard can be pasted directly into directories.

Defaults to true.

◆ AutomaticRefresh

bool FileSurfer.FileSurferSettings.AutomaticRefresh
staticgetset

Indicates whether the file explorer should automatically refresh at intervals.

Defaults to true.

◆ AutomaticRefreshInterval

int FileSurfer.FileSurferSettings.AutomaticRefreshInterval
staticgetset

Sets the interval (in milliseconds) for automatic refreshing of the file explorer.

Defaults to 3000 ms (3 seconds).

◆ AutomaticRefreshIntervalLowerBound

int FileSurfer.FileSurferSettings.AutomaticRefreshIntervalLowerBound
staticgetpackage

◆ AutomaticRefreshIntervalUpperBound

int FileSurfer.FileSurferSettings.AutomaticRefreshIntervalUpperBound
staticgetpackage

◆ CurrentSettings

SettingsRecord FileSurfer.FileSurferSettings.CurrentSettings
staticget

Returns the current settings in the form of SettingsRecord.

◆ DefaultSettings

SettingsRecord FileSurfer.FileSurferSettings.DefaultSettings
staticget

Returns the default set of settings for the FileSurfer app.

◆ DefaultSort

SortBy FileSurfer.FileSurferSettings.DefaultSort
staticgetset

Specifies the default sorting method for files and folders.

Defaults to sorting by SortBy.Name.

◆ DisplayMode

DisplayMode FileSurfer.FileSurferSettings.DisplayMode
staticgetset

Defines the view mode for displaying files and folders.

Defaults to DisplayMode.ListView.

◆ FileSizeUnitLimit

int FileSurfer.FileSurferSettings.FileSizeUnitLimit
staticgetset

Numerical limit before FileSurfer uses the next byte unit.

Defaults to 4096.

◆ FileSizeUnitLimitLowerBound

int FileSurfer.FileSurferSettings.FileSizeUnitLimitLowerBound
staticgetpackage

◆ FileSizeUnitLimitUpperBound

int FileSurfer.FileSurferSettings.FileSizeUnitLimitUpperBound
staticgetpackage

◆ GitIntegration

bool FileSurfer.FileSurferSettings.GitIntegration
staticgetset

Enables or disables Git integration features within the application.

Defaults to true.

◆ NewDirectoryName

string FileSurfer.FileSurferSettings.NewDirectoryName
staticgetset

Default name for newly created directories.

Defaults to "New Folder".

◆ NewFileName

string FileSurfer.FileSurferSettings.NewFileName
staticgetset

Default name for newly created files.

Defaults to "New File".

◆ NewImageName

string FileSurfer.FileSurferSettings.NewImageName
staticgetset

Default name for the pasted image files.

Defaults to "New Image".

◆ NotepadApp

string FileSurfer.FileSurferSettings.NotepadApp
staticgetset

The application, the 'Open in Notepad' context menu option will open.

Defaults to "notepad.exe".

◆ OpenIn

string FileSurfer.FileSurferSettings.OpenIn
staticgetset

Specifies the default location where FileSurfer opens.

Defaults to the value of ThisPCLabel.

◆ OpenInLastLocation

bool FileSurfer.FileSurferSettings.OpenInLastLocation
staticgetset

Specifies if the app should reopen files or folders in their last accessed location.

Defaults to true.

◆ QuickAccess

List<string> FileSurfer.FileSurferSettings.QuickAccess
staticgetset

List of directories and files added by the user for quick access.

Defaults to an empty list.

◆ ShowHiddenFiles

bool FileSurfer.FileSurferSettings.ShowHiddenFiles
staticgetset

Specifies if hidden files are shown in directory contents and searching.

Defaults to true.

◆ ShowProtectedFiles

bool FileSurfer.FileSurferSettings.ShowProtectedFiles
staticgetset

Controls whether files with protection settings are shown in directory contents and searching.

Defaults to false.

◆ ShowSpecialFolders

bool FileSurfer.FileSurferSettings.ShowSpecialFolders
staticgetset

Determines if special folders (like "Documents" or "Downloads") should be displayed in the sidebar.

Defaults to true.

◆ ShowUndoRedoErrorDialogs

bool FileSurfer.FileSurferSettings.ShowUndoRedoErrorDialogs
staticgetset

Determines if error dialogs should be shown for undo/redo operations.

Defaults to true.

◆ SortReversed

bool FileSurfer.FileSurferSettings.SortReversed
staticgetset

Indicates whether file and folder sorting should be reversed.

Defaults to false.

◆ ThisPCLabel

string FileSurfer.FileSurferSettings.ThisPCLabel
staticgetset

What "This PC" 'directory' will be called.

Defaults to "This PC".

◆ TreatDotFilesAsHidden

bool FileSurfer.FileSurferSettings.TreatDotFilesAsHidden
staticgetset

Decides if files starting with a dot '.

' are considered hidden. Defaults to true.

◆ UseDarkMode

bool FileSurfer.FileSurferSettings.UseDarkMode
staticgetset

Indicates whether the application uses a dark theme.

Defaults to true.


The documentation for this class was generated from the following file: