C# Class NanoByte.Common.Storage.Locations

Provides easy access to platform-specific common directories for storing settings and application data.
Uses Environment.SpecialFolder on Windows and the freedesktop.org basedir spec (XDG) on Linux. See http://freedesktop.org/wiki/Standards/basedir-spec
Exibir arquivo Open project: nano-byte/common

Private Properties

Property Type Description
CreateSecureMachineWideDir void
GetCacheDirPath string
GetEnvironmentVariable string
GetInstallBase string
GetInstalledFilePath string
GetIntegrationDirPath string
GetLoadConfigPaths IEnumerable
GetLoadDataPaths IEnumerable
GetSaveConfigPath string
GetSaveDataPath string
GetSaveSystemConfigPath string
Locations System

Public Methods

Method Description
OverrideInstallBase ( string path ) : void

Override the automatically determined InstallBase with a custom path.

Use with caution. Be aware of possible race conditions. Intended for unit testing, runtime relocation, etc..

Private Methods

Method Description
CreateSecureMachineWideDir ( [ path ) : void

Creates a directory with ACLs that block write-access for regular users.

GetCacheDirPath ( [ appName, bool machineWide ) : string
GetEnvironmentVariable ( string variable, string defaultValue ) : string

Returns the value of an environment variable or a default value if it isn't set.

GetInstallBase ( ) : string
GetInstalledFilePath ( [ fileName ) : string
GetIntegrationDirPath ( [ appName, bool machineWide ) : string
GetLoadConfigPaths ( [ appName, bool isFile ) : IEnumerable
GetLoadDataPaths ( [ appName, bool isFile ) : IEnumerable
GetSaveConfigPath ( [ appName, bool isFile ) : string
GetSaveDataPath ( [ appName, bool isFile ) : string
GetSaveSystemConfigPath ( [ appName, bool isFile ) : string
Locations ( ) : System

Method Details

OverrideInstallBase() public static method

Override the automatically determined InstallBase with a custom path.
Use with caution. Be aware of possible race conditions. Intended for unit testing, runtime relocation, etc..
public static OverrideInstallBase ( string path ) : void
path string
return void