public static void InNew(Action action, params Tuple <string, string>[] info) { int stackHeightBefore = FullContext.Count; int innerStackHeightBefore = FullContext.Last().Count; foreach (var tuple in info) { AddInfo(tuple.Item1, tuple.Item2); } action(); // may throw exception, that's the point ResetStack(stackHeightBefore, FullContext); ResetStack(innerStackHeightBefore, FullContext.Last()); }
public static void AddInfo(string key, Func <string> valueFunc) { FullContext.Last().Add(Tuple.Create(key, Lazy.Simple(valueFunc))); }
public static void AddInfo(string key, string value) { FullContext.Last().Add(Tuple.Create(key, Lazy.Const(value))); }