ssg: advanced config FrontMatterPanel: add getter for FrontMatterKeys

This commit is contained in:
Nick Vella 2019-08-01 23:52:18 +10:00
parent e28f2e64c4
commit b7751ca027
1 changed files with 14 additions and 0 deletions

View File

@ -71,8 +71,22 @@ namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced
dataGridView.Rows.Add(_keyRowMap[keyIdentifier]);
}
private string GetTableRow(KeyIdentifier keyIdentifier)
=> _keyRowMap[keyIdentifier].Cells[1].Value as string;
public StaticSiteConfigFrontMatterKeys Keys
{
get => new StaticSiteConfigFrontMatterKeys()
{
IdKey = GetTableRow(KeyIdentifier.Id),
TitleKey = GetTableRow(KeyIdentifier.Title),
DateKey = GetTableRow(KeyIdentifier.Date),
LayoutKey = GetTableRow(KeyIdentifier.Layout),
TagsKey = GetTableRow(KeyIdentifier.Tags),
PermalinkKey = GetTableRow(KeyIdentifier.Permalink),
ParentIdKey = GetTableRow(KeyIdentifier.ParentId)
};
set
{
_keyRowMap = new Dictionary<KeyIdentifier, DataGridViewRow>();