private IEnumerable <string> GetPairs(bool encodeSpaceAsPlus) { foreach (string key in orderedKeys) { object val = this[key]; if (val == null) { continue; } if (val is string || !(val is IEnumerable)) { yield return(key + "=" + TrexUri.EncodeQueryParamValue(val, encodeSpaceAsPlus)); } else { foreach (var subval in val as IEnumerable) { if (subval == null) { continue; } yield return(key + "=" + TrexUri.EncodeQueryParamValue(subval, encodeSpaceAsPlus)); } } } }