Code refactoring
This commit is contained in:
@@ -5,21 +5,21 @@ namespace Common;
|
|||||||
public static class ConfigFileManager
|
public static class ConfigFileManager
|
||||||
{
|
{
|
||||||
#region Config flags
|
#region Config flags
|
||||||
/*Configuration: (format: fieldname=value)
|
/*Configuration: (format: fieldname=value)
|
||||||
|
|
||||||
password_store_path: path to the folder which contains the .gpg files
|
password_store_path: path to the folder which contains the .gpg files
|
||||||
recipient: whose public key to use for encryption when a new password is created
|
recipient: whose public key to use for encryption when a new password is created
|
||||||
*/
|
*/
|
||||||
private static string CONFIGPATH = SpecialDirectories.CurrentUserApplicationData + "\\config.cfg";
|
private static string CONFIGPATH = SpecialDirectories.CurrentUserApplicationData + "\\config.cfg";
|
||||||
private static char DELIMETER = '=';
|
private static char DELIMETER = '=';
|
||||||
private static string RECIPIENT = "recipient";
|
private static string RECIPIENT = "recipient";
|
||||||
private static string PATH = "password_store_path";
|
private static string PATH = "password_store_path";
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private static Config Configuration;
|
private static Config Configuration;
|
||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
||||||
while (!success)
|
while (!success)
|
||||||
@@ -63,17 +63,17 @@ public static class ConfigFileManager
|
|||||||
CreateDefaultConfig();
|
CreateDefaultConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetPath()
|
public static string GetPath()
|
||||||
{
|
{
|
||||||
return Configuration.PasswordStorePath;
|
return Configuration.PasswordStorePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetRecipient()
|
public static string GetRecipient()
|
||||||
{
|
{
|
||||||
return Configuration.Recipient;
|
return Configuration.Recipient;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CreateDefaultConfig()
|
private static void CreateDefaultConfig()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user