Exemplo n.º 1
0
 /// <summary>
 /// Sets the <paramref name="fieldName"/> list's values list as
 /// <paramref name="fieldValues"/>, meaning they're referenced
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="fieldValues"></param>
 /// <param name="addIfNotFound"></param>
 public void SetList(string fieldName, List <string> fieldValues, bool addIfNotFound = true)
 {
     if (ListValues.TryGetValue(fieldName, out List <string> unused))
     {
         ListValues[fieldName] = fieldValues;
     }
     else if (addIfNotFound)
     {
         ListValues.Add(fieldName, fieldValues);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Returns a reference of items within the specific list
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="listValues"></param>
 /// <returns></returns>
 public bool TryGetList(string fieldName, out List <string> listValues)
 {
     if (ListValues.TryGetValue(fieldName, out List <string> values))
     {
         listValues = values;
         return(true);
     }
     else
     {
         listValues = null;
         return(false);
     }
 }