AnlageIP adresse kann nun im Menu geändert werden

This commit is contained in:
HuskyTeufel
2022-04-13 11:51:37 +02:00
parent 9ee596d1bb
commit a027973358
12 changed files with 378 additions and 20 deletions

View File

@@ -11,7 +11,8 @@ namespace SanSystem.Einstellungen
{
abstract class Settings : IDisposable
{
protected Dictionary<string, int> configuration = new Dictionary<string, int>();
protected Dictionary<string, long> configuration = new Dictionary<string, long>();
const string pfad = "Settings";
@@ -30,15 +31,15 @@ namespace SanSystem.Einstellungen
else
{
string input = File.ReadAllText(modPath);
configuration = (Dictionary<string, int>)JsonConvert.DeserializeObject(input, typeof(Dictionary<string, int>));
configuration = (Dictionary<string, long>)JsonConvert.DeserializeObject(input, typeof(Dictionary<string, long>));
}
}
protected int getConfiguration(string keyName, int retry = 0)
protected long getConfiguration(string keyName, int retry = 0)
{
if (retry >= 3)
throw new Exception("Fehler, zuviele versuche");
int result = -1;
long result = -1;
if(!configuration.TryGetValue(keyName,out result))
{
configuration.Add(keyName, 20);
@@ -53,7 +54,7 @@ namespace SanSystem.Einstellungen
}
}
protected void setConfig(string keyName, int value)
protected void setConfig(string keyName, long value)
{
configuration[keyName] = value;
}