Rename for clarity: AccountsSettings <=> Accounts

This commit is contained in:
Robert McRackan 2020-08-24 22:57:08 -04:00
parent 743644c4e9
commit 6900a68b9d
11 changed files with 265 additions and 277 deletions

View file

@ -82,12 +82,8 @@
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(776, 397);
this.dataGridView1.TabIndex = 0;
this.dataGridView1.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.dataGridView1_CellBeginEdit);
this.dataGridView1.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEndEdit);
this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DataGridView1_CellContentClick);
this.dataGridView1.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridView1_DefaultValuesNeeded);
this.dataGridView1.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.dataGridView1_RowsAdded);
this.dataGridView1.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(this.dataGridView1_RowsRemoved);
//
// Original
//

View file

@ -2,7 +2,6 @@
using System.Linq;
using System.Windows.Forms;
using AudibleApi;
using FileManager;
using InternalUtilities;
namespace LibationWinForms.Dialogs
@ -37,7 +36,12 @@ namespace LibationWinForms.Dialogs
private void populateGridValues()
{
var accounts = AudibleApiStorage.GetAccounts().AccountsSettings;
// WARNING
// behind the scenes this returns a AccountsSettings
// accounts persister will write ANY EDIT to object immediately to file
// here: copy strings
// only persist in 'save' step
var accounts = AudibleApiStorage.GetAccountsSettings().Accounts;
if (!accounts.Any())
return;
@ -92,42 +96,21 @@ namespace LibationWinForms.Dialogs
private void cancelBtn_Click(object sender, EventArgs e) => this.Close();
#region TEMP
private void saveBtn_Click(object sender, EventArgs e)
{
var accounts = AudibleApiStorage.GetAccountsSettings()
.Accounts;
// find added
// validate
// find deleted
// find edited
// validate
// persist
}
private void dataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
{
}
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
//if (e.ColumnIndex == dataGridView1.Columns["ItemID"].Index) //if the ItemID-cell is edited
//{
// dataGridView1.Rows[e.RowIndex].ReadOnly = true; // set all row as read-only
// dataGridView1.Rows[e.RowIndex].Cells["ItemID"].ReadOnly = false; //except ItemID-cell
//}
}
private void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
//if (dataGridView1.Rows[e.RowIndex].Cells["ItemID"].Value != null)
//{
// dataGridView1.Rows[e.RowIndex].ReadOnly = true; // set all row as read-only
// dataGridView1.Rows[e.RowIndex].Cells["ItemID"].ReadOnly = false; //except ItemID-cell
//}
}
private void dataGridView1_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
{
}
#endregion
}
}

View file

@ -283,6 +283,7 @@
}
#endregion
private System.Windows.Forms.Panel gridPanel;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem;
@ -309,4 +310,3 @@
private System.Windows.Forms.ToolStripMenuItem accountsToolStripMenuItem;
}
}