1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-30 15:06:06 +00:00

Key/value

This commit is contained in:
Yan Maniez 2019-04-14 02:43:47 +02:00
parent fcfb44c3c9
commit b0d38081e4
2 changed files with 20 additions and 0 deletions

View file

@ -346,6 +346,20 @@ namespace AideDeJeuLib
[IgnoreDataMember]
public Dictionary<string, string> Attributes { get; set; } = new Dictionary<string, string>();
public Dictionary<string, KeyValuePair<string, string>> AttributesKeyValue
{
get
{
var keys = Attributes.Keys.Where(a => a.EndsWith("Key") && Attributes.Keys.Contains(a.Substring(0, a.Length - 3) + "Value")).Select(a => a.Substring(0, a.Length - 3)).ToList();
var dico = new Dictionary<string, KeyValuePair<string, string>>();
foreach (var key in keys)
{
dico[key] = new KeyValuePair<string, string>(Attributes[key + "Key"], Attributes[key + "Value"]);
}
return dico;
}
}
[DataMember]
public string AttributesDictionary
{

View file

@ -305,6 +305,12 @@ namespace AideDeJeu.ViewModels
{
item.Attributes[propertyName] = inline.ToMarkdownString();
}
if (propertyName.EndsWith("Value"))
{
//Debug.WriteLine(item.AttributesKeyValue);
//Debug.WriteLine(item.AttributesDictionary);
Debug.WriteLine("break");
}
}
}
}