/// <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); } }
/// <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); } }