public static string Get(string key)
{
try
{
//used to switch the hardcoded server to CASE's or ARUP based on the existence of a file on disk or not
if (key == "jiraserver")
{
string serverfile = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CASE", "ARUP Issue Tracker", "usecaseserver");
if (System.IO.File.Exists(serverfile))
return System.IO.File.ReadAllText(serverfile).Replace(" ","");
else
return _jiraserverarup;
}
if (key == "guidfield")
{
if (System.IO.File.Exists(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CASE", "ARUP Issue Tracker", "usecaseserver")))
return "customfield_11600";
else
return "customfield_10900";
}
Configuration config = GetConfig();
if (config == null)
return string.Empty;
KeyValueConfigurationElement element = config.AppSettings.Settings[key];
if (element != null)
{
string value = element.Value;
if (!string.IsNullOrEmpty(value))
return value;
}
else
{
config.AppSettings.Settings.Add(key, "");
config.Save(ConfigurationSaveMode.Modified);
}
}
catch (System.Exception ex1)
{
MessageBox.Show("exception: " + ex1);
}
return string.Empty;
}
public static void Set(string key, string value)