namespace Млаумчерб.Клиент.классы; public class ArgumentsWithPlaceholders { protected List raw_args = new(); public List FillPlaceholders(Dictionary values) { List result = new(); foreach (var a in raw_args) { var f = a; int begin = a.IndexOf('$'); if (begin != -1) { int keyBegin = begin + 2; int end = a.IndexOf('}', keyBegin); if (end != -1) { var key = a.Substring(keyBegin, end - keyBegin); if (!values.TryGetValue(key, out var v)) throw new Exception($"can't find value for placeholder '{key}'"); f = v; } } result.Add(f); } return result; } }