Add PuzzlesPassed and PuzzlesFailed to settings.

This commit is contained in:
Tim Young 2018-10-05 12:43:57 -05:00
parent 3865794d81
commit 47790c1de1
3 changed files with 49 additions and 1 deletions

View File

@ -23,6 +23,8 @@ namespace EduNetworkBuilder
public string LastPath = "";
public List<string> ScoreList = new List<string>();
public List<string> RecentFiles = new List<string>();
public List<string> PuzzlesPassed = new List<string>();
public List<string> PuzzlesFailed = new List<string>();
public bool AutoStartPuzzles = true;
public string ChosenLanguage = "en";
public bool LanguageHasBeenChosen = false;
@ -85,6 +87,10 @@ namespace EduNetworkBuilder
Properties.Settings.Default.ScoreList = new System.Collections.Specialized.StringCollection();
if (Properties.Settings.Default.RecentFiles == null)
Properties.Settings.Default.RecentFiles = new System.Collections.Specialized.StringCollection();
if (Properties.Settings.Default.PuzzlesFailed == null)
Properties.Settings.Default.PuzzlesFailed = new System.Collections.Specialized.StringCollection();
if (Properties.Settings.Default.PuzzlesPassed == null)
Properties.Settings.Default.PuzzlesPassed = new System.Collections.Specialized.StringCollection();
ToClass.LastPath = FromClass.LastPath;
ToClass.AutoStartPuzzles = FromClass.AutoStartPuzzles;
@ -108,6 +114,16 @@ namespace EduNetworkBuilder
if (!ToClass.RecentFiles.Contains(one))
ToClass.RecentFiles.Add(one);
}
foreach (string one in FromClass.PuzzlesPassed)
{
if (!ToClass.PuzzlesPassed.Contains(one))
ToClass.PuzzlesPassed.Add(one);
}
foreach (string one in FromClass.PuzzlesFailed)
{
if (!ToClass.PuzzlesFailed.Contains(one))
ToClass.PuzzlesFailed.Add(one);
}
}
public NBSettings(bool UsingMono)
@ -138,6 +154,10 @@ namespace EduNetworkBuilder
Properties.Settings.Default.ScoreList = new System.Collections.Specialized.StringCollection();
if (Properties.Settings.Default.RecentFiles == null)
Properties.Settings.Default.RecentFiles = new System.Collections.Specialized.StringCollection();
if (Properties.Settings.Default.PuzzlesFailed == null)
Properties.Settings.Default.PuzzlesFailed = new System.Collections.Specialized.StringCollection();
if (Properties.Settings.Default.PuzzlesPassed == null)
Properties.Settings.Default.PuzzlesPassed = new System.Collections.Specialized.StringCollection();
LastPath = Properties.Settings.Default.LastPath;
AutoStartPuzzles = Properties.Settings.Default.AutoStartPuzzles;

View File

@ -12,7 +12,7 @@ namespace EduNetworkBuilder.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@ -200,5 +200,27 @@ namespace EduNetworkBuilder.Properties {
this["FormTransLastDir"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Collections.Specialized.StringCollection PuzzlesPassed {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["PuzzlesPassed"]));
}
set {
this["PuzzlesPassed"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Collections.Specialized.StringCollection PuzzlesFailed {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["PuzzlesFailed"]));
}
set {
this["PuzzlesFailed"] = value;
}
}
}
}

View File

@ -47,5 +47,11 @@
<Setting Name="FormTransLastDir" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="PuzzlesPassed" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="PuzzlesFailed" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>