Add default values to Configuration
This commit is contained in:
parent
915906e6ed
commit
eee785377f
23 changed files with 58 additions and 185 deletions
|
|
@ -30,7 +30,7 @@ namespace LibationWinForms.Dialogs
|
|||
private void UpgradeNotificationDialog_Load(object sender, EventArgs e)
|
||||
{
|
||||
//This dialog starts before Form1, soposition it at the center of where Form1 will be.
|
||||
var savedState = Configuration.Instance.GetNonString<FormSizeAndPosition>(nameof(Form1));
|
||||
var savedState = Configuration.Instance.GetNonString<FormSizeAndPosition>(defaultValue: null, nameof(Form1));
|
||||
|
||||
if (savedState is null) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace LibationWinForms
|
|||
{
|
||||
processBookQueue1.popoutBtn.Click += ProcessBookQueue1_PopOut;
|
||||
splitContainer1.Panel2MinSize = 350;
|
||||
var coppalseState = Configuration.Instance.GetNonString<bool>(nameof(splitContainer1.Panel2Collapsed));
|
||||
var coppalseState = Configuration.Instance.GetNonString(defaultValue: false, nameof(splitContainer1.Panel2Collapsed));
|
||||
WidthChange = splitContainer1.Panel2.Width + splitContainer1.SplitterWidth;
|
||||
int width = this.Width;
|
||||
SetQueueCollapseState(coppalseState);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace LibationWinForms
|
|||
|
||||
public static void RestoreSizeAndLocation(this Form form, Configuration config)
|
||||
{
|
||||
FormSizeAndPosition savedState = config.GetNonString<FormSizeAndPosition>(form.Name);
|
||||
var savedState = config.GetNonString<FormSizeAndPosition>(defaultValue: null, form.Name);
|
||||
|
||||
if (savedState is null)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -144,7 +144,6 @@ namespace LibationWinForms
|
|||
// INIT DEFAULT SETTINGS
|
||||
// if 'new user' was clicked, or if 'returning user' chose new install: show basic settings dialog
|
||||
config.Books ??= Path.Combine(defaultLibationFilesDir, "Books");
|
||||
AppScaffolding.LibationScaffolding.PopulateMissingConfigValues(config);
|
||||
|
||||
if (new SettingsDialog().ShowDialog() != DialogResult.OK)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace LibationWinForms
|
|||
const string ignoreUpdate = "IgnoreUpdate";
|
||||
var config = Configuration.Instance;
|
||||
|
||||
if (config.GetString(ignoreUpdate) == args.CurrentVersion)
|
||||
if (config.GetString(propertyName: ignoreUpdate) == args.CurrentVersion)
|
||||
return;
|
||||
|
||||
var notificationResult = new UpgradeNotificationDialog(upgradeProperties).ShowDialog();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue