1
1
using System ;
2
2
using System . IO ;
3
3
4
- #pragma warning disable CA2211 // Non-constant fields should not be visible
5
-
6
4
namespace Flow . Launcher . Infrastructure . UserSettings
7
5
{
8
6
public static class DataLocation
9
7
{
10
8
public const string PortableFolderName = "UserData" ;
11
9
public const string DeletionIndicatorFile = ".dead" ;
12
- public static string PortableDataPath = Path . Combine ( Constant . ProgramDirectory , PortableFolderName ) ;
13
- public static string RoamingDataPath = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , "FlowLauncher" ) ;
10
+ public static readonly string PortableDataPath = Path . Combine ( Constant . ProgramDirectory , PortableFolderName ) ;
11
+ public static readonly string RoamingDataPath = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , "FlowLauncher" ) ;
14
12
public static string DataDirectory ( )
15
13
{
16
14
if ( PortableDataLocationInUse ( ) )
@@ -22,27 +20,27 @@ public static string DataDirectory()
22
20
public static bool PortableDataLocationInUse ( )
23
21
{
24
22
if ( Directory . Exists ( PortableDataPath ) &&
25
- ! File . Exists ( Path . Combine ( PortableDataPath , DeletionIndicatorFile ) )
23
+ ! File . Exists ( Path . Combine ( PortableDataPath , DeletionIndicatorFile ) ) )
26
24
return true ;
27
25
28
26
return false ;
29
27
}
30
28
31
- public static string VersionLogDirectory => Path . Combine ( LogDirectory , Constant . Version ) ;
32
- public static string LogDirectory => Path . Combine ( DataDirectory ( ) , Constant . Logs ) ;
29
+ public static readonly string VersionLogDirectory = Path . Combine ( LogDirectory , Constant . Version ) ;
30
+ public static readonly string LogDirectory = Path . Combine ( DataDirectory ( ) , Constant . Logs ) ;
33
31
34
- public static string CacheDirectory => Path . Combine ( DataDirectory ( ) , Constant . Cache ) ;
35
- public static string SettingsDirectory => Path . Combine ( DataDirectory ( ) , Constant . Settings ) ;
36
- public static string PluginsDirectory => Path . Combine ( DataDirectory ( ) , Constant . Plugins ) ;
37
- public static string ThemesDirectory => Path . Combine ( DataDirectory ( ) , Constant . Themes ) ;
32
+ public static readonly string CacheDirectory = Path . Combine ( DataDirectory ( ) , Constant . Cache ) ;
33
+ public static readonly string SettingsDirectory = Path . Combine ( DataDirectory ( ) , Constant . Settings ) ;
34
+ public static readonly string PluginsDirectory = Path . Combine ( DataDirectory ( ) , Constant . Plugins ) ;
35
+ public static readonly string ThemesDirectory = Path . Combine ( DataDirectory ( ) , Constant . Themes ) ;
38
36
39
- public static string PluginSettingsDirectory => Path . Combine ( SettingsDirectory , Constant . Plugins ) ;
40
- public static string PluginCacheDirectory => Path . Combine ( DataDirectory ( ) , Constant . Cache , Constant . Plugins ) ;
37
+ public static readonly string PluginSettingsDirectory = Path . Combine ( SettingsDirectory , Constant . Plugins ) ;
38
+ public static readonly string PluginCacheDirectory = Path . Combine ( DataDirectory ( ) , Constant . Cache , Constant . Plugins ) ;
41
39
42
40
public const string PythonEnvironmentName = "Python" ;
43
41
public const string NodeEnvironmentName = "Node.js" ;
44
42
public const string PluginEnvironments = "Environments" ;
45
43
public const string PluginDeleteFile = "NeedDelete.txt" ;
46
- public static string PluginEnvironmentsPath => Path . Combine ( DataDirectory ( ) , PluginEnvironments ) ;
44
+ public static readonly string PluginEnvironmentsPath = Path . Combine ( DataDirectory ( ) , PluginEnvironments ) ;
47
45
}
48
46
}
0 commit comments