diff --git a/Utils/InIReader.cs b/Utils/InIReader.cs index 1db1879..f2d6fb1 100644 --- a/Utils/InIReader.cs +++ b/Utils/InIReader.cs @@ -23,6 +23,11 @@ namespace BlubbFish.Utils LoadFile(); } + /// + /// Gibt eine InIReader-Instanz zu einer Datei zurück + /// + /// Dateiname + /// public static InIReader GetInstance(String filename) { if (!instances.Keys.Contains(filename)) { @@ -72,6 +77,11 @@ namespace BlubbFish.Utils } } + /// + /// Gibt eine Liste an Sektionen zurück + /// + /// Default = true; false, wenn die Liste ohne Klammern sein soll. + /// public List GetSections(Boolean withBrackets = true) { if(withBrackets) { @@ -85,6 +95,24 @@ namespace BlubbFish.Utils } } + /// + /// Überschreibt eine InI-Datei mit der Kompletten neuen Configuration + /// + /// Neue Konfiguration + public void SetSections(Dictionary> config) { + this.inifile.Clear(); + foreach (KeyValuePair> item in config) { + String key = item.Key; + if(!key.StartsWith("[")) { + key = "[" + key + "]"; + } + if (Regex.Match(key, @"^\[[a-zA-ZäöüÄÖÜ0-9\-_ ]+\]\w*$", RegexOptions.IgnoreCase).Success) { + this.inifile.Add(key, item.Value); + } + } + this.Changed(); + } + public Dictionary GetSection(String section) { if(this.inifile.Keys.Contains(section)) { return this.inifile[section]; @@ -95,6 +123,12 @@ namespace BlubbFish.Utils return new Dictionary(); } + /// + /// Gibt einen einzelnen Wert zurück + /// + /// Name der Sektion + /// Name des Wertes + /// public String GetValue(String section, String key) { if (!section.StartsWith("[")) { @@ -108,7 +142,12 @@ namespace BlubbFish.Utils return null; } - + /// + /// Setzt einen Wert in einer Sektion + /// + /// Name der Sektion + /// Name des Wertes + /// Wert public void SetValue(String section, String key, String value) { if (!section.StartsWith("[")) { diff --git a/Utils/Properties/AssemblyInfo.cs b/Utils/Properties/AssemblyInfo.cs index eae4588..557591c 100644 --- a/Utils/Properties/AssemblyInfo.cs +++ b/Utils/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Utils")] -[assembly: AssemblyCopyright("Copyright © 2014 - 25.09.2017")] +[assembly: AssemblyCopyright("Copyright © 2014 - 22.12.2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.5.2")] -[assembly: AssemblyFileVersion("1.0.5.2")] +[assembly: AssemblyVersion("1.0.6.0")] +[assembly: AssemblyFileVersion("1.0.6.0")] diff --git a/Utils/Utils.csproj b/Utils/Utils.csproj index cc29b82..31fe9bd 100644 --- a/Utils/Utils.csproj +++ b/Utils/Utils.csproj @@ -1,5 +1,5 @@  - + Debug @@ -9,8 +9,9 @@ Properties BlubbFish.Utils Utils - v4.5 + v4.7.1 512 + true diff --git a/Utils/bin/Release/Utils.dll b/Utils/bin/Release/Utils.dll index 01bbe20..c3d0a9c 100644 Binary files a/Utils/bin/Release/Utils.dll and b/Utils/bin/Release/Utils.dll differ