mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 07:26:09 +00:00 
			
		
		
		
	Key/value
This commit is contained in:
		
							parent
							
								
									fcfb44c3c9
								
							
						
					
					
						commit
						b0d38081e4
					
				
					 2 changed files with 20 additions and 0 deletions
				
			
		|  | @ -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 | ||||
|         { | ||||
|  |  | |||
|  | @ -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"); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez